Lines Matching full:tuples

4990 	/* If use max 400bit key, we can support tuples for ether type */  in hclge_init_fd_config()
5105 calc_x(key_x[ETH_ALEN - 1 - i], rule->tuples.dst_mac[i], in hclge_fd_convert_tuple()
5107 calc_y(key_y[ETH_ALEN - 1 - i], rule->tuples.dst_mac[i], in hclge_fd_convert_tuple()
5114 calc_x(key_x[ETH_ALEN - 1 - i], rule->tuples.src_mac[i], in hclge_fd_convert_tuple()
5115 rule->tuples.src_mac[i]); in hclge_fd_convert_tuple()
5116 calc_y(key_y[ETH_ALEN - 1 - i], rule->tuples.src_mac[i], in hclge_fd_convert_tuple()
5117 rule->tuples.src_mac[i]); in hclge_fd_convert_tuple()
5122 calc_x(tmp_x_s, rule->tuples.vlan_tag1, in hclge_fd_convert_tuple()
5124 calc_y(tmp_y_s, rule->tuples.vlan_tag1, in hclge_fd_convert_tuple()
5131 calc_x(tmp_x_s, rule->tuples.ether_proto, in hclge_fd_convert_tuple()
5133 calc_y(tmp_y_s, rule->tuples.ether_proto, in hclge_fd_convert_tuple()
5140 calc_x(*key_x, rule->tuples.ip_tos, rule->tuples_mask.ip_tos); in hclge_fd_convert_tuple()
5141 calc_y(*key_y, rule->tuples.ip_tos, rule->tuples_mask.ip_tos); in hclge_fd_convert_tuple()
5145 calc_x(*key_x, rule->tuples.ip_proto, in hclge_fd_convert_tuple()
5147 calc_y(*key_y, rule->tuples.ip_proto, in hclge_fd_convert_tuple()
5152 calc_x(tmp_x_l, rule->tuples.src_ip[IPV4_INDEX], in hclge_fd_convert_tuple()
5154 calc_y(tmp_y_l, rule->tuples.src_ip[IPV4_INDEX], in hclge_fd_convert_tuple()
5161 calc_x(tmp_x_l, rule->tuples.dst_ip[IPV4_INDEX], in hclge_fd_convert_tuple()
5163 calc_y(tmp_y_l, rule->tuples.dst_ip[IPV4_INDEX], in hclge_fd_convert_tuple()
5170 calc_x(tmp_x_s, rule->tuples.src_port, in hclge_fd_convert_tuple()
5172 calc_y(tmp_y_s, rule->tuples.src_port, in hclge_fd_convert_tuple()
5179 calc_x(tmp_x_s, rule->tuples.dst_port, in hclge_fd_convert_tuple()
5181 calc_y(tmp_y_s, rule->tuples.dst_port, in hclge_fd_convert_tuple()
5667 rule->tuples.src_ip[IPV4_INDEX] = in hclge_fd_get_tuple()
5672 rule->tuples.dst_ip[IPV4_INDEX] = in hclge_fd_get_tuple()
5677 rule->tuples.src_port = be16_to_cpu(fs->h_u.tcp_ip4_spec.psrc); in hclge_fd_get_tuple()
5681 rule->tuples.dst_port = be16_to_cpu(fs->h_u.tcp_ip4_spec.pdst); in hclge_fd_get_tuple()
5685 rule->tuples.ip_tos = fs->h_u.tcp_ip4_spec.tos; in hclge_fd_get_tuple()
5688 rule->tuples.ether_proto = ETH_P_IP; in hclge_fd_get_tuple()
5693 rule->tuples.src_ip[IPV4_INDEX] = in hclge_fd_get_tuple()
5698 rule->tuples.dst_ip[IPV4_INDEX] = in hclge_fd_get_tuple()
5703 rule->tuples.ip_tos = fs->h_u.usr_ip4_spec.tos; in hclge_fd_get_tuple()
5706 rule->tuples.ip_proto = fs->h_u.usr_ip4_spec.proto; in hclge_fd_get_tuple()
5709 rule->tuples.ether_proto = ETH_P_IP; in hclge_fd_get_tuple()
5716 be32_to_cpu_array(rule->tuples.src_ip, in hclge_fd_get_tuple()
5721 be32_to_cpu_array(rule->tuples.dst_ip, in hclge_fd_get_tuple()
5726 rule->tuples.src_port = be16_to_cpu(fs->h_u.tcp_ip6_spec.psrc); in hclge_fd_get_tuple()
5730 rule->tuples.dst_port = be16_to_cpu(fs->h_u.tcp_ip6_spec.pdst); in hclge_fd_get_tuple()
5734 rule->tuples.ether_proto = ETH_P_IPV6; in hclge_fd_get_tuple()
5739 be32_to_cpu_array(rule->tuples.src_ip, in hclge_fd_get_tuple()
5744 be32_to_cpu_array(rule->tuples.dst_ip, in hclge_fd_get_tuple()
5749 rule->tuples.ip_proto = fs->h_u.usr_ip6_spec.l4_proto; in hclge_fd_get_tuple()
5752 rule->tuples.ether_proto = ETH_P_IPV6; in hclge_fd_get_tuple()
5757 ether_addr_copy(rule->tuples.src_mac, in hclge_fd_get_tuple()
5762 ether_addr_copy(rule->tuples.dst_mac, in hclge_fd_get_tuple()
5767 rule->tuples.ether_proto = in hclge_fd_get_tuple()
5780 rule->tuples.ip_proto = IPPROTO_SCTP; in hclge_fd_get_tuple()
5785 rule->tuples.ip_proto = IPPROTO_TCP; in hclge_fd_get_tuple()
5790 rule->tuples.ip_proto = IPPROTO_UDP; in hclge_fd_get_tuple()
5798 rule->tuples.vlan_tag1 = be16_to_cpu(fs->h_ext.vlan_tci); in hclge_fd_get_tuple()
5803 ether_addr_copy(rule->tuples.dst_mac, fs->h_ext.h_dest); in hclge_fd_get_tuple()
6058 spec->ip4src = cpu_to_be32(rule->tuples.src_ip[IPV4_INDEX]); in hclge_fd_get_tcpip4_info()
6062 spec->ip4dst = cpu_to_be32(rule->tuples.dst_ip[IPV4_INDEX]); in hclge_fd_get_tcpip4_info()
6066 spec->psrc = cpu_to_be16(rule->tuples.src_port); in hclge_fd_get_tcpip4_info()
6070 spec->pdst = cpu_to_be16(rule->tuples.dst_port); in hclge_fd_get_tcpip4_info()
6074 spec->tos = rule->tuples.ip_tos; in hclge_fd_get_tcpip4_info()
6083 spec->ip4src = cpu_to_be32(rule->tuples.src_ip[IPV4_INDEX]); in hclge_fd_get_ip4_info()
6087 spec->ip4dst = cpu_to_be32(rule->tuples.dst_ip[IPV4_INDEX]); in hclge_fd_get_ip4_info()
6091 spec->tos = rule->tuples.ip_tos; in hclge_fd_get_ip4_info()
6095 spec->proto = rule->tuples.ip_proto; in hclge_fd_get_ip4_info()
6107 rule->tuples.src_ip, IPV6_SIZE); in hclge_fd_get_tcpip6_info()
6109 rule->tuples.dst_ip, IPV6_SIZE); in hclge_fd_get_tcpip6_info()
6122 spec->psrc = cpu_to_be16(rule->tuples.src_port); in hclge_fd_get_tcpip6_info()
6126 spec->pdst = cpu_to_be16(rule->tuples.dst_port); in hclge_fd_get_tcpip6_info()
6135 cpu_to_be32_array(spec->ip6src, rule->tuples.src_ip, IPV6_SIZE); in hclge_fd_get_ip6_info()
6136 cpu_to_be32_array(spec->ip6dst, rule->tuples.dst_ip, IPV6_SIZE); in hclge_fd_get_ip6_info()
6149 spec->l4_proto = rule->tuples.ip_proto; in hclge_fd_get_ip6_info()
6158 ether_addr_copy(spec->h_source, rule->tuples.src_mac); in hclge_fd_get_ether_info()
6159 ether_addr_copy(spec->h_dest, rule->tuples.dst_mac); in hclge_fd_get_ether_info()
6171 spec->h_proto = cpu_to_be16(rule->tuples.ether_proto); in hclge_fd_get_ether_info()
6180 fs->h_ext.vlan_tci = cpu_to_be16(rule->tuples.vlan_tag1); in hclge_fd_get_ext_info()
6188 ether_addr_copy(fs->h_ext.h_dest, rule->tuples.dst_mac); in hclge_fd_get_ext_info()
6308 struct hclge_fd_rule_tuples *tuples) in hclge_fd_get_flow_tuples() argument
6313 tuples->ether_proto = be16_to_cpu(fkeys->basic.n_proto); in hclge_fd_get_flow_tuples()
6314 tuples->ip_proto = fkeys->basic.ip_proto; in hclge_fd_get_flow_tuples()
6315 tuples->dst_port = be16_to_cpu(fkeys->ports.dst); in hclge_fd_get_flow_tuples()
6318 tuples->src_ip[3] = be32_to_cpu(fkeys->addrs.v4addrs.src); in hclge_fd_get_flow_tuples()
6319 tuples->dst_ip[3] = be32_to_cpu(fkeys->addrs.v4addrs.dst); in hclge_fd_get_flow_tuples()
6324 tuples->src_ip[i] = be32_to_cpu(flow_ip6_src[i]); in hclge_fd_get_flow_tuples()
6325 tuples->dst_ip[i] = be32_to_cpu(flow_ip6_dst[i]); in hclge_fd_get_flow_tuples()
6330 /* traverse all rules, check whether an existed rule has the same tuples */
6333 const struct hclge_fd_rule_tuples *tuples) in hclge_fd_search_flow_keys() argument
6339 if (!memcmp(tuples, &rule->tuples, sizeof(*tuples))) in hclge_fd_search_flow_keys()
6346 static void hclge_fd_build_arfs_rule(const struct hclge_fd_rule_tuples *tuples, in hclge_fd_build_arfs_rule() argument
6355 if (tuples->ether_proto == ETH_P_IP) { in hclge_fd_build_arfs_rule()
6356 if (tuples->ip_proto == IPPROTO_TCP) in hclge_fd_build_arfs_rule()
6361 if (tuples->ip_proto == IPPROTO_TCP) in hclge_fd_build_arfs_rule()
6366 memcpy(&rule->tuples, tuples, sizeof(rule->tuples)); in hclge_fd_build_arfs_rule()