DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ixgbe: fix checking for tx_free_thresh
@ 2015-05-27 20:12 Zoltan Kiss
  2015-05-28 10:50 ` Venkatesan, Venky
  2015-06-01 16:15 ` Zoltan Kiss
  0 siblings, 2 replies; 12+ messages in thread
From: Zoltan Kiss @ 2015-05-27 20:12 UTC (permalink / raw)
  To: dev

This check doesn't do what's required by rte_eth_tx_burst:
"When the number of previously sent packets reached the "minimum transmit
packets to free" threshold"

This can cause problems when txq->tx_free_thresh + [number of elements in the
pool] < txq->nb_tx_desc.

Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
---
 drivers/net/ixgbe/ixgbe_rxtx.c     | 4 ++--
 drivers/net/ixgbe/ixgbe_rxtx_vec.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 4f9ab22..b70ed8c 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -250,10 +250,10 @@ tx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 	/*
 	 * Begin scanning the H/W ring for done descriptors when the
-	 * number of available descriptors drops below tx_free_thresh.  For
+	 * number of in flight descriptors reaches tx_free_thresh. For
 	 * each done descriptor, free the associated buffer.
 	 */
-	if (txq->nb_tx_free < txq->tx_free_thresh)
+	if ((txq->nb_tx_desc - txq->nb_tx_free) > txq->tx_free_thresh)
 		ixgbe_tx_free_bufs(txq);
 
 	/* Only use descriptors that are available */
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
index abd10f6..f91c698 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
@@ -598,7 +598,7 @@ ixgbe_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 	if (unlikely(nb_pkts > RTE_IXGBE_VPMD_TX_BURST))
 		nb_pkts = RTE_IXGBE_VPMD_TX_BURST;
 
-	if (txq->nb_tx_free < txq->tx_free_thresh)
+	if ((txq->nb_tx_desc - txq->nb_tx_free) > txq->tx_free_thresh)
 		ixgbe_tx_free_bufs(txq);
 
 	nb_commit = nb_pkts = (uint16_t)RTE_MIN(txq->nb_tx_free, nb_pkts);
-- 
1.9.1

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

end of thread, other threads:[~2015-06-09 17:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-27 20:12 [dpdk-dev] [PATCH] ixgbe: fix checking for tx_free_thresh Zoltan Kiss
2015-05-28 10:50 ` Venkatesan, Venky
2015-05-28 11:12   ` Zoltan Kiss
2015-06-01 16:15 ` Zoltan Kiss
2015-06-02 13:31   ` Ananyev, Konstantin
2015-06-02 15:08     ` Zoltan Kiss
2015-06-02 17:35       ` Ananyev, Konstantin
2015-06-03 17:46         ` Zoltan Kiss
2015-06-09 11:18           ` Ananyev, Konstantin
2015-06-09 15:08             ` Zoltan Kiss
2015-06-09 15:44               ` Ananyev, Konstantin
2015-06-09 17:46                 ` Zoltan Kiss

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