Lines Matching full:tuples

339 	  offsetof(struct hclge_fd_rule, tuples.dst_mac),
342 offsetof(struct hclge_fd_rule, tuples.src_mac),
345 offsetof(struct hclge_fd_rule, tuples.vlan_tag1),
349 offsetof(struct hclge_fd_rule, tuples.ether_proto),
352 offsetof(struct hclge_fd_rule, tuples.l2_user_def),
355 offsetof(struct hclge_fd_rule, tuples.ip_tos),
358 offsetof(struct hclge_fd_rule, tuples.ip_proto),
361 offsetof(struct hclge_fd_rule, tuples.src_ip),
364 offsetof(struct hclge_fd_rule, tuples.dst_ip),
367 offsetof(struct hclge_fd_rule, tuples.l3_user_def),
370 offsetof(struct hclge_fd_rule, tuples.src_port),
373 offsetof(struct hclge_fd_rule, tuples.dst_port),
376 offsetof(struct hclge_fd_rule, tuples.l4_user_def),
5492 /* If use max 400bit key, we can support tuples for ether type */ in hclge_init_fd_config()
6159 rule->tuples.src_ip[IPV4_INDEX] = in hclge_fd_get_tcpip4_tuple()
6164 rule->tuples.dst_ip[IPV4_INDEX] = in hclge_fd_get_tcpip4_tuple()
6169 rule->tuples.src_port = be16_to_cpu(fs->h_u.tcp_ip4_spec.psrc); in hclge_fd_get_tcpip4_tuple()
6172 rule->tuples.dst_port = be16_to_cpu(fs->h_u.tcp_ip4_spec.pdst); in hclge_fd_get_tcpip4_tuple()
6175 rule->tuples.ip_tos = fs->h_u.tcp_ip4_spec.tos; in hclge_fd_get_tcpip4_tuple()
6178 rule->tuples.ether_proto = ETH_P_IP; in hclge_fd_get_tcpip4_tuple()
6181 rule->tuples.ip_proto = ip_proto; in hclge_fd_get_tcpip4_tuple()
6188 rule->tuples.src_ip[IPV4_INDEX] = in hclge_fd_get_ip4_tuple()
6193 rule->tuples.dst_ip[IPV4_INDEX] = in hclge_fd_get_ip4_tuple()
6198 rule->tuples.ip_tos = fs->h_u.usr_ip4_spec.tos; in hclge_fd_get_ip4_tuple()
6201 rule->tuples.ip_proto = fs->h_u.usr_ip4_spec.proto; in hclge_fd_get_ip4_tuple()
6204 rule->tuples.ether_proto = ETH_P_IP; in hclge_fd_get_ip4_tuple()
6211 be32_to_cpu_array(rule->tuples.src_ip, fs->h_u.tcp_ip6_spec.ip6src, in hclge_fd_get_tcpip6_tuple()
6216 be32_to_cpu_array(rule->tuples.dst_ip, fs->h_u.tcp_ip6_spec.ip6dst, in hclge_fd_get_tcpip6_tuple()
6221 rule->tuples.src_port = be16_to_cpu(fs->h_u.tcp_ip6_spec.psrc); in hclge_fd_get_tcpip6_tuple()
6224 rule->tuples.dst_port = be16_to_cpu(fs->h_u.tcp_ip6_spec.pdst); in hclge_fd_get_tcpip6_tuple()
6227 rule->tuples.ether_proto = ETH_P_IPV6; in hclge_fd_get_tcpip6_tuple()
6230 rule->tuples.ip_tos = fs->h_u.tcp_ip6_spec.tclass; in hclge_fd_get_tcpip6_tuple()
6233 rule->tuples.ip_proto = ip_proto; in hclge_fd_get_tcpip6_tuple()
6240 be32_to_cpu_array(rule->tuples.src_ip, fs->h_u.usr_ip6_spec.ip6src, in hclge_fd_get_ip6_tuple()
6245 be32_to_cpu_array(rule->tuples.dst_ip, fs->h_u.usr_ip6_spec.ip6dst, in hclge_fd_get_ip6_tuple()
6250 rule->tuples.ip_proto = fs->h_u.usr_ip6_spec.l4_proto; in hclge_fd_get_ip6_tuple()
6253 rule->tuples.ip_tos = fs->h_u.tcp_ip6_spec.tclass; in hclge_fd_get_ip6_tuple()
6256 rule->tuples.ether_proto = ETH_P_IPV6; in hclge_fd_get_ip6_tuple()
6263 ether_addr_copy(rule->tuples.src_mac, fs->h_u.ether_spec.h_source); in hclge_fd_get_ether_tuple()
6266 ether_addr_copy(rule->tuples.dst_mac, fs->h_u.ether_spec.h_dest); in hclge_fd_get_ether_tuple()
6269 rule->tuples.ether_proto = be16_to_cpu(fs->h_u.ether_spec.h_proto); in hclge_fd_get_ether_tuple()
6278 rule->tuples.l2_user_def = info->data; in hclge_fd_get_user_def_tuple()
6282 rule->tuples.l3_user_def = info->data; in hclge_fd_get_user_def_tuple()
6286 rule->tuples.l4_user_def = (u32)info->data << 16; in hclge_fd_get_user_def_tuple()
6335 rule->tuples.vlan_tag1 = be16_to_cpu(fs->h_ext.vlan_tci); in hclge_fd_get_tuple()
6341 ether_addr_copy(rule->tuples.dst_mac, fs->h_ext.h_dest); in hclge_fd_get_tuple()
6629 spec->ip4src = cpu_to_be32(rule->tuples.src_ip[IPV4_INDEX]); in hclge_fd_get_tcpip4_info()
6633 spec->ip4dst = cpu_to_be32(rule->tuples.dst_ip[IPV4_INDEX]); in hclge_fd_get_tcpip4_info()
6637 spec->psrc = cpu_to_be16(rule->tuples.src_port); in hclge_fd_get_tcpip4_info()
6641 spec->pdst = cpu_to_be16(rule->tuples.dst_port); in hclge_fd_get_tcpip4_info()
6645 spec->tos = rule->tuples.ip_tos; in hclge_fd_get_tcpip4_info()
6654 spec->ip4src = cpu_to_be32(rule->tuples.src_ip[IPV4_INDEX]); in hclge_fd_get_ip4_info()
6658 spec->ip4dst = cpu_to_be32(rule->tuples.dst_ip[IPV4_INDEX]); in hclge_fd_get_ip4_info()
6662 spec->tos = rule->tuples.ip_tos; in hclge_fd_get_ip4_info()
6666 spec->proto = rule->tuples.ip_proto; in hclge_fd_get_ip4_info()
6678 rule->tuples.src_ip, IPV6_SIZE); in hclge_fd_get_tcpip6_info()
6680 rule->tuples.dst_ip, IPV6_SIZE); in hclge_fd_get_tcpip6_info()
6693 spec->tclass = rule->tuples.ip_tos; in hclge_fd_get_tcpip6_info()
6697 spec->psrc = cpu_to_be16(rule->tuples.src_port); in hclge_fd_get_tcpip6_info()
6701 spec->pdst = cpu_to_be16(rule->tuples.dst_port); in hclge_fd_get_tcpip6_info()
6710 cpu_to_be32_array(spec->ip6src, rule->tuples.src_ip, IPV6_SIZE); in hclge_fd_get_ip6_info()
6711 cpu_to_be32_array(spec->ip6dst, rule->tuples.dst_ip, IPV6_SIZE); in hclge_fd_get_ip6_info()
6724 spec->tclass = rule->tuples.ip_tos; in hclge_fd_get_ip6_info()
6728 spec->l4_proto = rule->tuples.ip_proto; in hclge_fd_get_ip6_info()
6737 ether_addr_copy(spec->h_source, rule->tuples.src_mac); in hclge_fd_get_ether_info()
6738 ether_addr_copy(spec->h_dest, rule->tuples.dst_mac); in hclge_fd_get_ether_info()
6750 spec->h_proto = cpu_to_be16(rule->tuples.ether_proto); in hclge_fd_get_ether_info()
6777 fs->h_ext.vlan_tci = cpu_to_be16(rule->tuples.vlan_tag1); in hclge_fd_get_ext_info()
6786 ether_addr_copy(fs->h_ext.h_dest, rule->tuples.dst_mac); in hclge_fd_get_ext_info()
6925 struct hclge_fd_rule_tuples *tuples) in hclge_fd_get_flow_tuples() argument
6930 tuples->ether_proto = be16_to_cpu(fkeys->basic.n_proto); in hclge_fd_get_flow_tuples()
6931 tuples->ip_proto = fkeys->basic.ip_proto; in hclge_fd_get_flow_tuples()
6932 tuples->dst_port = be16_to_cpu(fkeys->ports.dst); in hclge_fd_get_flow_tuples()
6935 tuples->src_ip[3] = be32_to_cpu(fkeys->addrs.v4addrs.src); in hclge_fd_get_flow_tuples()
6936 tuples->dst_ip[3] = be32_to_cpu(fkeys->addrs.v4addrs.dst); in hclge_fd_get_flow_tuples()
6941 tuples->src_ip[i] = be32_to_cpu(flow_ip6_src[i]); in hclge_fd_get_flow_tuples()
6942 tuples->dst_ip[i] = be32_to_cpu(flow_ip6_dst[i]); in hclge_fd_get_flow_tuples()
6947 /* traverse all rules, check whether an existed rule has the same tuples */
6950 const struct hclge_fd_rule_tuples *tuples) in hclge_fd_search_flow_keys() argument
6956 if (!memcmp(tuples, &rule->tuples, sizeof(*tuples))) in hclge_fd_search_flow_keys()
6963 static void hclge_fd_build_arfs_rule(const struct hclge_fd_rule_tuples *tuples, in hclge_fd_build_arfs_rule() argument
6973 if (tuples->ether_proto == ETH_P_IP) { in hclge_fd_build_arfs_rule()
6974 if (tuples->ip_proto == IPPROTO_TCP) in hclge_fd_build_arfs_rule()
6979 if (tuples->ip_proto == IPPROTO_TCP) in hclge_fd_build_arfs_rule()
6984 memcpy(&rule->tuples, tuples, sizeof(rule->tuples)); in hclge_fd_build_arfs_rule()
7122 rule->tuples.ether_proto = ethtype_key; in hclge_get_cls_key_basic()
7124 rule->tuples.ip_proto = match.key->ip_proto; in hclge_get_cls_key_basic()
7139 ether_addr_copy(rule->tuples.dst_mac, match.key->dst); in hclge_get_cls_key_mac()
7141 ether_addr_copy(rule->tuples.src_mac, match.key->src); in hclge_get_cls_key_mac()
7156 rule->tuples.vlan_tag1 = match.key->vlan_id | in hclge_get_cls_key_vlan()
7181 rule->tuples.src_ip[IPV4_INDEX] = be32_to_cpu(match.key->src); in hclge_get_cls_key_ip()
7184 rule->tuples.dst_ip[IPV4_INDEX] = be32_to_cpu(match.key->dst); in hclge_get_cls_key_ip()
7191 be32_to_cpu_array(rule->tuples.src_ip, match.key->src.s6_addr32, in hclge_get_cls_key_ip()
7195 be32_to_cpu_array(rule->tuples.dst_ip, match.key->dst.s6_addr32, in hclge_get_cls_key_ip()
7213 rule->tuples.src_port = be16_to_cpu(match.key->src); in hclge_get_cls_key_port()
7215 rule->tuples.dst_port = be16_to_cpu(match.key->dst); in hclge_get_cls_key_port()