From f078565129809a4737de8eea1b3c4c24f5472c3b Mon Sep 17 00:00:00 2001 From: Chas Williams Date: Fri, 10 Feb 2017 15:12:06 -0500 Subject: [PATCH] net/bnx2x: fix transmit queue free threshold The default tx_free_thresh is potentially larger than the allocated queue which will result in TX queue cleanup never happening. To fix this, lower the default free threshold and ensure that the free threshold is never greater than the maximum outstanding transmit buffers. Fixes: 827ed2a118cc ("net/bnx2x: restructure Tx routine") Cc: stable@dpdk.org Signed-off-by: Chas Williams Acked-by: Harish Patil --- drivers/net/bnx2x/bnx2x_rxtx.c | 2 ++ drivers/net/bnx2x/bnx2x_rxtx.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c index 170e48fbd1..adf0309255 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.c +++ b/drivers/net/bnx2x/bnx2x_rxtx.c @@ -273,6 +273,8 @@ bnx2x_dev_tx_queue_setup(struct rte_eth_dev *dev, txq->tx_free_thresh = tx_conf->tx_free_thresh ? tx_conf->tx_free_thresh : DEFAULT_TX_FREE_THRESH; + txq->tx_free_thresh = min(txq->tx_free_thresh, + txq->nb_tx_desc - BDS_PER_TX_PKT); PMD_INIT_LOG(DEBUG, "fp[%02d] req_bd=%u, thresh=%u, usable_bd=%lu, " "total_bd=%lu, tx_pages=%u", diff --git a/drivers/net/bnx2x/bnx2x_rxtx.h b/drivers/net/bnx2x/bnx2x_rxtx.h index dd251aaf1a..2e38ec26a7 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.h +++ b/drivers/net/bnx2x/bnx2x_rxtx.h @@ -11,7 +11,7 @@ #ifndef _BNX2X_RXTX_H_ #define _BNX2X_RXTX_H_ -#define DEFAULT_TX_FREE_THRESH 512 +#define DEFAULT_TX_FREE_THRESH 64 #define RTE_PMD_BNX2X_TX_MAX_BURST 1 /** -- 2.20.1