DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bnx2x: Fix transmit queue free threshold
@ 2017-02-10 20:12 Charles (Chas) Williams
  2017-02-23  0:26 ` Harish Patil
  0 siblings, 1 reply; 3+ messages in thread
From: Charles (Chas) Williams @ 2017-02-10 20:12 UTC (permalink / raw)
  To: dev; +Cc: harish.patil, Charles (Chas) Williams

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")

Signed-off-by: Chas Williams <ciwillia@brocade.com>
---
 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 170e48f..adf0309 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 dd251aa..2e38ec2 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.1.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/bnx2x: Fix transmit queue free threshold
  2017-02-10 20:12 [dpdk-dev] [PATCH] net/bnx2x: Fix transmit queue free threshold Charles (Chas) Williams
@ 2017-02-23  0:26 ` Harish Patil
  2017-02-23 10:09   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Harish Patil @ 2017-02-23  0:26 UTC (permalink / raw)
  To: Charles (Chas) Williams, dev; +Cc: Harish Patil

>
>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")
>
>Signed-off-by: Chas Williams <ciwillia@brocade.com>
>---
> 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 170e48f..adf0309 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 dd251aa..2e38ec2 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.1.4
>
>

Acked-by: Harish Patil <harish.patil@qlogic.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/bnx2x: Fix transmit queue free threshold
  2017-02-23  0:26 ` Harish Patil
@ 2017-02-23 10:09   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2017-02-23 10:09 UTC (permalink / raw)
  To: Harish Patil, Charles (Chas) Williams, dev, dpdk stable

On 2/23/2017 12:26 AM, Harish Patil wrote:
>>
>> 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")
>>
>> Signed-off-by: Chas Williams <ciwillia@brocade.com>

> Acked-by: Harish Patil <harish.patil@qlogic.com>

    net/bnx2x: fix transmit queue free threshold

    Cc: stable@dpdk.org

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-23 10:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-10 20:12 [dpdk-dev] [PATCH] net/bnx2x: Fix transmit queue free threshold Charles (Chas) Williams
2017-02-23  0:26 ` Harish Patil
2017-02-23 10:09   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).