net/i40e: fix Rx packet statistics
[dpdk.git] / drivers / net / iavf / iavf_rxtx_vec_common.h
index 62a333f..457d633 100644 (file)
@@ -15,7 +15,7 @@
 #pragma GCC diagnostic ignored "-Wcast-qual"
 #endif
 
-static inline uint16_t
+static __rte_always_inline uint16_t
 reassemble_packets(struct iavf_rx_queue *rxq, struct rte_mbuf **rx_bufs,
                   uint16_t nb_bufs, uint8_t *split_flags)
 {
@@ -231,7 +231,10 @@ iavf_rx_vec_queue_default(struct iavf_rx_queue *rxq)
        if (rxq->proto_xtr != IAVF_PROTO_XTR_NONE)
                return -1;
 
-       return 0;
+       if (rxq->offloads & IAVF_RX_VECTOR_OFFLOAD)
+               return IAVF_VECTOR_OFFLOAD_PATH;
+
+       return IAVF_VECTOR_PATH;
 }
 
 static inline int
@@ -258,14 +261,20 @@ iavf_rx_vec_dev_check_default(struct rte_eth_dev *dev)
 {
        int i;
        struct iavf_rx_queue *rxq;
+       int ret;
+       int result = 0;
 
        for (i = 0; i < dev->data->nb_rx_queues; i++) {
                rxq = dev->data->rx_queues[i];
-               if (iavf_rx_vec_queue_default(rxq))
+               ret = iavf_rx_vec_queue_default(rxq);
+
+               if (ret < 0)
                        return -1;
+               if (ret > result)
+                       result = ret;
        }
 
-       return 0;
+       return result;
 }
 
 static inline int
@@ -561,7 +570,7 @@ iavf_rxq_rearm_common(struct iavf_rx_queue *rxq, __rte_unused bool avx512)
                             (rxq->nb_rx_desc - 1) : (rxq->rxrearm_start - 1));
 
        /* Update the tail pointer on the NIC */
-       IAVF_PCI_REG_WRITE(rxq->qrx_tail, rx_id);
+       IAVF_PCI_REG_WC_WRITE(rxq->qrx_tail, rx_id);
 }
 #endif