net/ena: check memory BAR before initializing LLQ
[dpdk.git] / drivers / net / ixgbe / ixgbe_rxtx_vec_sse.c
index c56f76b..bb34b27 100644 (file)
@@ -364,6 +364,17 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts,
        uint8_t vlan_flags;
        uint16_t udp_p_flag = 0; /* Rx Descriptor UDP header present */
 
+       /*
+        * Under the circumstance that `rx_tail` wrap back to zero
+        * and the advance speed of `rx_tail` is greater than `rxrearm_start`,
+        * `rx_tail` will catch up with `rxrearm_start` and surpass it.
+        * This may cause some mbufs be reused by application.
+        *
+        * So we need to make some restrictions to ensure that
+        * `rx_tail` will not exceed `rxrearm_start`.
+        */
+       nb_pkts = RTE_MIN(nb_pkts, RTE_IXGBE_RXQ_REARM_THRESH);
+
        /* nb_pkts has to be floor-aligned to RTE_IXGBE_DESCS_PER_LOOP */
        nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, RTE_IXGBE_DESCS_PER_LOOP);