X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fenic%2Fenic_rxtx_vec_avx2.c;h=1848f52717448b48c65049e2c1eea28c9485593c;hb=0604b1f2208f54ae76030e437db40f9da558497b;hp=d21854901c3a58f6936345893b721cc3c3c8db4e;hpb=8a6ff33d6d36ba5f0231ce4261546298a6d2af72;p=dpdk.git diff --git a/drivers/net/enic/enic_rxtx_vec_avx2.c b/drivers/net/enic/enic_rxtx_vec_avx2.c index d21854901c..1848f52717 100644 --- a/drivers/net/enic/enic_rxtx_vec_avx2.c +++ b/drivers/net/enic/enic_rxtx_vec_avx2.c @@ -4,7 +4,8 @@ */ #include -#include +#include +#include #include "enic_compat.h" #include "rq_enet_desc.h" @@ -806,25 +807,21 @@ enic_noscatter_vec_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, } bool -enic_use_vector_rx_handler(struct enic *enic) +enic_use_vector_rx_handler(struct rte_eth_dev *eth_dev) { - struct rte_eth_dev *eth_dev; - struct rte_fdir_conf *fconf; + struct enic *enic = pmd_priv(eth_dev); - eth_dev = enic->rte_dev; /* User needs to request for the avx2 handler */ if (!enic->enable_avx2_rx) return false; /* Do not support scatter Rx */ if (!(enic->rq_count > 0 && enic->rq[0].data_queue_enable == 0)) return false; - /* Do not support fdir/flow */ - fconf = ð_dev->data->dev_conf.fdir_conf; - if (fconf->mode != RTE_FDIR_MODE_NONE) - return false; - if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2)) { - PMD_INIT_LOG(DEBUG, " use the non-scatter avx2 Rx handler"); + if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) && + rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256) { + ENICPMD_LOG(DEBUG, " use the non-scatter avx2 Rx handler"); eth_dev->rx_pkt_burst = &enic_noscatter_vec_recv_pkts; + enic->use_noscatter_vec_rx_handler = 1; return true; } return false;