Lines Matching full:tuples
343 offsetof(struct hclge_fd_rule, tuples.dst_mac),
346 offsetof(struct hclge_fd_rule, tuples.src_mac),
349 offsetof(struct hclge_fd_rule, tuples.vlan_tag1),
353 offsetof(struct hclge_fd_rule, tuples.ether_proto),
356 offsetof(struct hclge_fd_rule, tuples.l2_user_def),
359 offsetof(struct hclge_fd_rule, tuples.ip_tos),
362 offsetof(struct hclge_fd_rule, tuples.ip_proto),
365 offsetof(struct hclge_fd_rule, tuples.src_ip),
368 offsetof(struct hclge_fd_rule, tuples.dst_ip),
371 offsetof(struct hclge_fd_rule, tuples.l3_user_def),
374 offsetof(struct hclge_fd_rule, tuples.src_port),
377 offsetof(struct hclge_fd_rule, tuples.dst_port),
380 offsetof(struct hclge_fd_rule, tuples.l4_user_def),
5591 /* If use max 400bit key, we can support tuples for ether type */ in hclge_init_fd_config()
6258 rule->tuples.src_ip[IPV4_INDEX] = in hclge_fd_get_tcpip4_tuple()
6263 rule->tuples.dst_ip[IPV4_INDEX] = in hclge_fd_get_tcpip4_tuple()
6268 rule->tuples.src_port = be16_to_cpu(fs->h_u.tcp_ip4_spec.psrc); in hclge_fd_get_tcpip4_tuple()
6271 rule->tuples.dst_port = be16_to_cpu(fs->h_u.tcp_ip4_spec.pdst); in hclge_fd_get_tcpip4_tuple()
6274 rule->tuples.ip_tos = fs->h_u.tcp_ip4_spec.tos; in hclge_fd_get_tcpip4_tuple()
6277 rule->tuples.ether_proto = ETH_P_IP; in hclge_fd_get_tcpip4_tuple()
6280 rule->tuples.ip_proto = ip_proto; in hclge_fd_get_tcpip4_tuple()
6287 rule->tuples.src_ip[IPV4_INDEX] = in hclge_fd_get_ip4_tuple()
6292 rule->tuples.dst_ip[IPV4_INDEX] = in hclge_fd_get_ip4_tuple()
6297 rule->tuples.ip_tos = fs->h_u.usr_ip4_spec.tos; in hclge_fd_get_ip4_tuple()
6300 rule->tuples.ip_proto = fs->h_u.usr_ip4_spec.proto; in hclge_fd_get_ip4_tuple()
6303 rule->tuples.ether_proto = ETH_P_IP; in hclge_fd_get_ip4_tuple()
6310 ipv6_addr_be32_to_cpu(rule->tuples.src_ip, in hclge_fd_get_tcpip6_tuple()
6315 ipv6_addr_be32_to_cpu(rule->tuples.dst_ip, in hclge_fd_get_tcpip6_tuple()
6320 rule->tuples.src_port = be16_to_cpu(fs->h_u.tcp_ip6_spec.psrc); in hclge_fd_get_tcpip6_tuple()
6323 rule->tuples.dst_port = be16_to_cpu(fs->h_u.tcp_ip6_spec.pdst); in hclge_fd_get_tcpip6_tuple()
6326 rule->tuples.ether_proto = ETH_P_IPV6; in hclge_fd_get_tcpip6_tuple()
6329 rule->tuples.ip_tos = fs->h_u.tcp_ip6_spec.tclass; in hclge_fd_get_tcpip6_tuple()
6332 rule->tuples.ip_proto = ip_proto; in hclge_fd_get_tcpip6_tuple()
6339 ipv6_addr_be32_to_cpu(rule->tuples.src_ip, in hclge_fd_get_ip6_tuple()
6344 ipv6_addr_be32_to_cpu(rule->tuples.dst_ip, in hclge_fd_get_ip6_tuple()
6349 rule->tuples.ip_proto = fs->h_u.usr_ip6_spec.l4_proto; in hclge_fd_get_ip6_tuple()
6352 rule->tuples.ip_tos = fs->h_u.tcp_ip6_spec.tclass; in hclge_fd_get_ip6_tuple()
6355 rule->tuples.ether_proto = ETH_P_IPV6; in hclge_fd_get_ip6_tuple()
6362 ether_addr_copy(rule->tuples.src_mac, fs->h_u.ether_spec.h_source); in hclge_fd_get_ether_tuple()
6365 ether_addr_copy(rule->tuples.dst_mac, fs->h_u.ether_spec.h_dest); in hclge_fd_get_ether_tuple()
6368 rule->tuples.ether_proto = be16_to_cpu(fs->h_u.ether_spec.h_proto); in hclge_fd_get_ether_tuple()
6377 rule->tuples.l2_user_def = info->data; in hclge_fd_get_user_def_tuple()
6381 rule->tuples.l3_user_def = info->data; in hclge_fd_get_user_def_tuple()
6385 rule->tuples.l4_user_def = (u32)info->data << 16; in hclge_fd_get_user_def_tuple()
6434 rule->tuples.vlan_tag1 = be16_to_cpu(fs->h_ext.vlan_tci); in hclge_fd_get_tuple()
6440 ether_addr_copy(rule->tuples.dst_mac, fs->h_ext.h_dest); in hclge_fd_get_tuple()
6728 spec->ip4src = cpu_to_be32(rule->tuples.src_ip[IPV4_INDEX]); in hclge_fd_get_tcpip4_info()
6732 spec->ip4dst = cpu_to_be32(rule->tuples.dst_ip[IPV4_INDEX]); in hclge_fd_get_tcpip4_info()
6736 spec->psrc = cpu_to_be16(rule->tuples.src_port); in hclge_fd_get_tcpip4_info()
6740 spec->pdst = cpu_to_be16(rule->tuples.dst_port); in hclge_fd_get_tcpip4_info()
6744 spec->tos = rule->tuples.ip_tos; in hclge_fd_get_tcpip4_info()
6753 spec->ip4src = cpu_to_be32(rule->tuples.src_ip[IPV4_INDEX]); in hclge_fd_get_ip4_info()
6757 spec->ip4dst = cpu_to_be32(rule->tuples.dst_ip[IPV4_INDEX]); in hclge_fd_get_ip4_info()
6761 spec->tos = rule->tuples.ip_tos; in hclge_fd_get_ip4_info()
6765 spec->proto = rule->tuples.ip_proto; in hclge_fd_get_ip4_info()
6776 ipv6_addr_cpu_to_be32(spec->ip6src, rule->tuples.src_ip); in hclge_fd_get_tcpip6_info()
6777 ipv6_addr_cpu_to_be32(spec->ip6dst, rule->tuples.dst_ip); in hclge_fd_get_tcpip6_info()
6790 spec->tclass = rule->tuples.ip_tos; in hclge_fd_get_tcpip6_info()
6794 spec->psrc = cpu_to_be16(rule->tuples.src_port); in hclge_fd_get_tcpip6_info()
6798 spec->pdst = cpu_to_be16(rule->tuples.dst_port); in hclge_fd_get_tcpip6_info()
6807 ipv6_addr_cpu_to_be32(spec->ip6src, rule->tuples.src_ip); in hclge_fd_get_ip6_info()
6808 ipv6_addr_cpu_to_be32(spec->ip6dst, rule->tuples.dst_ip); in hclge_fd_get_ip6_info()
6821 spec->tclass = rule->tuples.ip_tos; in hclge_fd_get_ip6_info()
6825 spec->l4_proto = rule->tuples.ip_proto; in hclge_fd_get_ip6_info()
6834 ether_addr_copy(spec->h_source, rule->tuples.src_mac); in hclge_fd_get_ether_info()
6835 ether_addr_copy(spec->h_dest, rule->tuples.dst_mac); in hclge_fd_get_ether_info()
6847 spec->h_proto = cpu_to_be16(rule->tuples.ether_proto); in hclge_fd_get_ether_info()
6874 fs->h_ext.vlan_tci = cpu_to_be16(rule->tuples.vlan_tag1); in hclge_fd_get_ext_info()
6883 ether_addr_copy(fs->h_ext.h_dest, rule->tuples.dst_mac); in hclge_fd_get_ext_info()
7022 struct hclge_fd_rule_tuples *tuples) in hclge_fd_get_flow_tuples() argument
7027 tuples->ether_proto = be16_to_cpu(fkeys->basic.n_proto); in hclge_fd_get_flow_tuples()
7028 tuples->ip_proto = fkeys->basic.ip_proto; in hclge_fd_get_flow_tuples()
7029 tuples->dst_port = be16_to_cpu(fkeys->ports.dst); in hclge_fd_get_flow_tuples()
7032 tuples->src_ip[3] = be32_to_cpu(fkeys->addrs.v4addrs.src); in hclge_fd_get_flow_tuples()
7033 tuples->dst_ip[3] = be32_to_cpu(fkeys->addrs.v4addrs.dst); in hclge_fd_get_flow_tuples()
7038 tuples->src_ip[i] = be32_to_cpu(flow_ip6_src[i]); in hclge_fd_get_flow_tuples()
7039 tuples->dst_ip[i] = be32_to_cpu(flow_ip6_dst[i]); in hclge_fd_get_flow_tuples()
7044 /* traverse all rules, check whether an existed rule has the same tuples */
7047 const struct hclge_fd_rule_tuples *tuples) in hclge_fd_search_flow_keys() argument
7053 if (!memcmp(tuples, &rule->tuples, sizeof(*tuples))) in hclge_fd_search_flow_keys()
7060 static void hclge_fd_build_arfs_rule(const struct hclge_fd_rule_tuples *tuples, in hclge_fd_build_arfs_rule() argument
7070 if (tuples->ether_proto == ETH_P_IP) { in hclge_fd_build_arfs_rule()
7071 if (tuples->ip_proto == IPPROTO_TCP) in hclge_fd_build_arfs_rule()
7076 if (tuples->ip_proto == IPPROTO_TCP) in hclge_fd_build_arfs_rule()
7081 memcpy(&rule->tuples, tuples, sizeof(rule->tuples)); in hclge_fd_build_arfs_rule()
7219 rule->tuples.ether_proto = ethtype_key; in hclge_get_cls_key_basic()
7221 rule->tuples.ip_proto = match.key->ip_proto; in hclge_get_cls_key_basic()
7236 ether_addr_copy(rule->tuples.dst_mac, match.key->dst); in hclge_get_cls_key_mac()
7238 ether_addr_copy(rule->tuples.src_mac, match.key->src); in hclge_get_cls_key_mac()
7253 rule->tuples.vlan_tag1 = match.key->vlan_id | in hclge_get_cls_key_vlan()
7282 rule->tuples.src_ip[IPV4_INDEX] = be32_to_cpu(match.key->src); in hclge_get_cls_key_ip()
7285 rule->tuples.dst_ip[IPV4_INDEX] = be32_to_cpu(match.key->dst); in hclge_get_cls_key_ip()
7292 ipv6_addr_be32_to_cpu(rule->tuples.src_ip, in hclge_get_cls_key_ip()
7296 ipv6_addr_be32_to_cpu(rule->tuples.dst_ip, in hclge_get_cls_key_ip()
7316 rule->tuples.src_port = be16_to_cpu(match.key->src); in hclge_get_cls_key_port()
7318 rule->tuples.dst_port = be16_to_cpu(match.key->dst); in hclge_get_cls_key_port()