net/ixgbe: fix port initialization if MTU config fails
[dpdk.git] / drivers / net / ixgbe / ixgbe_rxtx.c
index edcfa60..a51450f 100644 (file)
@@ -33,7 +33,8 @@
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
 #include <rte_ether.h>
-#include <rte_ethdev_driver.h>
+#include <ethdev_driver.h>
+#include <rte_security_driver.h>
 #include <rte_prefetch.h>
 #include <rte_udp.h>
 #include <rte_tcp.h>
@@ -42,6 +43,7 @@
 #include <rte_errno.h>
 #include <rte_ip.h>
 #include <rte_net.h>
+#include <rte_vect.h>
 
 #include "ixgbe_logs.h"
 #include "base/ixgbe_api.h"
 #define rte_ixgbe_prefetch(p)   do {} while (0)
 #endif
 
-#ifdef RTE_IXGBE_INC_VECTOR
-uint16_t ixgbe_xmit_fixed_burst_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
-                                   uint16_t nb_pkts);
-#endif
-
 /*********************************************************************
  *
  *  TX functions
@@ -313,7 +310,7 @@ tx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
        /* update tail pointer */
        rte_wmb();
-       IXGBE_PCI_REG_WRITE_RELAXED(txq->tdt_reg_addr, txq->tx_tail);
+       IXGBE_PCI_REG_WC_WRITE_RELAXED(txq->tdt_reg_addr, txq->tx_tail);
 
        return nb_pkts;
 }
@@ -344,7 +341,6 @@ ixgbe_xmit_pkts_simple(void *tx_queue, struct rte_mbuf **tx_pkts,
        return nb_tx;
 }
 
-#ifdef RTE_IXGBE_INC_VECTOR
 static uint16_t
 ixgbe_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
                    uint16_t nb_pkts)
@@ -366,7 +362,6 @@ ixgbe_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 
        return nb_tx;
 }
-#endif
 
 static inline void
 ixgbe_set_xmit_ctx(struct ixgbe_tx_queue *txq,
@@ -459,7 +454,7 @@ ixgbe_set_xmit_ctx(struct ixgbe_tx_queue *txq,
                seqnum_seed |= tx_offload.l2_len
                               << IXGBE_ADVTXD_TUNNEL_LEN;
        }
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
        if (ol_flags & PKT_TX_SEC_OFFLOAD) {
                union ixgbe_crypto_tx_desc_md *md =
                                (union ixgbe_crypto_tx_desc_md *)mdata;
@@ -588,11 +583,11 @@ ixgbe_xmit_cleanup(struct ixgbe_tx_queue *txq)
        desc_to_clean_to = sw_ring[desc_to_clean_to].last_id;
        status = txr[desc_to_clean_to].wb.status;
        if (!(status & rte_cpu_to_le_32(IXGBE_TXD_STAT_DD))) {
-               PMD_TX_FREE_LOG(DEBUG,
-                               "TX descriptor %4u is not done"
-                               "(port=%d queue=%d)",
-                               desc_to_clean_to,
-                               txq->port_id, txq->queue_id);
+               PMD_TX_LOG(DEBUG,
+                          "TX descriptor %4u is not done"
+                          "(port=%d queue=%d)",
+                          desc_to_clean_to,
+                          txq->port_id, txq->queue_id);
                /* Failed to clean any descriptors, better luck next time */
                return -(1);
        }
@@ -605,11 +600,11 @@ ixgbe_xmit_cleanup(struct ixgbe_tx_queue *txq)
                nb_tx_to_clean = (uint16_t)(desc_to_clean_to -
                                                last_desc_cleaned);
 
-       PMD_TX_FREE_LOG(DEBUG,
-                       "Cleaning %4u TX descriptors: %4u to %4u "
-                       "(port=%d queue=%d)",
-                       nb_tx_to_clean, last_desc_cleaned, desc_to_clean_to,
-                       txq->port_id, txq->queue_id);
+       PMD_TX_LOG(DEBUG,
+                  "Cleaning %4u TX descriptors: %4u to %4u "
+                  "(port=%d queue=%d)",
+                  nb_tx_to_clean, last_desc_cleaned, desc_to_clean_to,
+                  txq->port_id, txq->queue_id);
 
        /*
         * The last descriptor to clean is done, so that means all the
@@ -652,7 +647,7 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
        uint32_t ctx = 0;
        uint32_t new_ctx;
        union ixgbe_tx_offload tx_offload;
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
        uint8_t use_ipsec;
 #endif
 
@@ -682,7 +677,7 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
                 * are needed for offload functionality.
                 */
                ol_flags = tx_pkt->ol_flags;
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
                use_ipsec = txq->using_ipsec && (ol_flags & PKT_TX_SEC_OFFLOAD);
 #endif
 
@@ -696,11 +691,11 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
                        tx_offload.tso_segsz = tx_pkt->tso_segsz;
                        tx_offload.outer_l2_len = tx_pkt->outer_l2_len;
                        tx_offload.outer_l3_len = tx_pkt->outer_l3_len;
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
                        if (use_ipsec) {
                                union ixgbe_crypto_tx_desc_md *ipsec_mdata =
                                        (union ixgbe_crypto_tx_desc_md *)
-                                                       &tx_pkt->udata64;
+                                               rte_security_dynfield(tx_pkt);
                                tx_offload.sa_idx = ipsec_mdata->sa_idx;
                                tx_offload.sec_pad_len = ipsec_mdata->pad_len;
                        }
@@ -755,12 +750,12 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
                 * nb_used better be less than or equal to txq->tx_rs_thresh
                 */
                if (nb_used > txq->nb_tx_free) {
-                       PMD_TX_FREE_LOG(DEBUG,
-                                       "Not enough free TX descriptors "
-                                       "nb_used=%4u nb_free=%4u "
-                                       "(port=%d queue=%d)",
-                                       nb_used, txq->nb_tx_free,
-                                       txq->port_id, txq->queue_id);
+                       PMD_TX_LOG(DEBUG,
+                                  "Not enough free TX descriptors "
+                                  "nb_used=%4u nb_free=%4u "
+                                  "(port=%d queue=%d)",
+                                  nb_used, txq->nb_tx_free,
+                                  txq->port_id, txq->queue_id);
 
                        if (ixgbe_xmit_cleanup(txq) != 0) {
                                /* Could not clean any descriptors */
@@ -771,17 +766,17 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
                        /* nb_used better be <= txq->tx_rs_thresh */
                        if (unlikely(nb_used > txq->tx_rs_thresh)) {
-                               PMD_TX_FREE_LOG(DEBUG,
-                                       "The number of descriptors needed to "
-                                       "transmit the packet exceeds the "
-                                       "RS bit threshold. This will impact "
-                                       "performance."
-                                       "nb_used=%4u nb_free=%4u "
-                                       "tx_rs_thresh=%4u. "
-                                       "(port=%d queue=%d)",
-                                       nb_used, txq->nb_tx_free,
-                                       txq->tx_rs_thresh,
-                                       txq->port_id, txq->queue_id);
+                               PMD_TX_LOG(DEBUG,
+                                          "The number of descriptors needed to "
+                                          "transmit the packet exceeds the "
+                                          "RS bit threshold. This will impact "
+                                          "performance."
+                                          "nb_used=%4u nb_free=%4u "
+                                          "tx_rs_thresh=%4u. "
+                                          "(port=%d queue=%d)",
+                                          nb_used, txq->nb_tx_free,
+                                          txq->tx_rs_thresh,
+                                          txq->port_id, txq->queue_id);
                                /*
                                 * Loop here until there are enough TX
                                 * descriptors or until the ring cannot be
@@ -865,7 +860,8 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
                                }
 
                                ixgbe_set_xmit_ctx(txq, ctx_txd, tx_ol_req,
-                                       tx_offload, &tx_pkt->udata64);
+                                       tx_offload,
+                                       rte_security_dynfield(tx_pkt));
 
                                txe->last_id = tx_last;
                                tx_id = txe->next_id;
@@ -883,7 +879,7 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
                }
 
                olinfo_status |= (pkt_len << IXGBE_ADVTXD_PAYLEN_SHIFT);
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
                if (use_ipsec)
                        olinfo_status |= IXGBE_ADVTXD_POPTS_IPSEC;
 #endif
@@ -924,10 +920,10 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
                /* Set RS bit only on threshold packets' last descriptor */
                if (txq->nb_tx_used >= txq->tx_rs_thresh) {
-                       PMD_TX_FREE_LOG(DEBUG,
-                                       "Setting RS bit on TXD id="
-                                       "%4u (port=%d queue=%d)",
-                                       tx_last, txq->port_id, txq->queue_id);
+                       PMD_TX_LOG(DEBUG,
+                                  "Setting RS bit on TXD id="
+                                  "%4u (port=%d queue=%d)",
+                                  tx_last, txq->port_id, txq->queue_id);
 
                        cmd_type_len |= IXGBE_TXD_CMD_RS;
 
@@ -953,7 +949,7 @@ end_of_tx:
        PMD_TX_LOG(DEBUG, "port_id=%u queue_id=%u tx_tail=%u nb_tx=%u",
                   (unsigned) txq->port_id, (unsigned) txq->queue_id,
                   (unsigned) tx_id, (unsigned) nb_tx);
-       IXGBE_PCI_REG_WRITE_RELAXED(txq->tdt_reg_addr, tx_id);
+       IXGBE_PCI_REG_WC_WRITE_RELAXED(txq->tdt_reg_addr, tx_id);
        txq->tx_tail = tx_id;
 
        return nb_tx;
@@ -993,7 +989,13 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
                        return i;
                }
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+               /* check the size of packet */
+               if (m->pkt_len < IXGBE_TX_MIN_PKT_LEN) {
+                       rte_errno = EINVAL;
+                       return i;
+               }
+
+#ifdef RTE_ETHDEV_DEBUG_TX
                ret = rte_validate_tx_offload(m);
                if (ret != 0) {
                        rte_errno = -ret;
@@ -1367,6 +1369,39 @@ const uint32_t
                RTE_PTYPE_INNER_L3_IPV4_EXT | RTE_PTYPE_INNER_L4_UDP,
 };
 
+static int
+ixgbe_monitor_callback(const uint64_t value,
+               const uint64_t arg[RTE_POWER_MONITOR_OPAQUE_SZ] __rte_unused)
+{
+       const uint64_t m = rte_cpu_to_le_32(IXGBE_RXDADV_STAT_DD);
+       /*
+        * we expect the DD bit to be set to 1 if this descriptor was already
+        * written to.
+        */
+       return (value & m) == m ? -1 : 0;
+}
+
+int
+ixgbe_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc)
+{
+       volatile union ixgbe_adv_rx_desc *rxdp;
+       struct ixgbe_rx_queue *rxq = rx_queue;
+       uint16_t desc;
+
+       desc = rxq->rx_tail;
+       rxdp = &rxq->rx_ring[desc];
+       /* watch for changes in status bit */
+       pmc->addr = &rxdp->wb.upper.status_error;
+
+       /* comparison callback */
+       pmc->fn = ixgbe_monitor_callback;
+
+       /* the registers are 32-bit */
+       pmc->size = sizeof(uint32_t);
+
+       return 0;
+}
+
 /* @note: fix ixgbe_dev_supported_ptypes_get() if any change here. */
 static inline uint32_t
 ixgbe_rxd_pkt_info_to_pkt_type(uint32_t pkt_info, uint16_t ptype_mask)
@@ -1439,7 +1474,8 @@ rx_desc_status_to_pkt_flags(uint32_t rx_status, uint64_t vlan_flags)
 }
 
 static inline uint64_t
-rx_desc_error_to_pkt_flags(uint32_t rx_status)
+rx_desc_error_to_pkt_flags(uint32_t rx_status, uint16_t pkt_info,
+                          uint8_t rx_udp_csum_zero_err)
 {
        uint64_t pkt_flags;
 
@@ -1456,12 +1492,21 @@ rx_desc_error_to_pkt_flags(uint32_t rx_status)
        pkt_flags = error_to_pkt_flags_map[(rx_status >>
                IXGBE_RXDADV_ERR_CKSUM_BIT) & IXGBE_RXDADV_ERR_CKSUM_MSK];
 
+       /* Mask out the bad UDP checksum error if the hardware has UDP zero
+        * checksum error issue, so that the software application will then
+        * have to recompute the checksum itself if needed.
+        */
+       if ((rx_status & IXGBE_RXDADV_ERR_TCPE) &&
+           (pkt_info & IXGBE_RXDADV_PKTTYPE_UDP) &&
+           rx_udp_csum_zero_err)
+               pkt_flags &= ~PKT_RX_L4_CKSUM_BAD;
+
        if ((rx_status & IXGBE_RXD_STAT_OUTERIPCS) &&
            (rx_status & IXGBE_RXDADV_ERR_OUTERIPER)) {
-               pkt_flags |= PKT_RX_EIP_CKSUM_BAD;
+               pkt_flags |= PKT_RX_OUTER_IP_CKSUM_BAD;
        }
 
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
        if (rx_status & IXGBE_RXD_STAT_SECP) {
                pkt_flags |= PKT_RX_SEC_OFFLOAD;
                if (rx_status & IXGBE_RXDADV_LNKSEC_ERROR_BAD_SIG)
@@ -1542,7 +1587,9 @@ ixgbe_rx_scan_hw_ring(struct ixgbe_rx_queue *rxq)
                        /* convert descriptor fields to rte mbuf flags */
                        pkt_flags = rx_desc_status_to_pkt_flags(s[j],
                                vlan_flags);
-                       pkt_flags |= rx_desc_error_to_pkt_flags(s[j]);
+                       pkt_flags |= rx_desc_error_to_pkt_flags(s[j],
+                                       (uint16_t)pkt_info[j],
+                                       rxq->rx_udp_csum_zero_err);
                        pkt_flags |= ixgbe_rxd_pkt_info_to_pkt_flags
                                        ((uint16_t)pkt_info[j]);
                        mb->ol_flags = pkt_flags;
@@ -1693,7 +1740,7 @@ rx_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 
                /* update tail pointer */
                rte_wmb();
-               IXGBE_PCI_REG_WRITE_RELAXED(rxq->rdt_reg_addr,
+               IXGBE_PCI_REG_WC_WRITE_RELAXED(rxq->rdt_reg_addr,
                                            cur_free_trigger);
        }
 
@@ -1875,7 +1922,9 @@ ixgbe_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
                rxm->vlan_tci = rte_le_to_cpu_16(rxd.wb.upper.vlan);
 
                pkt_flags = rx_desc_status_to_pkt_flags(staterr, vlan_flags);
-               pkt_flags = pkt_flags | rx_desc_error_to_pkt_flags(staterr);
+               pkt_flags = pkt_flags |
+                       rx_desc_error_to_pkt_flags(staterr, (uint16_t)pkt_info,
+                                                  rxq->rx_udp_csum_zero_err);
                pkt_flags = pkt_flags |
                        ixgbe_rxd_pkt_info_to_pkt_flags((uint16_t)pkt_info);
                rxm->ol_flags = pkt_flags;
@@ -1919,7 +1968,7 @@ ixgbe_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
                           (unsigned) nb_rx);
                rx_id = (uint16_t) ((rx_id == 0) ?
                                     (rxq->nb_rx_desc - 1) : (rx_id - 1));
-               IXGBE_PCI_REG_WRITE(rxq->rdt_reg_addr, rx_id);
+               IXGBE_PCI_REG_WC_WRITE(rxq->rdt_reg_addr, rx_id);
                nb_hold = 0;
        }
        rxq->nb_rx_hold = nb_hold;
@@ -1968,7 +2017,8 @@ ixgbe_fill_cluster_head_buf(
        head->vlan_tci = rte_le_to_cpu_16(desc->wb.upper.vlan);
        pkt_info = rte_le_to_cpu_32(desc->wb.lower.lo_dword.data);
        pkt_flags = rx_desc_status_to_pkt_flags(staterr, rxq->vlan_flags);
-       pkt_flags |= rx_desc_error_to_pkt_flags(staterr);
+       pkt_flags |= rx_desc_error_to_pkt_flags(staterr, (uint16_t)pkt_info,
+                                               rxq->rx_udp_csum_zero_err);
        pkt_flags |= ixgbe_rxd_pkt_info_to_pkt_flags((uint16_t)pkt_info);
        head->ol_flags = pkt_flags;
        head->packet_type =
@@ -2028,7 +2078,7 @@ ixgbe_recv_pkts_lro(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts,
                bool eop;
                struct ixgbe_rx_entry *rxe;
                struct ixgbe_scattered_rx_entry *sc_entry;
-               struct ixgbe_scattered_rx_entry *next_sc_entry;
+               struct ixgbe_scattered_rx_entry *next_sc_entry = NULL;
                struct ixgbe_rx_entry *next_rxe = NULL;
                struct rte_mbuf *first_seg;
                struct rte_mbuf *rxm;
@@ -2097,8 +2147,9 @@ next_desc:
 
                        if (!ixgbe_rx_alloc_bufs(rxq, false)) {
                                rte_wmb();
-                               IXGBE_PCI_REG_WRITE_RELAXED(rxq->rdt_reg_addr,
-                                                           next_rdt);
+                               IXGBE_PCI_REG_WC_WRITE_RELAXED(
+                                                       rxq->rdt_reg_addr,
+                                                       next_rdt);
                                nb_hold -= rxq->rx_free_thresh;
                        } else {
                                PMD_RX_LOG(DEBUG, "RX bulk alloc failed "
@@ -2263,7 +2314,7 @@ next_desc:
                           rxq->port_id, rxq->queue_id, rx_id, nb_hold, nb_rx);
 
                rte_wmb();
-               IXGBE_PCI_REG_WRITE_RELAXED(rxq->rdt_reg_addr, prev_id);
+               IXGBE_PCI_REG_WC_WRITE_RELAXED(rxq->rdt_reg_addr, prev_id);
                nb_hold = 0;
        }
 
@@ -2291,7 +2342,7 @@ ixgbe_recv_pkts_lro_bulk_alloc(void *rx_queue, struct rte_mbuf **rx_pkts,
  *
  **********************************************************************/
 
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_tx_queue_release_mbufs(struct ixgbe_tx_queue *txq)
 {
        unsigned i;
@@ -2306,7 +2357,118 @@ ixgbe_tx_queue_release_mbufs(struct ixgbe_tx_queue *txq)
        }
 }
 
-static void __attribute__((cold))
+static int
+ixgbe_tx_done_cleanup_full(struct ixgbe_tx_queue *txq, uint32_t free_cnt)
+{
+       struct ixgbe_tx_entry *swr_ring = txq->sw_ring;
+       uint16_t i, tx_last, tx_id;
+       uint16_t nb_tx_free_last;
+       uint16_t nb_tx_to_clean;
+       uint32_t pkt_cnt;
+
+       /* Start free mbuf from the next of tx_tail */
+       tx_last = txq->tx_tail;
+       tx_id  = swr_ring[tx_last].next_id;
+
+       if (txq->nb_tx_free == 0 && ixgbe_xmit_cleanup(txq))
+               return 0;
+
+       nb_tx_to_clean = txq->nb_tx_free;
+       nb_tx_free_last = txq->nb_tx_free;
+       if (!free_cnt)
+               free_cnt = txq->nb_tx_desc;
+
+       /* Loop through swr_ring to count the amount of
+        * freeable mubfs and packets.
+        */
+       for (pkt_cnt = 0; pkt_cnt < free_cnt; ) {
+               for (i = 0; i < nb_tx_to_clean &&
+                       pkt_cnt < free_cnt &&
+                       tx_id != tx_last; i++) {
+                       if (swr_ring[tx_id].mbuf != NULL) {
+                               rte_pktmbuf_free_seg(swr_ring[tx_id].mbuf);
+                               swr_ring[tx_id].mbuf = NULL;
+
+                               /*
+                                * last segment in the packet,
+                                * increment packet count
+                                */
+                               pkt_cnt += (swr_ring[tx_id].last_id == tx_id);
+                       }
+
+                       tx_id = swr_ring[tx_id].next_id;
+               }
+
+               if (txq->tx_rs_thresh > txq->nb_tx_desc -
+                       txq->nb_tx_free || tx_id == tx_last)
+                       break;
+
+               if (pkt_cnt < free_cnt) {
+                       if (ixgbe_xmit_cleanup(txq))
+                               break;
+
+                       nb_tx_to_clean = txq->nb_tx_free - nb_tx_free_last;
+                       nb_tx_free_last = txq->nb_tx_free;
+               }
+       }
+
+       return (int)pkt_cnt;
+}
+
+static int
+ixgbe_tx_done_cleanup_simple(struct ixgbe_tx_queue *txq,
+                       uint32_t free_cnt)
+{
+       int i, n, cnt;
+
+       if (free_cnt == 0 || free_cnt > txq->nb_tx_desc)
+               free_cnt = txq->nb_tx_desc;
+
+       cnt = free_cnt - free_cnt % txq->tx_rs_thresh;
+
+       for (i = 0; i < cnt; i += n) {
+               if (txq->nb_tx_desc - txq->nb_tx_free < txq->tx_rs_thresh)
+                       break;
+
+               n = ixgbe_tx_free_bufs(txq);
+
+               if (n == 0)
+                       break;
+       }
+
+       return i;
+}
+
+static int
+ixgbe_tx_done_cleanup_vec(struct ixgbe_tx_queue *txq __rte_unused,
+                       uint32_t free_cnt __rte_unused)
+{
+       return -ENOTSUP;
+}
+
+int
+ixgbe_dev_tx_done_cleanup(void *tx_queue, uint32_t free_cnt)
+{
+       struct ixgbe_tx_queue *txq = (struct ixgbe_tx_queue *)tx_queue;
+       if (txq->offloads == 0 &&
+#ifdef RTE_LIB_SECURITY
+                       !(txq->using_ipsec) &&
+#endif
+                       txq->tx_rs_thresh >= RTE_PMD_IXGBE_TX_MAX_BURST) {
+               if (txq->tx_rs_thresh <= RTE_IXGBE_TX_MAX_FREE_BUF_SZ &&
+                               rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128 &&
+                               (rte_eal_process_type() != RTE_PROC_PRIMARY ||
+                                       txq->sw_ring_v != NULL)) {
+                       return ixgbe_tx_done_cleanup_vec(txq, free_cnt);
+               } else {
+                       return ixgbe_tx_done_cleanup_simple(txq, free_cnt);
+               }
+       }
+
+       return ixgbe_tx_done_cleanup_full(txq, free_cnt);
+}
+
+static void __rte_cold
 ixgbe_tx_free_swring(struct ixgbe_tx_queue *txq)
 {
        if (txq != NULL &&
@@ -2314,24 +2476,25 @@ ixgbe_tx_free_swring(struct ixgbe_tx_queue *txq)
                rte_free(txq->sw_ring);
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_tx_queue_release(struct ixgbe_tx_queue *txq)
 {
        if (txq != NULL && txq->ops != NULL) {
                txq->ops->release_mbufs(txq);
                txq->ops->free_swring(txq);
+               rte_memzone_free(txq->mz);
                rte_free(txq);
        }
 }
 
-void __attribute__((cold))
-ixgbe_dev_tx_queue_release(void *txq)
+void __rte_cold
+ixgbe_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
 {
-       ixgbe_tx_queue_release(txq);
+       ixgbe_tx_queue_release(dev->data->tx_queues[qid]);
 }
 
 /* (Re)set dynamic ixgbe_tx_queue fields to defaults */
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_reset_tx_queue(struct ixgbe_tx_queue *txq)
 {
        static const union ixgbe_adv_tx_desc zeroed_desc = {{0}};
@@ -2381,25 +2544,24 @@ static const struct ixgbe_txq_ops def_txq_ops = {
  * the queue parameters. Used in tx_queue_setup by primary process and then
  * in dev_init by secondary process when attaching to an existing ethdev.
  */
-void __attribute__((cold))
+void __rte_cold
 ixgbe_set_tx_function(struct rte_eth_dev *dev, struct ixgbe_tx_queue *txq)
 {
        /* Use a simple Tx queue (no offloads, no multi segs) if possible */
        if ((txq->offloads == 0) &&
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
                        !(txq->using_ipsec) &&
 #endif
                        (txq->tx_rs_thresh >= RTE_PMD_IXGBE_TX_MAX_BURST)) {
                PMD_INIT_LOG(DEBUG, "Using simple tx code path");
                dev->tx_pkt_prepare = NULL;
-#ifdef RTE_IXGBE_INC_VECTOR
                if (txq->tx_rs_thresh <= RTE_IXGBE_TX_MAX_FREE_BUF_SZ &&
+                               rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128 &&
                                (rte_eal_process_type() != RTE_PROC_PRIMARY ||
                                        ixgbe_txq_vec_setup(txq) == 0)) {
                        PMD_INIT_LOG(DEBUG, "Vector tx enabled.");
                        dev->tx_pkt_burst = ixgbe_xmit_pkts_vec;
                } else
-#endif
                dev->tx_pkt_burst = ixgbe_xmit_pkts_simple;
        } else {
                PMD_INIT_LOG(DEBUG, "Using full-featured tx code path");
@@ -2447,14 +2609,14 @@ ixgbe_get_tx_port_offloads(struct rte_eth_dev *dev)
            hw->mac.type == ixgbe_mac_X550EM_a)
                tx_offload_capa |= DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM;
 
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
        if (dev->security_ctx)
                tx_offload_capa |= DEV_TX_OFFLOAD_SECURITY;
 #endif
        return tx_offload_capa;
 }
 
-int __attribute__((cold))
+int __rte_cold
 ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
                         uint16_t queue_idx,
                         uint16_t nb_desc,
@@ -2602,6 +2764,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
                return -ENOMEM;
        }
 
+       txq->mz = tz;
        txq->nb_tx_desc = nb_desc;
        txq->tx_rs_thresh = tx_rs_thresh;
        txq->tx_free_thresh = tx_free_thresh;
@@ -2615,7 +2778,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
        txq->offloads = offloads;
        txq->ops = &def_txq_ops;
        txq->tx_deferred_start = tx_conf->tx_deferred_start;
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
        txq->using_ipsec = !!(dev->data->dev_conf.txmode.offloads &
                        DEV_TX_OFFLOAD_SECURITY);
 #endif
@@ -2669,7 +2832,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
  *
  * @m scattered cluster head
  */
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_free_sc_cluster(struct rte_mbuf *m)
 {
        uint16_t i, nb_segs = m->nb_segs;
@@ -2682,18 +2845,16 @@ ixgbe_free_sc_cluster(struct rte_mbuf *m)
        }
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_rx_queue_release_mbufs(struct ixgbe_rx_queue *rxq)
 {
        unsigned i;
 
-#ifdef RTE_IXGBE_INC_VECTOR
        /* SSE Vector driver has a different way of releasing mbufs. */
        if (rxq->rx_using_sse) {
                ixgbe_rx_queue_release_mbufs_vec(rxq);
                return;
        }
-#endif
 
        if (rxq->sw_ring != NULL) {
                for (i = 0; i < rxq->nb_rx_desc; i++) {
@@ -2721,21 +2882,22 @@ ixgbe_rx_queue_release_mbufs(struct ixgbe_rx_queue *rxq)
                        }
 }
 
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_rx_queue_release(struct ixgbe_rx_queue *rxq)
 {
        if (rxq != NULL) {
                ixgbe_rx_queue_release_mbufs(rxq);
                rte_free(rxq->sw_ring);
                rte_free(rxq->sw_sc_ring);
+               rte_memzone_free(rxq->mz);
                rte_free(rxq);
        }
 }
 
-void __attribute__((cold))
-ixgbe_dev_rx_queue_release(void *rxq)
+void __rte_cold
+ixgbe_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
 {
-       ixgbe_rx_queue_release(rxq);
+       ixgbe_rx_queue_release(dev->data->rx_queues[qid]);
 }
 
 /*
@@ -2746,7 +2908,7 @@ ixgbe_dev_rx_queue_release(void *rxq)
  *  -EINVAL: the preconditions are NOT satisfied and the default Rx burst
  *           function must be used.
  */
-static inline int __attribute__((cold))
+static inline int __rte_cold
 check_rx_burst_bulk_alloc_preconditions(struct ixgbe_rx_queue *rxq)
 {
        int ret = 0;
@@ -2783,7 +2945,7 @@ check_rx_burst_bulk_alloc_preconditions(struct ixgbe_rx_queue *rxq)
 }
 
 /* Reset dynamic ixgbe_rx_queue fields back to defaults */
-static void __attribute__((cold))
+static void __rte_cold
 ixgbe_reset_rx_queue(struct ixgbe_adapter *adapter, struct ixgbe_rx_queue *rxq)
 {
        static const union ixgbe_adv_rx_desc zeroed_desc = {{0}};
@@ -2822,10 +2984,14 @@ ixgbe_reset_rx_queue(struct ixgbe_adapter *adapter, struct ixgbe_rx_queue *rxq)
        rxq->rx_free_trigger = (uint16_t)(rxq->rx_free_thresh - 1);
        rxq->rx_tail = 0;
        rxq->nb_rx_hold = 0;
+
+       if (rxq->pkt_first_seg != NULL)
+               rte_pktmbuf_free(rxq->pkt_first_seg);
+
        rxq->pkt_first_seg = NULL;
        rxq->pkt_last_seg = NULL;
 
-#ifdef RTE_IXGBE_INC_VECTOR
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
        rxq->rxrearm_start = 0;
        rxq->rxrearm_nb = 0;
 #endif
@@ -2870,9 +3036,9 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev)
                   DEV_RX_OFFLOAD_UDP_CKSUM   |
                   DEV_RX_OFFLOAD_TCP_CKSUM   |
                   DEV_RX_OFFLOAD_KEEP_CRC    |
-                  DEV_RX_OFFLOAD_JUMBO_FRAME |
                   DEV_RX_OFFLOAD_VLAN_FILTER |
-                  DEV_RX_OFFLOAD_SCATTER;
+                  DEV_RX_OFFLOAD_SCATTER |
+                  DEV_RX_OFFLOAD_RSS_HASH;
 
        if (hw->mac.type == ixgbe_mac_82598EB)
                offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
@@ -2899,7 +3065,7 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev)
            hw->mac.type == ixgbe_mac_X550EM_a)
                offloads |= DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
 
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
        if (dev->security_ctx)
                offloads |= DEV_RX_OFFLOAD_SECURITY;
 #endif
@@ -2907,7 +3073,7 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev)
        return offloads;
 }
 
-int __attribute__((cold))
+int __rte_cold
 ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
                         uint16_t queue_idx,
                         uint16_t nb_desc,
@@ -2979,6 +3145,13 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
        else
                rxq->pkt_type_mask = IXGBE_PACKET_TYPE_MASK_82599;
 
+       /*
+        * 82599 errata, UDP frames with a 0 checksum can be marked as checksum
+        * errors.
+        */
+       if (hw->mac.type == ixgbe_mac_82599EB)
+               rxq->rx_udp_csum_zero_err = 1;
+
        /*
         * Allocate RX ring hardware descriptors. A memzone large enough to
         * handle the maximum ring size is allocated in order to allow for
@@ -2991,6 +3164,7 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
                return -ENOMEM;
        }
 
+       rxq->mz = rz;
        /*
         * Zero init all the descriptors in the ring.
         */
@@ -3087,14 +3261,14 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
 }
 
 uint32_t
-ixgbe_dev_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)
+ixgbe_dev_rx_queue_count(void *rx_queue)
 {
 #define IXGBE_RXQ_SCAN_INTERVAL 4
        volatile union ixgbe_adv_rx_desc *rxdp;
        struct ixgbe_rx_queue *rxq;
        uint32_t desc = 0;
 
-       rxq = dev->data->rx_queues[rx_queue_id];
+       rxq = rx_queue;
        rxdp = &(rxq->rx_ring[rxq->rx_tail]);
 
        while ((desc < rxq->nb_rx_desc) &&
@@ -3110,24 +3284,6 @@ ixgbe_dev_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)
        return desc;
 }
 
-int
-ixgbe_dev_rx_descriptor_done(void *rx_queue, uint16_t offset)
-{
-       volatile union ixgbe_adv_rx_desc *rxdp;
-       struct ixgbe_rx_queue *rxq = rx_queue;
-       uint32_t desc;
-
-       if (unlikely(offset >= rxq->nb_rx_desc))
-               return 0;
-       desc = rxq->rx_tail + offset;
-       if (desc >= rxq->nb_rx_desc)
-               desc -= rxq->nb_rx_desc;
-
-       rxdp = &rxq->rx_ring[desc];
-       return !!(rxdp->wb.upper.status_error &
-                       rte_cpu_to_le_32(IXGBE_RXDADV_STAT_DD));
-}
-
 int
 ixgbe_dev_rx_descriptor_status(void *rx_queue, uint16_t offset)
 {
@@ -3138,7 +3294,7 @@ ixgbe_dev_rx_descriptor_status(void *rx_queue, uint16_t offset)
        if (unlikely(offset >= rxq->nb_rx_desc))
                return -EINVAL;
 
-#ifdef RTE_IXGBE_INC_VECTOR
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
        if (rxq->rx_using_sse)
                nb_hold = rxq->rxrearm_nb;
        else
@@ -3188,7 +3344,7 @@ ixgbe_dev_tx_descriptor_status(void *tx_queue, uint16_t offset)
 /*
  * Set up link loopback for X540/X550 mode Tx->Rx.
  */
-static inline void __attribute__((cold))
+static inline void __rte_cold
 ixgbe_setup_loopback_link_x540_x550(struct ixgbe_hw *hw, bool enable)
 {
        uint32_t macc;
@@ -3216,7 +3372,7 @@ ixgbe_setup_loopback_link_x540_x550(struct ixgbe_hw *hw, bool enable)
        IXGBE_WRITE_REG(hw, IXGBE_MACC, macc);
 }
 
-void __attribute__((cold))
+void __rte_cold
 ixgbe_dev_clear_queues(struct rte_eth_dev *dev)
 {
        unsigned i;
@@ -3260,13 +3416,13 @@ ixgbe_dev_free_queues(struct rte_eth_dev *dev)
        PMD_INIT_FUNC_TRACE();
 
        for (i = 0; i < dev->data->nb_rx_queues; i++) {
-               ixgbe_dev_rx_queue_release(dev->data->rx_queues[i]);
+               ixgbe_dev_rx_queue_release(dev, i);
                dev->data->rx_queues[i] = NULL;
        }
        dev->data->nb_rx_queues = 0;
 
        for (i = 0; i < dev->data->nb_tx_queues; i++) {
-               ixgbe_dev_tx_queue_release(dev->data->tx_queues[i]);
+               ixgbe_dev_tx_queue_release(dev, i);
                dev->data->tx_queues[i] = NULL;
        }
        dev->data->nb_tx_queues = 0;
@@ -4324,7 +4480,7 @@ ixgbe_vmdq_tx_hw_configure(struct ixgbe_hw *hw)
        IXGBE_WRITE_FLUSH(hw);
 }
 
-static int __attribute__((cold))
+static int __rte_cold
 ixgbe_alloc_rx_queue_mbufs(struct ixgbe_rx_queue *rxq)
 {
        struct ixgbe_rx_entry *rxe = rxq->sw_ring;
@@ -4624,7 +4780,7 @@ ixgbe_set_ivar(struct rte_eth_dev *dev, u8 entry, u8 vector, s8 type)
        }
 }
 
-void __attribute__((cold))
+void __rte_cold
 ixgbe_set_rx_function(struct rte_eth_dev *dev)
 {
        uint16_t i, rx_using_sse;
@@ -4635,10 +4791,10 @@ ixgbe_set_rx_function(struct rte_eth_dev *dev)
         * conditions to be met and Rx Bulk Allocation should be allowed.
         */
        if (ixgbe_rx_vec_dev_conf_condition_check(dev) ||
-           !adapter->rx_bulk_alloc_allowed) {
+           !adapter->rx_bulk_alloc_allowed ||
+                       rte_vect_get_max_simd_bitwidth() < RTE_VECT_SIMD_128) {
                PMD_INIT_LOG(DEBUG, "Port[%d] doesn't meet Vector Rx "
-                                   "preconditions or RTE_IXGBE_INC_VECTOR is "
-                                   "not enabled",
+                                   "preconditions",
                             dev->data->port_id);
 
                adapter->rx_vec_allowed = false;
@@ -4727,7 +4883,7 @@ ixgbe_set_rx_function(struct rte_eth_dev *dev)
                struct ixgbe_rx_queue *rxq = dev->data->rx_queues[i];
 
                rxq->rx_using_sse = rx_using_sse;
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
                rxq->using_ipsec = !!(dev->data->dev_conf.rxmode.offloads &
                                DEV_RX_OFFLOAD_SECURITY);
 #endif
@@ -4784,15 +4940,11 @@ ixgbe_set_rsc(struct rte_eth_dev *dev)
        /* RFCTL configuration  */
        rfctl = IXGBE_READ_REG(hw, IXGBE_RFCTL);
        if ((rsc_capable) && (rx_conf->offloads & DEV_RX_OFFLOAD_TCP_LRO))
-               /*
-                * Since NFS packets coalescing is not supported - clear
-                * RFCTL.NFSW_DIS and RFCTL.NFSR_DIS when RSC is
-                * enabled.
-                */
-               rfctl &= ~(IXGBE_RFCTL_RSC_DIS | IXGBE_RFCTL_NFSW_DIS |
-                          IXGBE_RFCTL_NFSR_DIS);
+               rfctl &= ~IXGBE_RFCTL_RSC_DIS;
        else
                rfctl |= IXGBE_RFCTL_RSC_DIS;
+       /* disable NFS filtering */
+       rfctl |= IXGBE_RFCTL_NFSW_DIS | IXGBE_RFCTL_NFSR_DIS;
        IXGBE_WRITE_REG(hw, IXGBE_RFCTL, rfctl);
 
        /* If LRO hasn't been requested - we are done here. */
@@ -4878,7 +5030,7 @@ ixgbe_set_rsc(struct rte_eth_dev *dev)
 /*
  * Initializes Receive Unit.
  */
-int __attribute__((cold))
+int __rte_cold
 ixgbe_dev_rx_init(struct rte_eth_dev *dev)
 {
        struct ixgbe_hw     *hw;
@@ -4894,6 +5046,7 @@ ixgbe_dev_rx_init(struct rte_eth_dev *dev)
        uint16_t buf_size;
        uint16_t i;
        struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode;
+       uint32_t frame_size = dev->data->mtu + IXGBE_ETH_OVERHEAD;
        int rc;
 
        PMD_INIT_FUNC_TRACE();
@@ -4925,11 +5078,11 @@ ixgbe_dev_rx_init(struct rte_eth_dev *dev)
        /*
         * Configure jumbo frame support, if any.
         */
-       if (rx_conf->offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
+       if ((dev->data->mtu & RTE_ETHER_MTU) != 0) {
                hlreg0 |= IXGBE_HLREG0_JUMBOEN;
                maxfrs = IXGBE_READ_REG(hw, IXGBE_MAXFRS);
                maxfrs &= 0x0000FFFF;
-               maxfrs |= (rx_conf->max_rx_pkt_len << 16);
+               maxfrs |= (frame_size << 16);
                IXGBE_WRITE_REG(hw, IXGBE_MAXFRS, maxfrs);
        } else
                hlreg0 &= ~IXGBE_HLREG0_JUMBOEN;
@@ -5003,8 +5156,7 @@ ixgbe_dev_rx_init(struct rte_eth_dev *dev)
                                       IXGBE_SRRCTL_BSIZEPKT_SHIFT);
 
                /* It adds dual VLAN length for supporting dual VLAN */
-               if (dev->data->dev_conf.rxmode.max_rx_pkt_len +
-                                           2 * IXGBE_VLAN_TAG_SIZE > buf_size)
+               if (frame_size + 2 * IXGBE_VLAN_TAG_SIZE > buf_size)
                        dev->data->scattered_rx = 1;
                if (rxq->offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
                        rx_conf->offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
@@ -5055,7 +5207,7 @@ ixgbe_dev_rx_init(struct rte_eth_dev *dev)
 /*
  * Initializes Transmit Unit.
  */
-void __attribute__((cold))
+void __rte_cold
 ixgbe_dev_tx_init(struct rte_eth_dev *dev)
 {
        struct ixgbe_hw     *hw;
@@ -5144,7 +5296,7 @@ ixgbe_check_supported_loopback_mode(struct rte_eth_dev *dev)
 /*
  * Set up link for 82599 loopback mode Tx->Rx.
  */
-static inline void __attribute__((cold))
+static inline void __rte_cold
 ixgbe_setup_loopback_link_82599(struct ixgbe_hw *hw)
 {
        PMD_INIT_FUNC_TRACE();
@@ -5172,7 +5324,7 @@ ixgbe_setup_loopback_link_82599(struct ixgbe_hw *hw)
 /*
  * Start Transmit and Receive Units.
  */
-int __attribute__((cold))
+int __rte_cold
 ixgbe_dev_rxtx_start(struct rte_eth_dev *dev)
 {
        struct ixgbe_hw     *hw;
@@ -5239,7 +5391,7 @@ ixgbe_dev_rxtx_start(struct rte_eth_dev *dev)
                        ixgbe_setup_loopback_link_x540_x550(hw, true);
        }
 
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
        if ((dev->data->dev_conf.rxmode.offloads &
                        DEV_RX_OFFLOAD_SECURITY) ||
                (dev->data->dev_conf.txmode.offloads &
@@ -5260,7 +5412,7 @@ ixgbe_dev_rxtx_start(struct rte_eth_dev *dev)
 /*
  * Start Receive Units for specified queue.
  */
-int __attribute__((cold))
+int __rte_cold
 ixgbe_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 {
        struct ixgbe_hw     *hw;
@@ -5302,7 +5454,7 @@ ixgbe_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 /*
  * Stop Receive Units for specified queue.
  */
-int __attribute__((cold))
+int __rte_cold
 ixgbe_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 {
        struct ixgbe_hw     *hw;
@@ -5342,7 +5494,7 @@ ixgbe_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 /*
  * Start Transmit Units for specified queue.
  */
-int __attribute__((cold))
+int __rte_cold
 ixgbe_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
 {
        struct ixgbe_hw     *hw;
@@ -5381,7 +5533,7 @@ ixgbe_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
 /*
  * Stop Transmit Units for specified queue.
  */
-int __attribute__((cold))
+int __rte_cold
 ixgbe_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)
 {
        struct ixgbe_hw     *hw;
@@ -5478,12 +5630,13 @@ ixgbe_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 /*
  * [VF] Initializes Receive Unit.
  */
-int __attribute__((cold))
+int __rte_cold
 ixgbevf_dev_rx_init(struct rte_eth_dev *dev)
 {
        struct ixgbe_hw     *hw;
        struct ixgbe_rx_queue *rxq;
        struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
+       uint32_t frame_size = dev->data->mtu + IXGBE_ETH_OVERHEAD;
        uint64_t bus_addr;
        uint32_t srrctl, psrtype = 0;
        uint16_t buf_size;
@@ -5520,8 +5673,9 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev)
         * ixgbevf_rlpml_set_vf even if jumbo frames are not used. This way,
         * VF packets received can work in all cases.
         */
-       ixgbevf_rlpml_set_vf(hw,
-               (uint16_t)dev->data->dev_conf.rxmode.max_rx_pkt_len);
+       if (ixgbevf_rlpml_set_vf(hw, frame_size) != 0)
+               PMD_INIT_LOG(ERR, "Set max packet length to %d failed.",
+                            frame_size);
 
        /*
         * Assume no header split and no VLAN strip support
@@ -5578,8 +5732,7 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev)
 
                if (rxmode->offloads & DEV_RX_OFFLOAD_SCATTER ||
                    /* It adds dual VLAN length for supporting dual VLAN */
-                   (rxmode->max_rx_pkt_len +
-                               2 * IXGBE_VLAN_TAG_SIZE) > buf_size) {
+                   (frame_size + 2 * IXGBE_VLAN_TAG_SIZE) > buf_size) {
                        if (!dev->data->scattered_rx)
                                PMD_INIT_LOG(DEBUG, "forcing scatter mode");
                        dev->data->scattered_rx = 1;
@@ -5602,7 +5755,7 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev)
 /*
  * [VF] Initializes Transmit Unit.
  */
-void __attribute__((cold))
+void __rte_cold
 ixgbevf_dev_tx_init(struct rte_eth_dev *dev)
 {
        struct ixgbe_hw     *hw;
@@ -5643,7 +5796,7 @@ ixgbevf_dev_tx_init(struct rte_eth_dev *dev)
 /*
  * [VF] Start Transmit and Receive Units.
  */
-void __attribute__((cold))
+void __rte_cold
 ixgbevf_dev_rxtx_start(struct rte_eth_dev *dev)
 {
        struct ixgbe_hw     *hw;
@@ -5808,14 +5961,15 @@ ixgbe_config_rss_filter(struct rte_eth_dev *dev,
        return 0;
 }
 
-/* Stubs needed for linkage when CONFIG_RTE_IXGBE_INC_VECTOR is set to 'n' */
-__rte_weak int
+/* Stubs needed for linkage when RTE_ARCH_PPC_64 is set */
+#if defined(RTE_ARCH_PPC_64)
+int
 ixgbe_rx_vec_dev_conf_condition_check(struct rte_eth_dev __rte_unused *dev)
 {
        return -1;
 }
 
-__rte_weak uint16_t
+uint16_t
 ixgbe_recv_pkts_vec(
        void __rte_unused *rx_queue,
        struct rte_mbuf __rte_unused **rx_pkts,
@@ -5824,7 +5978,7 @@ ixgbe_recv_pkts_vec(
        return 0;
 }
 
-__rte_weak uint16_t
+uint16_t
 ixgbe_recv_scattered_pkts_vec(
        void __rte_unused *rx_queue,
        struct rte_mbuf __rte_unused **rx_pkts,
@@ -5833,8 +5987,29 @@ ixgbe_recv_scattered_pkts_vec(
        return 0;
 }
 
-__rte_weak int
+int
 ixgbe_rxq_vec_setup(struct ixgbe_rx_queue __rte_unused *rxq)
 {
        return -1;
 }
+
+uint16_t
+ixgbe_xmit_fixed_burst_vec(void __rte_unused *tx_queue,
+               struct rte_mbuf __rte_unused **tx_pkts,
+               uint16_t __rte_unused nb_pkts)
+{
+       return 0;
+}
+
+int
+ixgbe_txq_vec_setup(struct ixgbe_tx_queue __rte_unused *txq)
+{
+       return -1;
+}
+
+void
+ixgbe_rx_queue_release_mbufs_vec(struct ixgbe_rx_queue __rte_unused *rxq)
+{
+       return;
+}
+#endif