diff options
author | 2017-01-08 17:14:32 +0200 | |
---|---|---|
committer | 2017-01-09 15:19:00 +0200 | |
commit | e532c2a19bd6afeaccb0b3eafebed3c5e758b339 (patch) | |
tree | 277f5347c9870f72e881e807744b3813a5968d4e /src/dpdk/drivers/net/i40e | |
parent | 335131c1d13f80caf1dd326758e154317283c780 (diff) |
Support for ixgbevf and i40evf
Signed-off-by: Ido Barnea <ibarnea@cisco.com>
Diffstat (limited to 'src/dpdk/drivers/net/i40e')
-rw-r--r-- | src/dpdk/drivers/net/i40e/i40e_rxtx.c | 49 |
1 files changed, 32 insertions, 17 deletions
diff --git a/src/dpdk/drivers/net/i40e/i40e_rxtx.c b/src/dpdk/drivers/net/i40e/i40e_rxtx.c index 8fdf30c6..19b431c3 100644 --- a/src/dpdk/drivers/net/i40e/i40e_rxtx.c +++ b/src/dpdk/drivers/net/i40e/i40e_rxtx.c @@ -2161,10 +2161,18 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t base, bsf, tc_mapping; int use_def_burst_func = 1; +#define TREX_PATCH_LOW_LATENCY +#ifdef TREX_PATCH_LOW_LATENCY + int is_vf = 0; +#endif + if (hw->mac.type == I40E_MAC_VF || hw->mac.type == I40E_MAC_X722_VF) { struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); vsi = &vf->vsi; +#ifdef TREX_PATCH_LOW_LATENCY + is_vf = 1; +#endif } else { vsi = i40e_pf_get_vsi_by_qindex(pf, queue_idx); } @@ -2272,10 +2280,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 + if (! is_vf) + rxq->dcb_tc =0; + else // The entire for below is in the else +#endif for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) { if (!(vsi->enabled_tc & (1 << i))) @@ -2289,7 +2298,6 @@ 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; } @@ -2385,20 +2393,25 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_rs_thresh, tx_free_thresh; uint16_t i, base, bsf, tc_mapping; +#ifdef TREX_PATCH_LOW_LATENCY + u8 low_latency = 0; + int is_vf = 1; +#endif + if (hw->mac.type == I40E_MAC_VF || hw->mac.type == I40E_MAC_X722_VF) { struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); vsi = &vf->vsi; } 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; - } + if (queue_idx == pf->dev_data->nb_tx_queues-1) { + low_latency = 1; + } + is_vf = 0; #endif + } + if (vsi == NULL) { PMD_DRV_LOG(ERR, "VSI is NULL, or queue index (%u) " @@ -2555,12 +2568,14 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev, 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 + if (! is_vf) { + if (low_latency) { + txq->dcb_tc=1; + }else{ + txq->dcb_tc=0; + } + } else // The entire for below is in the else +#endif for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) { if (!(vsi->enabled_tc & (1 << i))) continue; @@ -2573,7 +2588,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; } |