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.c59
1 files changed, 23 insertions, 36 deletions
diff --git a/src/dpdk/drivers/net/i40e/i40e_rxtx.c b/src/dpdk/drivers/net/i40e/i40e_rxtx.c
index 444e8c0b..8fdf30c6 100644
--- a/src/dpdk/drivers/net/i40e/i40e_rxtx.c
+++ b/src/dpdk/drivers/net/i40e/i40e_rxtx.c
@@ -1930,35 +1930,6 @@ 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
@@ -2195,12 +2166,7 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,
I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
vsi = &vf->vsi;
} 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) {
@@ -2306,6 +2272,11 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,
ad->rx_bulk_alloc_allowed = false;
}
+#define TREX_PATCH_LOW_LATENCY
+#ifdef TREX_PATCH_LOW_LATENCY
+ rxq->dcb_tc =0;
+#else
+
for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
if (!(vsi->enabled_tc & (1 << i)))
continue;
@@ -2318,6 +2289,7 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,
if (queue_idx >= base && queue_idx < (base + BIT(bsf)))
rxq->dcb_tc = i;
}
+#endif
return 0;
}
@@ -2417,8 +2389,16 @@ i40e_dev_tx_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 {
vsi = i40e_pf_get_vsi_by_qindex(pf, queue_idx);
+ }
+
+#ifdef TREX_PATCH_LOW_LATENCY
+ u8 low_latency = 0;
+ if (queue_idx == pf->dev_data->nb_tx_queues-1) {
+ low_latency = 1;
+ }
+#endif
if (vsi == NULL) {
PMD_DRV_LOG(ERR, "VSI is NULL, or queue index (%u) "
@@ -2574,6 +2554,13 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev,
/* Use a simple TX queue without offloads or multi segs if possible */
i40e_set_tx_function_flag(dev, txq);
+#ifdef TREX_PATCH_LOW_LATENCY
+ if (low_latency) {
+ txq->dcb_tc=1;
+ }else{
+ txq->dcb_tc=0;
+ }
+#else
for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
if (!(vsi->enabled_tc & (1 << i)))
continue;
@@ -2586,7 +2573,7 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev,
if (queue_idx >= base && queue_idx < (base + BIT(bsf)))
txq->dcb_tc = i;
}
-
+#endif
return 0;
}