@@ -4053,6 +4053,11 @@ iavf_set_tx_function(struct rte_eth_dev *dev)
dev->tx_pkt_prepare = iavf_prep_pkts;
PMD_DRV_LOG(DEBUG, "Using AVX512 OFFLOAD Vector Tx (port %d).",
dev->data->port_id);
+ } else if (check_ret == IAVF_VECTOR_CTX_PATH) {
+ dev->tx_pkt_burst = iavf_xmit_pkts_vec_avx512_ctx;
+ dev->tx_pkt_prepare = iavf_prep_pkts;
+ PMD_DRV_LOG(DEBUG, "Using AVX512 CONTEXT Vector Tx (port %d).",
+ dev->data->port_id);
} else {
dev->tx_pkt_burst = iavf_xmit_pkts_vec_avx512_ctx_offload;
dev->tx_pkt_prepare = iavf_prep_pkts;
@@ -66,6 +66,7 @@
#define IAVF_VECTOR_PATH 0
#define IAVF_VECTOR_OFFLOAD_PATH 1
#define IAVF_VECTOR_CTX_OFFLOAD_PATH 2
+#define IAVF_VECTOR_CTX_PATH 3
#define DEFAULT_TX_RS_THRESH 32
#define DEFAULT_TX_FREE_THRESH 32
@@ -752,6 +753,8 @@ uint16_t iavf_xmit_pkts_vec_avx512_offload(void *tx_queue,
uint16_t nb_pkts);
uint16_t iavf_xmit_pkts_vec_avx512_ctx_offload(void *tx_queue, struct rte_mbuf **tx_pkts,
uint16_t nb_pkts);
+uint16_t iavf_xmit_pkts_vec_avx512_ctx(void *tx_queue, struct rte_mbuf **tx_pkts,
+ uint16_t nb_pkts);
int iavf_txq_vec_setup_avx512(struct iavf_tx_queue *txq);
uint8_t iavf_proto_xtr_type_to_rxdid(uint8_t xtr_type);
@@ -2,6 +2,7 @@
* Copyright(c) 2020 Intel Corporation
*/
+#include "rte_pmd_iavf.h"
#include "iavf_rxtx_vec_common.h"
#include <rte_vect.h>
@@ -2206,6 +2207,10 @@ ctx_vtx1(volatile struct iavf_tx_desc *txdp, struct rte_mbuf *pkt,
low_ctx_qw |= (uint64_t)pkt->vlan_tci << IAVF_TXD_CTX_QW0_L2TAG2_PARAM;
}
}
+ if (*RTE_MBUF_DYNFIELD(pkt,
+ iavf_tx_lldp_dynfield_offset, uint8_t *) > 0)
+ high_ctx_qw |= IAVF_TX_CTX_DESC_SWTCH_UPLINK
+ << IAVF_TXD_CTX_QW1_CMD_SHIFT;
uint64_t high_data_qw = (IAVF_TX_DESC_DTYPE_DATA |
((uint64_t)flags << IAVF_TXD_QW1_CMD_SHIFT) |
((uint64_t)pkt->data_len << IAVF_TXD_QW1_TX_BUF_SZ_SHIFT));
@@ -2258,6 +2263,10 @@ ctx_vtx(volatile struct iavf_tx_desc *txdp,
(uint64_t)pkt[1]->vlan_tci << IAVF_TXD_QW1_L2TAG1_SHIFT;
}
}
+ if (*RTE_MBUF_DYNFIELD(pkt[1],
+ iavf_tx_lldp_dynfield_offset, uint8_t *) > 0)
+ hi_ctx_qw1 |= IAVF_TX_CTX_DESC_SWTCH_UPLINK
+ << IAVF_TXD_CTX_QW1_CMD_SHIFT;
if (pkt[0]->ol_flags & RTE_MBUF_F_TX_VLAN) {
if (vlan_flag & IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG2) {
@@ -2270,6 +2279,10 @@ ctx_vtx(volatile struct iavf_tx_desc *txdp,
(uint64_t)pkt[0]->vlan_tci << IAVF_TXD_QW1_L2TAG1_SHIFT;
}
}
+ if (*RTE_MBUF_DYNFIELD(pkt[0],
+ iavf_tx_lldp_dynfield_offset, uint8_t *) > 0)
+ hi_ctx_qw0 |= IAVF_TX_CTX_DESC_SWTCH_UPLINK
+ << IAVF_TXD_CTX_QW1_CMD_SHIFT;
if (offload) {
iavf_txd_enable_offload(pkt[1], &hi_data_qw1);
@@ -2520,3 +2533,10 @@ iavf_xmit_pkts_vec_avx512_ctx_offload(void *tx_queue, struct rte_mbuf **tx_pkts,
{
return iavf_xmit_pkts_vec_avx512_ctx_cmn(tx_queue, tx_pkts, nb_pkts, true);
}
+
+uint16_t
+iavf_xmit_pkts_vec_avx512_ctx(void *tx_queue, struct rte_mbuf **tx_pkts,
+ uint16_t nb_pkts)
+{
+ return iavf_xmit_pkts_vec_avx512_ctx_cmn(tx_queue, tx_pkts, nb_pkts, false);
+}
@@ -10,6 +10,7 @@
#include "iavf.h"
#include "iavf_rxtx.h"
+#include "rte_pmd_iavf.h"
#ifndef __INTEL_COMPILER
#pragma GCC diagnostic ignored "-Wcast-qual"
@@ -249,6 +250,11 @@ iavf_tx_vec_queue_default(struct iavf_tx_queue *txq)
if (txq->offloads & IAVF_TX_NO_VECTOR_FLAGS)
return -1;
+ if (rte_mbuf_dynfield_lookup(IAVF_TX_LLDP_DYNFIELD, NULL) > 0) {
+ txq->use_ctx = 1;
+ return IAVF_VECTOR_CTX_PATH;
+ }
+
/**
* Vlan tci needs to be inserted via ctx desc, if the vlan_flag is L2TAG2.
* Tunneling parameters and other fields need be configured in ctx desc