net/i40e: fix Rx packet statistics
[dpdk.git] / drivers / net / ice / ice_rxtx.c
index fc9bb5a..7a2220d 100644 (file)
@@ -27,6 +27,18 @@ uint64_t rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask;
 uint64_t rte_net_ice_dynflag_proto_xtr_tcp_mask;
 uint64_t rte_net_ice_dynflag_proto_xtr_ip_offset_mask;
 
+static int
+ice_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_16(1 << ICE_RX_FLEX_DESC_STATUS0_DD_S);
+       /*
+        * we expect the DD bit to be set to 1 if this descriptor was already
+        * written to.
+        */
+       return (value & m) == m ? -1 : 0;
+}
+
 int
 ice_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc)
 {
@@ -39,12 +51,8 @@ ice_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc)
        /* watch for changes in status bit */
        pmc->addr = &rxdp->wb.status_error0;
 
-       /*
-        * we expect the DD bit to be set to 1 if this descriptor was already
-        * written to.
-        */
-       pmc->val = rte_cpu_to_le_16(1 << ICE_RX_FLEX_DESC_STATUS0_DD_S);
-       pmc->mask = rte_cpu_to_le_16(1 << ICE_RX_FLEX_DESC_STATUS0_DD_S);
+       /* comparison callback */
+       pmc->fn = ice_monitor_callback;
 
        /* register is 16-bit */
        pmc->size = sizeof(uint16_t);
@@ -258,18 +266,19 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq)
        struct rte_eth_dev_data *dev_data = rxq->vsi->adapter->pf.dev_data;
        struct ice_rlan_ctx rx_ctx;
        enum ice_status err;
-       uint16_t buf_size, len;
+       uint16_t buf_size;
        struct rte_eth_rxmode *rxmode = &dev_data->dev_conf.rxmode;
        uint32_t rxdid = ICE_RXDID_COMMS_OVS;
        uint32_t regval;
+       struct ice_adapter *ad = rxq->vsi->adapter;
 
        /* Set buffer size as the head split is disabled. */
        buf_size = (uint16_t)(rte_pktmbuf_data_room_size(rxq->mp) -
                              RTE_PKTMBUF_HEADROOM);
        rxq->rx_hdr_len = 0;
        rxq->rx_buf_len = RTE_ALIGN(buf_size, (1 << ICE_RLAN_CTX_DBUF_S));
-       len = ICE_SUPPORT_CHAIN_NUM * rxq->rx_buf_len;
-       rxq->max_pkt_len = RTE_MIN(len,
+       rxq->max_pkt_len = RTE_MIN((uint32_t)
+                                  ICE_SUPPORT_CHAIN_NUM * rxq->rx_buf_len,
                                   dev_data->dev_conf.rxmode.max_rx_pkt_len);
 
        if (rxmode->offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
@@ -294,6 +303,18 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq)
                }
        }
 
+       if (rxq->offloads & DEV_RX_OFFLOAD_TIMESTAMP) {
+               /* Register mbuf field and flag for Rx timestamp */
+               err = rte_mbuf_dyn_rx_timestamp_register(
+                               &ice_timestamp_dynfield_offset,
+                               &ice_timestamp_dynflag);
+               if (err) {
+                       PMD_DRV_LOG(ERR,
+                               "Cannot register mbuf field/flag for timestamp");
+                       return -EINVAL;
+               }
+       }
+
        memset(&rx_ctx, 0, sizeof(rx_ctx));
 
        rx_ctx.base = rxq->rx_ring_dma / ICE_QUEUE_BASE_ADDR_UNIT;
@@ -346,6 +367,9 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq)
        regval |= (0x03 << QRXFLXP_CNTXT_RXDID_PRIO_S) &
                QRXFLXP_CNTXT_RXDID_PRIO_M;
 
+       if (ad->ptp_ena || rxq->offloads & DEV_RX_OFFLOAD_TIMESTAMP)
+               regval |= QRXFLXP_CNTXT_TS_M;
+
        ICE_WRITE_REG(hw, QRXFLXP_CNTXT(rxq->reg_idx), regval);
 
        err = ice_clear_rxq_ctx(hw, rxq->reg_idx);
@@ -681,6 +705,7 @@ ice_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
        tx_ctx.tso_ena = 1; /* tso enable */
        tx_ctx.tso_qnum = txq->reg_idx; /* index for tso state structure */
        tx_ctx.legacy_int = 1; /* Legacy or Advanced Host Interface */
+       tx_ctx.tsyn_ena = 1;
 
        ice_set_ctx(hw, (uint8_t *)&tx_ctx, txq_elem->txqs[0].txq_ctx,
                    ice_tlan_ctx_info);
@@ -1127,6 +1152,7 @@ ice_rx_queue_setup(struct rte_eth_dev *dev,
                return -ENOMEM;
        }
 
+       rxq->mz = rz;
        /* Zero all the descriptors in the ring. */
        memset(rz->addr, 0, ring_size);
 
@@ -1182,6 +1208,7 @@ ice_rx_queue_release(void *rxq)
 
        q->rx_rel_mbufs(q);
        rte_free(q->sw_ring);
+       rte_memzone_free(q->mz);
        rte_free(q);
 }
 
@@ -1328,6 +1355,7 @@ ice_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;
@@ -1366,6 +1394,18 @@ ice_tx_queue_setup(struct rte_eth_dev *dev,
        return 0;
 }
 
+void
+ice_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
+{
+       ice_rx_queue_release(dev->data->rx_queues[qid]);
+}
+
+void
+ice_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
+{
+       ice_tx_queue_release(dev->data->tx_queues[qid]);
+}
+
 void
 ice_tx_queue_release(void *txq)
 {
@@ -1378,6 +1418,7 @@ ice_tx_queue_release(void *txq)
 
        q->tx_rel_mbufs(q);
        rte_free(q->sw_ring);
+       rte_memzone_free(q->mz);
        rte_free(q);
 }
 
@@ -1538,6 +1579,10 @@ ice_rx_scan_hw_ring(struct ice_rx_queue *rxq)
        int32_t i, j, nb_rx = 0;
        uint64_t pkt_flags = 0;
        uint32_t *ptype_tbl = rxq->vsi->adapter->ptype_tbl;
+       struct ice_vsi *vsi = rxq->vsi;
+       struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+       uint64_t ts_ns;
+       struct ice_adapter *ad = rxq->vsi->adapter;
 
        rxdp = &rxq->rx_ring[rxq->rx_tail];
        rxep = &rxq->sw_ring[rxq->rx_tail];
@@ -1581,6 +1626,25 @@ ice_rx_scan_hw_ring(struct ice_rx_queue *rxq)
                        ice_rxd_to_vlan_tci(mb, &rxdp[j]);
                        rxq->rxd_to_pkt_fields(rxq, mb, &rxdp[j]);
 
+                       if (rxq->offloads & DEV_RX_OFFLOAD_TIMESTAMP) {
+                               ts_ns = ice_tstamp_convert_32b_64b(hw,
+                                       rte_le_to_cpu_32(rxdp[j].wb.flex_ts.ts_high));
+                               if (ice_timestamp_dynflag > 0) {
+                                       *RTE_MBUF_DYNFIELD(mb,
+                                               ice_timestamp_dynfield_offset,
+                                               rte_mbuf_timestamp_t *) = ts_ns;
+                                       mb->ol_flags |= ice_timestamp_dynflag;
+                               }
+                       }
+
+                       if (ad->ptp_ena && ((mb->packet_type &
+                           RTE_PTYPE_L2_MASK) == RTE_PTYPE_L2_ETHER_TIMESYNC)) {
+                               rxq->time_high =
+                                  rte_le_to_cpu_32(rxdp[j].wb.flex_ts.ts_high);
+                               mb->timesync = rxq->queue_id;
+                               pkt_flags |= PKT_RX_IEEE1588_PTP;
+                       }
+
                        mb->ol_flags |= pkt_flags;
                }
 
@@ -1764,6 +1828,10 @@ ice_recv_scattered_pkts(void *rx_queue,
        uint64_t dma_addr;
        uint64_t pkt_flags;
        uint32_t *ptype_tbl = rxq->vsi->adapter->ptype_tbl;
+       struct ice_vsi *vsi = rxq->vsi;
+       struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+       uint64_t ts_ns;
+       struct ice_adapter *ad = rxq->vsi->adapter;
 
        while (nb_rx < nb_pkts) {
                rxdp = &rx_ring[rx_id];
@@ -1874,6 +1942,26 @@ ice_recv_scattered_pkts(void *rx_queue,
                ice_rxd_to_vlan_tci(first_seg, &rxd);
                rxq->rxd_to_pkt_fields(rxq, first_seg, &rxd);
                pkt_flags = ice_rxd_error_to_pkt_flags(rx_stat_err0);
+
+               if (rxq->offloads & DEV_RX_OFFLOAD_TIMESTAMP) {
+                       ts_ns = ice_tstamp_convert_32b_64b(hw,
+                               rte_le_to_cpu_32(rxd.wb.flex_ts.ts_high));
+                       if (ice_timestamp_dynflag > 0) {
+                               *RTE_MBUF_DYNFIELD(first_seg,
+                                       ice_timestamp_dynfield_offset,
+                                       rte_mbuf_timestamp_t *) = ts_ns;
+                               first_seg->ol_flags |= ice_timestamp_dynflag;
+                       }
+               }
+
+               if (ad->ptp_ena && ((first_seg->packet_type & RTE_PTYPE_L2_MASK)
+                   == RTE_PTYPE_L2_ETHER_TIMESYNC)) {
+                       rxq->time_high =
+                          rte_le_to_cpu_32(rxd.wb.flex_ts.ts_high);
+                       first_seg->timesync = rxq->queue_id;
+                       pkt_flags |= PKT_RX_IEEE1588_PTP;
+               }
+
                first_seg->ol_flags |= pkt_flags;
                /* Prefetch data of first segment, if configured to do so. */
                rte_prefetch0(RTE_PTR_ADD(first_seg->buf_addr,
@@ -1995,7 +2083,9 @@ ice_dev_supported_ptypes_get(struct rte_eth_dev *dev)
            dev->rx_pkt_burst == ice_recv_scattered_pkts_vec_avx512_offload ||
 #endif
            dev->rx_pkt_burst == ice_recv_pkts_vec_avx2 ||
-           dev->rx_pkt_burst == ice_recv_scattered_pkts_vec_avx2)
+           dev->rx_pkt_burst == ice_recv_pkts_vec_avx2_offload ||
+           dev->rx_pkt_burst == ice_recv_scattered_pkts_vec_avx2 ||
+           dev->rx_pkt_burst == ice_recv_scattered_pkts_vec_avx2_offload)
                return ptypes;
 #endif
 
@@ -2070,7 +2160,6 @@ ice_free_queues(struct rte_eth_dev *dev)
                        continue;
                ice_rx_queue_release(dev->data->rx_queues[i]);
                dev->data->rx_queues[i] = NULL;
-               rte_eth_dma_zone_free(dev, "rx_ring", i);
        }
        dev->data->nb_rx_queues = 0;
 
@@ -2079,7 +2168,6 @@ ice_free_queues(struct rte_eth_dev *dev)
                        continue;
                ice_tx_queue_release(dev->data->tx_queues[i]);
                dev->data->tx_queues[i] = NULL;
-               rte_eth_dma_zone_free(dev, "tx_ring", i);
        }
        dev->data->nb_tx_queues = 0;
 }
@@ -2126,6 +2214,7 @@ ice_fdir_setup_tx_resources(struct ice_pf *pf)
                return -ENOMEM;
        }
 
+       txq->mz = tz;
        txq->nb_tx_desc = ICE_FDIR_NUM_TX_DESC;
        txq->queue_id = ICE_FDIR_QUEUE_ID;
        txq->reg_idx = pf->fdir.fdir_vsi->base_queue;
@@ -2184,6 +2273,7 @@ ice_fdir_setup_rx_resources(struct ice_pf *pf)
                return -ENOMEM;
        }
 
+       rxq->mz = rz;
        rxq->nb_rx_desc = ICE_FDIR_NUM_RX_DESC;
        rxq->queue_id = ICE_FDIR_QUEUE_ID;
        rxq->reg_idx = pf->fdir.fdir_vsi->base_queue;
@@ -2227,6 +2317,10 @@ ice_recv_pkts(void *rx_queue,
        uint64_t dma_addr;
        uint64_t pkt_flags;
        uint32_t *ptype_tbl = rxq->vsi->adapter->ptype_tbl;
+       struct ice_vsi *vsi = rxq->vsi;
+       struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+       uint64_t ts_ns;
+       struct ice_adapter *ad = rxq->vsi->adapter;
 
        while (nb_rx < nb_pkts) {
                rxdp = &rx_ring[rx_id];
@@ -2278,6 +2372,26 @@ ice_recv_pkts(void *rx_queue,
                ice_rxd_to_vlan_tci(rxm, &rxd);
                rxq->rxd_to_pkt_fields(rxq, rxm, &rxd);
                pkt_flags = ice_rxd_error_to_pkt_flags(rx_stat_err0);
+
+               if (rxq->offloads & DEV_RX_OFFLOAD_TIMESTAMP) {
+                       ts_ns = ice_tstamp_convert_32b_64b(hw,
+                               rte_le_to_cpu_32(rxd.wb.flex_ts.ts_high));
+                       if (ice_timestamp_dynflag > 0) {
+                               *RTE_MBUF_DYNFIELD(rxm,
+                                       ice_timestamp_dynfield_offset,
+                                       rte_mbuf_timestamp_t *) = ts_ns;
+                               rxm->ol_flags |= ice_timestamp_dynflag;
+                       }
+               }
+
+               if (ad->ptp_ena && ((rxm->packet_type & RTE_PTYPE_L2_MASK) ==
+                   RTE_PTYPE_L2_ETHER_TIMESYNC)) {
+                       rxq->time_high =
+                          rte_le_to_cpu_32(rxd.wb.flex_ts.ts_high);
+                       rxm->timesync = rxq->queue_id;
+                       pkt_flags |= PKT_RX_IEEE1588_PTP;
+               }
+
                rxm->ol_flags |= pkt_flags;
                /* copy old mbuf to rx_pkts */
                rx_pkts[nb_rx++] = rxm;
@@ -2489,7 +2603,8 @@ ice_calc_context_desc(uint64_t flags)
        static uint64_t mask = PKT_TX_TCP_SEG |
                PKT_TX_QINQ |
                PKT_TX_OUTER_IP_CKSUM |
-               PKT_TX_TUNNEL_MASK;
+               PKT_TX_TUNNEL_MASK |
+               PKT_TX_IEEE1588_TMST;
 
        return (flags & mask) ? 1 : 0;
 }
@@ -2657,6 +2772,10 @@ ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
                        if (ol_flags & PKT_TX_TCP_SEG)
                                cd_type_cmd_tso_mss |=
                                        ice_set_tso_ctx(tx_pkt, tx_offload);
+                       else if (ol_flags & PKT_TX_IEEE1588_TMST)
+                               cd_type_cmd_tso_mss |=
+                                       ((uint64_t)ICE_TX_CTX_DESC_TSYN <<
+                                       ICE_TXD_CTX_QW1_CMD_S);
 
                        ctx_txd->tunneling_params =
                                rte_cpu_to_le_32(cd_tunneling_params);
@@ -3052,12 +3171,14 @@ ice_set_rx_function(struct rte_eth_dev *dev)
 #ifdef RTE_ARCH_X86
        struct ice_rx_queue *rxq;
        int i;
-       int rx_check_ret = 0;
+       int rx_check_ret = -1;
 
        if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
                ad->rx_use_avx512 = false;
                ad->rx_use_avx2 = false;
                rx_check_ret = ice_rx_vec_dev_check(dev);
+               if (ad->ptp_ena)
+                       rx_check_ret = -1;
                if (rx_check_ret >= 0 && ad->rx_bulk_alloc_allowed &&
                    rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
                        ad->rx_vec_allowed = true;
@@ -3107,14 +3228,25 @@ ice_set_rx_function(struct rte_eth_dev *dev)
                                                ice_recv_scattered_pkts_vec_avx512;
                                }
 #endif
+                       } else if (ad->rx_use_avx2) {
+                               if (rx_check_ret == ICE_VECTOR_OFFLOAD_PATH) {
+                                       PMD_DRV_LOG(NOTICE,
+                                                   "Using AVX2 OFFLOAD Vector Scattered Rx (port %d).",
+                                                   dev->data->port_id);
+                                       dev->rx_pkt_burst =
+                                               ice_recv_scattered_pkts_vec_avx2_offload;
+                               } else {
+                                       PMD_DRV_LOG(NOTICE,
+                                                   "Using AVX2 Vector Scattered Rx (port %d).",
+                                                   dev->data->port_id);
+                                       dev->rx_pkt_burst =
+                                               ice_recv_scattered_pkts_vec_avx2;
+                               }
                        } else {
                                PMD_DRV_LOG(DEBUG,
-                                       "Using %sVector Scattered Rx (port %d).",
-                                       ad->rx_use_avx2 ? "avx2 " : "",
+                                       "Using Vector Scattered Rx (port %d).",
                                        dev->data->port_id);
-                               dev->rx_pkt_burst = ad->rx_use_avx2 ?
-                                       ice_recv_scattered_pkts_vec_avx2 :
-                                       ice_recv_scattered_pkts_vec;
+                               dev->rx_pkt_burst = ice_recv_scattered_pkts_vec;
                        }
                } else {
                        if (ad->rx_use_avx512) {
@@ -3133,14 +3265,25 @@ ice_set_rx_function(struct rte_eth_dev *dev)
                                                ice_recv_pkts_vec_avx512;
                                }
 #endif
+                       } else if (ad->rx_use_avx2) {
+                               if (rx_check_ret == ICE_VECTOR_OFFLOAD_PATH) {
+                                       PMD_DRV_LOG(NOTICE,
+                                                   "Using AVX2 OFFLOAD Vector Rx (port %d).",
+                                                   dev->data->port_id);
+                                       dev->rx_pkt_burst =
+                                               ice_recv_pkts_vec_avx2_offload;
+                               } else {
+                                       PMD_DRV_LOG(NOTICE,
+                                                   "Using AVX2 Vector Rx (port %d).",
+                                                   dev->data->port_id);
+                                       dev->rx_pkt_burst =
+                                               ice_recv_pkts_vec_avx2;
+                               }
                        } else {
                                PMD_DRV_LOG(DEBUG,
-                                       "Using %sVector Rx (port %d).",
-                                       ad->rx_use_avx2 ? "avx2 " : "",
+                                       "Using Vector Rx (port %d).",
                                        dev->data->port_id);
-                               dev->rx_pkt_burst = ad->rx_use_avx2 ?
-                                       ice_recv_pkts_vec_avx2 :
-                                       ice_recv_pkts_vec;
+                               dev->rx_pkt_burst = ice_recv_pkts_vec;
                        }
                }
                return;
@@ -3185,7 +3328,9 @@ static const struct {
        { ice_recv_pkts_vec_avx512_offload,   "Offload Vector AVX512" },
 #endif
        { ice_recv_scattered_pkts_vec_avx2, "Vector AVX2 Scattered" },
+       { ice_recv_scattered_pkts_vec_avx2_offload, "Offload Vector AVX2 Scattered" },
        { ice_recv_pkts_vec_avx2,           "Vector AVX2" },
+       { ice_recv_pkts_vec_avx2_offload,   "Offload Vector AVX2" },
        { ice_recv_scattered_pkts_vec,      "Vector SSE Scattered" },
        { ice_recv_pkts_vec,                "Vector SSE" },
 #endif
@@ -3288,7 +3433,7 @@ ice_set_tx_function(struct rte_eth_dev *dev)
 #ifdef RTE_ARCH_X86
        struct ice_tx_queue *txq;
        int i;
-       int tx_check_ret = 0;
+       int tx_check_ret = -1;
 
        if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
                ad->tx_use_avx2 = false;
@@ -3307,13 +3452,14 @@ ice_set_tx_function(struct rte_eth_dev *dev)
                        PMD_DRV_LOG(NOTICE,
                                "AVX512 is not supported in build env");
 #endif
-                       if (!ad->tx_use_avx512 && tx_check_ret == ICE_VECTOR_PATH &&
-                       (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
-                       rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
-                       rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
+                       if (!ad->tx_use_avx512 &&
+                               (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
+                               rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
+                               rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
                                ad->tx_use_avx2 = true;
 
-                       if (!ad->tx_use_avx512 && tx_check_ret == ICE_VECTOR_OFFLOAD_PATH)
+                       if (!ad->tx_use_avx2 && !ad->tx_use_avx512 &&
+                               tx_check_ret == ICE_VECTOR_OFFLOAD_PATH)
                                ad->tx_vec_allowed = false;
 
                        if (ad->tx_vec_allowed) {
@@ -3331,6 +3477,7 @@ ice_set_tx_function(struct rte_eth_dev *dev)
        }
 
        if (ad->tx_vec_allowed) {
+               dev->tx_pkt_prepare = NULL;
                if (ad->tx_use_avx512) {
 #ifdef CC_AVX512_SUPPORT
                        if (tx_check_ret == ICE_VECTOR_OFFLOAD_PATH) {
@@ -3339,6 +3486,7 @@ ice_set_tx_function(struct rte_eth_dev *dev)
                                            dev->data->port_id);
                                dev->tx_pkt_burst =
                                        ice_xmit_pkts_vec_avx512_offload;
+                               dev->tx_pkt_prepare = ice_prep_pkts;
                        } else {
                                PMD_DRV_LOG(NOTICE,
                                            "Using AVX512 Vector Tx (port %d).",
@@ -3347,14 +3495,22 @@ ice_set_tx_function(struct rte_eth_dev *dev)
                        }
 #endif
                } else {
-                       PMD_DRV_LOG(DEBUG, "Using %sVector Tx (port %d).",
-                                   ad->tx_use_avx2 ? "avx2 " : "",
-                                   dev->data->port_id);
-                       dev->tx_pkt_burst = ad->tx_use_avx2 ?
-                                           ice_xmit_pkts_vec_avx2 :
-                                           ice_xmit_pkts_vec;
+                       if (tx_check_ret == ICE_VECTOR_OFFLOAD_PATH) {
+                               PMD_DRV_LOG(NOTICE,
+                                           "Using AVX2 OFFLOAD Vector Tx (port %d).",
+                                           dev->data->port_id);
+                               dev->tx_pkt_burst =
+                                       ice_xmit_pkts_vec_avx2_offload;
+                               dev->tx_pkt_prepare = ice_prep_pkts;
+                       } else {
+                               PMD_DRV_LOG(DEBUG, "Using %sVector Tx (port %d).",
+                                           ad->tx_use_avx2 ? "avx2 " : "",
+                                           dev->data->port_id);
+                               dev->tx_pkt_burst = ad->tx_use_avx2 ?
+                                                   ice_xmit_pkts_vec_avx2 :
+                                                   ice_xmit_pkts_vec;
+                       }
                }
-               dev->tx_pkt_prepare = NULL;
 
                return;
        }