diff options
Diffstat (limited to 'src/dpdk/drivers/net/enic/enic_clsf.c')
-rw-r--r-- | src/dpdk/drivers/net/enic/enic_clsf.c | 66 |
1 files changed, 9 insertions, 57 deletions
diff --git a/src/dpdk/drivers/net/enic/enic_clsf.c b/src/dpdk/drivers/net/enic/enic_clsf.c index 1610951d..bcf479ac 100644 --- a/src/dpdk/drivers/net/enic/enic_clsf.c +++ b/src/dpdk/drivers/net/enic/enic_clsf.c @@ -74,7 +74,7 @@ void enic_fdir_stats_get(struct enic *enic, struct rte_eth_fdir_stats *stats) void enic_fdir_info_get(struct enic *enic, struct rte_eth_fdir_info *info) { - info->mode = enic->fdir.modes; + info->mode = (enum rte_fdir_mode)enic->fdir.modes; info->flow_types_mask[0] = enic->fdir.types_mask; } @@ -107,7 +107,6 @@ enic_set_layer(struct filter_generic_1 *gp, unsigned int flag, memcpy(gp->layer[layer].val, val, len); } - /* Copy Flow Director filter to a VIC ipv4 filter (for Cisco VICs * without advanced filter support. */ @@ -133,28 +132,6 @@ copy_fltr_v1(struct filter_v2 *fltr, struct rte_eth_fdir_input *input, fltr->u.ipv4.flags = FILTER_FIELDS_IPV4_5TUPLE; } -#define TREX_PATCH -#ifdef TREX_PATCH -void -copy_fltr_recv_all(struct filter_v2 *fltr, struct rte_eth_fdir_input *input, - struct rte_eth_fdir_masks *masks) { - struct filter_generic_1 *gp = &fltr->u.generic_1; - memset(gp, 0, sizeof(*gp)); - - struct ether_hdr eth_mask, eth_val; - memset(ð_mask, 0, sizeof(eth_mask)); - memset(ð_val, 0, sizeof(eth_val)); - - eth_val.ether_type = 0xdead; - eth_mask.ether_type = 0; - - gp->position = 0; - enic_set_layer(gp, 0, FILTER_GENERIC_1_L2, - ð_mask, ð_val, sizeof(struct ether_hdr)); - -} -#endif - /* Copy Flow Director filter to a VIC generic filter (requires advanced * filter support. */ @@ -165,15 +142,8 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input, struct filter_generic_1 *gp = &fltr->u.generic_1; int i; - RTE_ASSERT(enic->adv_filters); - fltr->type = FILTER_DPDK_1; memset(gp, 0, sizeof(*gp)); -#ifdef TREX_PATCH - // important for this to be below 2. - // If added with position 2, IPv6 UDP and ICMP seems to be caught by some other rule - gp->position = 1; -#endif if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV4_UDP) { struct udp_hdr udp_mask, udp_val; @@ -185,7 +155,7 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input, udp_val.src_port = input->flow.udp4_flow.src_port; } if (input->flow.udp4_flow.dst_port) { - udp_mask.src_port = masks->dst_port_mask; + udp_mask.dst_port = masks->dst_port_mask; udp_val.dst_port = input->flow.udp4_flow.dst_port; } @@ -241,13 +211,9 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input, memset(&ip4_val, 0, sizeof(struct ipv4_hdr)); if (input->flow.ip4_flow.tos) { - ip4_mask.type_of_service = masks->ipv4_mask.tos; + ip4_mask.type_of_service = 0xff; ip4_val.type_of_service = input->flow.ip4_flow.tos; } - if (input->flow.ip4_flow.ip_id) { - ip4_mask.packet_id = 0xffff; - ip4_val.packet_id = input->flow.ip4_flow.ip_id; - } if (input->flow.ip4_flow.ttl) { ip4_mask.time_to_live = 0xff; ip4_val.time_to_live = input->flow.ip4_flow.ttl; @@ -333,7 +299,7 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input, memset(&ipv6_val, 0, sizeof(struct ipv6_hdr)); if (input->flow.ipv6_flow.proto) { - ipv6_mask.proto = masks->ipv6_mask.proto; + ipv6_mask.proto = 0xff; ipv6_val.proto = input->flow.ipv6_flow.proto; } for (i = 0; i < 4; i++) { @@ -349,8 +315,8 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input, input->flow.ipv6_flow.dst_ip[i]; } if (input->flow.ipv6_flow.tc) { - ipv6_mask.vtc_flow = ((uint32_t)masks->ipv6_mask.tc<<12); - ipv6_val.vtc_flow = input->flow.ipv6_flow.tc << 12; + ipv6_mask.vtc_flow = 0x00ff0000; + ipv6_val.vtc_flow = input->flow.ipv6_flow.tc << 16; } if (input->flow.ipv6_flow.hop_limits) { ipv6_mask.hop_limits = 0xff; @@ -372,11 +338,7 @@ int enic_fdir_del_fltr(struct enic *enic, struct rte_eth_fdir_filter *params) case -EINVAL: case -ENOENT: enic->fdir.stats.f_remove++; -#ifdef TREX_PATCH - return pos; -#else return -EINVAL; -#endif default: /* The entry is present in the table */ key = enic->fdir.nodes[pos]; @@ -420,7 +382,7 @@ int enic_fdir_add_fltr(struct enic *enic, struct rte_eth_fdir_filter *params) } /* Get the enicpmd RQ from the DPDK Rx queue */ - queue = enic_sop_rq(params->action.rx_queue); + queue = enic_rte_rq_idx_to_sop_idx(params->action.rx_queue); if (!enic->rq[queue].in_use) return -EINVAL; @@ -487,18 +449,8 @@ int enic_fdir_add_fltr(struct enic *enic, struct rte_eth_fdir_filter *params) key->filter = *params; key->rq_index = queue; -#ifdef TREX_PATCH - switch (params->soft_id) { - case 100: - copy_fltr_recv_all(&fltr, ¶ms->input, &enic->rte_dev->data->dev_conf.fdir_conf.mask); - break; - default: -#endif - enic->fdir.copy_fltr_fn(&fltr, ¶ms->input, - &enic->rte_dev->data->dev_conf.fdir_conf.mask); -#ifdef TREX_PATCH - } -#endif + enic->fdir.copy_fltr_fn(&fltr, ¶ms->input, + &enic->rte_dev->data->dev_conf.fdir_conf.mask); if (!vnic_dev_classifier(enic->vdev, CLSF_ADD, &queue, &fltr)) { key->fltr_id = queue; |