summaryrefslogtreecommitdiffstats
path: root/src/dpdk/drivers/net/i40e/i40e_rxtx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dpdk/drivers/net/i40e/i40e_rxtx.c')
-rw-r--r--src/dpdk/drivers/net/i40e/i40e_rxtx.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/dpdk/drivers/net/i40e/i40e_rxtx.c b/src/dpdk/drivers/net/i40e/i40e_rxtx.c
index d3cfb98f..a6488898 100644
--- a/src/dpdk/drivers/net/i40e/i40e_rxtx.c
+++ b/src/dpdk/drivers/net/i40e/i40e_rxtx.c
@@ -1930,6 +1930,35 @@ i40e_xmit_pkts_simple(void *tx_queue,
return nb_tx;
}
+// TREX_PATCH
+// Based on i40e_pf_get_vsi_by_qindex. Return low latency VSI one queue.
+#define LOW_LATENCY_WORKAROUND
+#ifdef LOW_LATENCY_WORKAROUND
+static struct i40e_vsi*
+i40e_pf_tx_get_vsi_by_qindex(struct i40e_pf *pf, uint16_t queue_idx)
+{
+ // For last queue index, return low latency VSI
+ if (queue_idx == pf->dev_data->nb_tx_queues-1) {
+ return pf->ll_vsi;
+ }
+
+ /* the queue in MAIN VSI range */
+ if (queue_idx < pf->dev_data->nb_tx_queues)
+ return pf->main_vsi;
+
+
+ queue_idx -= pf->main_vsi->nb_qps;
+
+ /* queue_idx is greater than VMDQ VSIs range */
+ if (queue_idx > pf->nb_cfg_vmdq_vsi * pf->vmdq_nb_qps - 1) {
+ PMD_INIT_LOG(ERR, "queue_idx out of range. VMDQ configured?");
+ return NULL;
+ }
+
+ return pf->vmdq[queue_idx / pf->vmdq_nb_qps].vsi;
+}
+#endif
+
/*
* Find the VSI the queue belongs to. 'queue_idx' is the queue index
* application used, which assume having sequential ones. But from driver's
@@ -2165,8 +2194,14 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,
struct i40e_vf *vf =
I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
vsi = &vf->vsi;
- } else
+ } else {
+ // TREX_PATCH
+#ifdef LOW_LATENCY_WORKAROUND
+ vsi = i40e_pf_tx_get_vsi_by_qindex(pf, queue_idx);
+#else
vsi = i40e_pf_get_vsi_by_qindex(pf, queue_idx);
+#endif
+ }
if (vsi == NULL) {
PMD_DRV_LOG(ERR, "VSI not available or queue "