Lines Matching full:tuples
435 offsetof(struct hclge_fd_rule, tuples.dst_mac),
438 offsetof(struct hclge_fd_rule, tuples.src_mac),
441 offsetof(struct hclge_fd_rule, tuples.vlan_tag1),
445 offsetof(struct hclge_fd_rule, tuples.ether_proto),
448 offsetof(struct hclge_fd_rule, tuples.l2_user_def),
451 offsetof(struct hclge_fd_rule, tuples.ip_tos),
454 offsetof(struct hclge_fd_rule, tuples.ip_proto),
457 offsetof(struct hclge_fd_rule, tuples.src_ip),
460 offsetof(struct hclge_fd_rule, tuples.dst_ip),
463 offsetof(struct hclge_fd_rule, tuples.l3_user_def),
466 offsetof(struct hclge_fd_rule, tuples.src_port),
469 offsetof(struct hclge_fd_rule, tuples.dst_port),
472 offsetof(struct hclge_fd_rule, tuples.l4_user_def),
5567 /* If use max 400bit key, we can support tuples for ether type */ in hclge_init_fd_config()
6235 rule->tuples.src_ip[IPV4_INDEX] = in hclge_fd_get_tcpip4_tuple()
6240 rule->tuples.dst_ip[IPV4_INDEX] = in hclge_fd_get_tcpip4_tuple()
6245 rule->tuples.src_port = be16_to_cpu(fs->h_u.tcp_ip4_spec.psrc); in hclge_fd_get_tcpip4_tuple()
6248 rule->tuples.dst_port = be16_to_cpu(fs->h_u.tcp_ip4_spec.pdst); in hclge_fd_get_tcpip4_tuple()
6251 rule->tuples.ip_tos = fs->h_u.tcp_ip4_spec.tos; in hclge_fd_get_tcpip4_tuple()
6254 rule->tuples.ether_proto = ETH_P_IP; in hclge_fd_get_tcpip4_tuple()
6257 rule->tuples.ip_proto = ip_proto; in hclge_fd_get_tcpip4_tuple()
6265 rule->tuples.src_ip[IPV4_INDEX] = in hclge_fd_get_ip4_tuple()
6270 rule->tuples.dst_ip[IPV4_INDEX] = in hclge_fd_get_ip4_tuple()
6275 rule->tuples.ip_tos = fs->h_u.usr_ip4_spec.tos; in hclge_fd_get_ip4_tuple()
6278 rule->tuples.ip_proto = fs->h_u.usr_ip4_spec.proto; in hclge_fd_get_ip4_tuple()
6281 rule->tuples.ether_proto = ETH_P_IP; in hclge_fd_get_ip4_tuple()
6289 be32_to_cpu_array(rule->tuples.src_ip, fs->h_u.tcp_ip6_spec.ip6src, in hclge_fd_get_tcpip6_tuple()
6294 be32_to_cpu_array(rule->tuples.dst_ip, fs->h_u.tcp_ip6_spec.ip6dst, in hclge_fd_get_tcpip6_tuple()
6299 rule->tuples.src_port = be16_to_cpu(fs->h_u.tcp_ip6_spec.psrc); in hclge_fd_get_tcpip6_tuple()
6302 rule->tuples.dst_port = be16_to_cpu(fs->h_u.tcp_ip6_spec.pdst); in hclge_fd_get_tcpip6_tuple()
6305 rule->tuples.ether_proto = ETH_P_IPV6; in hclge_fd_get_tcpip6_tuple()
6308 rule->tuples.ip_tos = fs->h_u.tcp_ip6_spec.tclass; in hclge_fd_get_tcpip6_tuple()
6311 rule->tuples.ip_proto = ip_proto; in hclge_fd_get_tcpip6_tuple()
6319 be32_to_cpu_array(rule->tuples.src_ip, fs->h_u.usr_ip6_spec.ip6src, in hclge_fd_get_ip6_tuple()
6324 be32_to_cpu_array(rule->tuples.dst_ip, fs->h_u.usr_ip6_spec.ip6dst, in hclge_fd_get_ip6_tuple()
6329 rule->tuples.ip_proto = fs->h_u.usr_ip6_spec.l4_proto; in hclge_fd_get_ip6_tuple()
6332 rule->tuples.ip_tos = fs->h_u.tcp_ip6_spec.tclass; in hclge_fd_get_ip6_tuple()
6335 rule->tuples.ether_proto = ETH_P_IPV6; in hclge_fd_get_ip6_tuple()
6343 ether_addr_copy(rule->tuples.src_mac, fs->h_u.ether_spec.h_source); in hclge_fd_get_ether_tuple()
6346 ether_addr_copy(rule->tuples.dst_mac, fs->h_u.ether_spec.h_dest); in hclge_fd_get_ether_tuple()
6349 rule->tuples.ether_proto = be16_to_cpu(fs->h_u.ether_spec.h_proto); in hclge_fd_get_ether_tuple()
6358 rule->tuples.l2_user_def = info->data; in hclge_fd_get_user_def_tuple()
6362 rule->tuples.l3_user_def = info->data; in hclge_fd_get_user_def_tuple()
6366 rule->tuples.l4_user_def = (u32)info->data << 16; in hclge_fd_get_user_def_tuple()
6416 rule->tuples.vlan_tag1 = be16_to_cpu(fs->h_ext.vlan_tci); in hclge_fd_get_tuple()
6422 ether_addr_copy(rule->tuples.dst_mac, fs->h_ext.h_dest); in hclge_fd_get_tuple()
6710 spec->ip4src = cpu_to_be32(rule->tuples.src_ip[IPV4_INDEX]); in hclge_fd_get_tcpip4_info()
6714 spec->ip4dst = cpu_to_be32(rule->tuples.dst_ip[IPV4_INDEX]); in hclge_fd_get_tcpip4_info()
6718 spec->psrc = cpu_to_be16(rule->tuples.src_port); in hclge_fd_get_tcpip4_info()
6722 spec->pdst = cpu_to_be16(rule->tuples.dst_port); in hclge_fd_get_tcpip4_info()
6726 spec->tos = rule->tuples.ip_tos; in hclge_fd_get_tcpip4_info()
6735 spec->ip4src = cpu_to_be32(rule->tuples.src_ip[IPV4_INDEX]); in hclge_fd_get_ip4_info()
6739 spec->ip4dst = cpu_to_be32(rule->tuples.dst_ip[IPV4_INDEX]); in hclge_fd_get_ip4_info()
6743 spec->tos = rule->tuples.ip_tos; in hclge_fd_get_ip4_info()
6747 spec->proto = rule->tuples.ip_proto; in hclge_fd_get_ip4_info()
6759 rule->tuples.src_ip, IPV6_SIZE); in hclge_fd_get_tcpip6_info()
6761 rule->tuples.dst_ip, IPV6_SIZE); in hclge_fd_get_tcpip6_info()
6774 spec->tclass = rule->tuples.ip_tos; in hclge_fd_get_tcpip6_info()
6778 spec->psrc = cpu_to_be16(rule->tuples.src_port); in hclge_fd_get_tcpip6_info()
6782 spec->pdst = cpu_to_be16(rule->tuples.dst_port); in hclge_fd_get_tcpip6_info()
6791 cpu_to_be32_array(spec->ip6src, rule->tuples.src_ip, IPV6_SIZE); in hclge_fd_get_ip6_info()
6792 cpu_to_be32_array(spec->ip6dst, rule->tuples.dst_ip, IPV6_SIZE); in hclge_fd_get_ip6_info()
6805 spec->tclass = rule->tuples.ip_tos; in hclge_fd_get_ip6_info()
6809 spec->l4_proto = rule->tuples.ip_proto; in hclge_fd_get_ip6_info()
6818 ether_addr_copy(spec->h_source, rule->tuples.src_mac); in hclge_fd_get_ether_info()
6819 ether_addr_copy(spec->h_dest, rule->tuples.dst_mac); in hclge_fd_get_ether_info()
6831 spec->h_proto = cpu_to_be16(rule->tuples.ether_proto); in hclge_fd_get_ether_info()
6858 fs->h_ext.vlan_tci = cpu_to_be16(rule->tuples.vlan_tag1); in hclge_fd_get_ext_info()
6867 ether_addr_copy(fs->h_ext.h_dest, rule->tuples.dst_mac); in hclge_fd_get_ext_info()
7006 struct hclge_fd_rule_tuples *tuples) in hclge_fd_get_flow_tuples() argument
7011 tuples->ether_proto = be16_to_cpu(fkeys->basic.n_proto); in hclge_fd_get_flow_tuples()
7012 tuples->ip_proto = fkeys->basic.ip_proto; in hclge_fd_get_flow_tuples()
7013 tuples->dst_port = be16_to_cpu(fkeys->ports.dst); in hclge_fd_get_flow_tuples()
7016 tuples->src_ip[3] = be32_to_cpu(fkeys->addrs.v4addrs.src); in hclge_fd_get_flow_tuples()
7017 tuples->dst_ip[3] = be32_to_cpu(fkeys->addrs.v4addrs.dst); in hclge_fd_get_flow_tuples()
7022 tuples->src_ip[i] = be32_to_cpu(flow_ip6_src[i]); in hclge_fd_get_flow_tuples()
7023 tuples->dst_ip[i] = be32_to_cpu(flow_ip6_dst[i]); in hclge_fd_get_flow_tuples()
7028 /* traverse all rules, check whether an existed rule has the same tuples */
7031 const struct hclge_fd_rule_tuples *tuples) in hclge_fd_search_flow_keys() argument
7037 if (!memcmp(tuples, &rule->tuples, sizeof(*tuples))) in hclge_fd_search_flow_keys()
7044 static void hclge_fd_build_arfs_rule(const struct hclge_fd_rule_tuples *tuples, in hclge_fd_build_arfs_rule() argument
7054 if (tuples->ether_proto == ETH_P_IP) { in hclge_fd_build_arfs_rule()
7055 if (tuples->ip_proto == IPPROTO_TCP) in hclge_fd_build_arfs_rule()
7060 if (tuples->ip_proto == IPPROTO_TCP) in hclge_fd_build_arfs_rule()
7065 memcpy(&rule->tuples, tuples, sizeof(rule->tuples)); in hclge_fd_build_arfs_rule()
7203 rule->tuples.ether_proto = ethtype_key; in hclge_get_cls_key_basic()
7205 rule->tuples.ip_proto = match.key->ip_proto; in hclge_get_cls_key_basic()
7220 ether_addr_copy(rule->tuples.dst_mac, match.key->dst); in hclge_get_cls_key_mac()
7222 ether_addr_copy(rule->tuples.src_mac, match.key->src); in hclge_get_cls_key_mac()
7237 rule->tuples.vlan_tag1 = match.key->vlan_id | in hclge_get_cls_key_vlan()
7262 rule->tuples.src_ip[IPV4_INDEX] = be32_to_cpu(match.key->src); in hclge_get_cls_key_ip()
7265 rule->tuples.dst_ip[IPV4_INDEX] = be32_to_cpu(match.key->dst); in hclge_get_cls_key_ip()
7272 be32_to_cpu_array(rule->tuples.src_ip, match.key->src.s6_addr32, in hclge_get_cls_key_ip()
7276 be32_to_cpu_array(rule->tuples.dst_ip, match.key->dst.s6_addr32, in hclge_get_cls_key_ip()
7294 rule->tuples.src_port = be16_to_cpu(match.key->src); in hclge_get_cls_key_port()
7296 rule->tuples.dst_port = be16_to_cpu(match.key->dst); in hclge_get_cls_key_port()