ethdev: move jumbo frame offload check to library
[dpdk.git] / drivers / net / iavf / iavf_rxtx_vec_avx512.c
index d99de2a..12375d3 100644 (file)
@@ -4,7 +4,7 @@
 
 #include "iavf_rxtx_vec_common.h"
 
-#include <x86intrin.h>
+#include <rte_vect.h>
 
 #ifndef __INTEL_COMPILER
 #pragma GCC diagnostic ignored "-Wcast-qual"
@@ -156,7 +156,7 @@ iavf_rxq_rearm(struct iavf_rx_queue *rxq)
                           (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);
 }
 
 #define IAVF_RX_LEN_MASK 0x80808080
@@ -710,8 +710,12 @@ _iavf_recv_raw_pkts_vec_avx512_flex_rxd(struct iavf_rx_queue *rxq,
                                        uint8_t *split_packet,
                                        bool offload)
 {
+       struct iavf_adapter *adapter = rxq->vsi->adapter;
+
+       uint64_t offloads = adapter->dev_data->dev_conf.rxmode.offloads;
+
 #ifdef IAVF_RX_PTYPE_OFFLOAD
-       const uint32_t *type_table = rxq->vsi->adapter->ptype_tbl;
+       const uint32_t *type_table = adapter->ptype_tbl;
 #endif
 
        const __m256i mbuf_init = _mm256_set_epi64x(0, 0, 0,
@@ -1137,8 +1141,7 @@ _iavf_recv_raw_pkts_vec_avx512_flex_rxd(struct iavf_rx_queue *rxq,
                         * needs to load 2nd 16B of each desc for RSS hash parsing,
                         * will cause performance drop to get into this context.
                         */
-                       if (rxq->vsi->adapter->eth_dev->data->dev_conf.rxmode.offloads &
-                           DEV_RX_OFFLOAD_RSS_HASH ||
+                       if (offloads & DEV_RX_OFFLOAD_RSS_HASH ||
                            rxq->rx_flags & IAVF_RX_FLAGS_VLAN_TAG_LOC_L2TAG2_2) {
                                /* load bottom half of every 32B desc */
                                const __m128i raw_desc_bh7 =
@@ -1190,8 +1193,7 @@ _iavf_recv_raw_pkts_vec_avx512_flex_rxd(struct iavf_rx_queue *rxq,
                                                (_mm256_castsi128_si256(raw_desc_bh0),
                                                 raw_desc_bh1, 1);
 
-                               if (rxq->vsi->adapter->eth_dev->data->dev_conf.rxmode.offloads &
-                                               DEV_RX_OFFLOAD_RSS_HASH) {
+                               if (offloads & DEV_RX_OFFLOAD_RSS_HASH) {
                                        /**
                                         * to shift the 32b RSS hash value to the
                                         * highest 32b of each 128b before mask
@@ -1958,7 +1960,7 @@ iavf_xmit_fixed_burst_vec_avx512(void *tx_queue, struct rte_mbuf **tx_pkts,
 
        txq->tx_tail = tx_id;
 
-       IAVF_PCI_REG_WRITE(txq->qtx_tail, txq->tx_tail);
+       IAVF_PCI_REG_WC_WRITE(txq->qtx_tail, txq->tx_tail);
 
        return nb_pkts;
 }