DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/hns3: fix checking enough Tx BDs
@ 2019-11-25  9:00 Wei Hu (Xavier)
  2019-11-25 15:55 ` Ferruh Yigit
  2019-11-25 16:12 ` Ferruh Yigit
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Hu (Xavier) @ 2019-11-25  9:00 UTC (permalink / raw)
  To: dev, stable; +Cc: huwei87

From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>

In .tx_pkt_burst ops implementation function of hns3 PMD driver,
there is one check whether there are enough BDs in the TX queue.
If not, driver will stop sending the packets.

Currently in the 'for' process loop, the next_to_use member of
TX queue is not updated in time after processing BDs of one packet,
which results in the invalid action of checking whether there are
enough BDs and failure in sending packets.

This patch fixes it by moving the assignment statment of the
next_to_use member of TX queue to the place after porcessing TX BDs
in the 'for' loop.

Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
Cc: stable@dpdk.org

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 34cb7faf9..816644713 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -1649,6 +1649,7 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		} while (m_seg != NULL);
 
 		nb_hold += i;
+		txq->next_to_use = tx_next_use;
 	}
 
 end_of_tx:
@@ -1656,7 +1657,6 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 	if (likely(nb_tx)) {
 		hns3_queue_xmit(txq, nb_hold);
 		txq->next_to_clean = tx_next_clean;
-		txq->next_to_use   = tx_next_use;
 		txq->tx_bd_ready   = tx_bd_ready - nb_hold;
 	}
 
-- 
2.23.0


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

* Re: [dpdk-dev] [PATCH] net/hns3: fix checking enough Tx BDs
  2019-11-25  9:00 [dpdk-dev] [PATCH] net/hns3: fix checking enough Tx BDs Wei Hu (Xavier)
@ 2019-11-25 15:55 ` Ferruh Yigit
  2019-11-25 16:12 ` Ferruh Yigit
  1 sibling, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2019-11-25 15:55 UTC (permalink / raw)
  To: Wei Hu (Xavier), dev, stable; +Cc: huwei87

On 11/25/2019 9:00 AM, Wei Hu (Xavier) wrote:
> From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
> 
> In .tx_pkt_burst ops implementation function of hns3 PMD driver,
> there is one check whether there are enough BDs in the TX queue.

Out of curiosity, is BD refers to "buffer descriptor"? What is the difference
between Tx descriptor and TX BD?

> If not, driver will stop sending the packets.
> 
> Currently in the 'for' process loop, the next_to_use member of
> TX queue is not updated in time after processing BDs of one packet,
> which results in the invalid action of checking whether there are
> enough BDs and failure in sending packets.
> 
> This patch fixes it by moving the assignment statment of the
> next_to_use member of TX queue to the place after porcessing TX BDs
> in the 'for' loop.
> 
> Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
> ---
>  drivers/net/hns3/hns3_rxtx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
> index 34cb7faf9..816644713 100644
> --- a/drivers/net/hns3/hns3_rxtx.c
> +++ b/drivers/net/hns3/hns3_rxtx.c
> @@ -1649,6 +1649,7 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
>  		} while (m_seg != NULL);
>  
>  		nb_hold += i;
> +		txq->next_to_use = tx_next_use;
>  	}
>  
>  end_of_tx:
> @@ -1656,7 +1657,6 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
>  	if (likely(nb_tx)) {
>  		hns3_queue_xmit(txq, nb_hold);
>  		txq->next_to_clean = tx_next_clean;
> -		txq->next_to_use   = tx_next_use;
>  		txq->tx_bd_ready   = tx_bd_ready - nb_hold;
>  	}
>  
> 


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

* Re: [dpdk-dev] [PATCH] net/hns3: fix checking enough Tx BDs
  2019-11-25  9:00 [dpdk-dev] [PATCH] net/hns3: fix checking enough Tx BDs Wei Hu (Xavier)
  2019-11-25 15:55 ` Ferruh Yigit
@ 2019-11-25 16:12 ` Ferruh Yigit
  1 sibling, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2019-11-25 16:12 UTC (permalink / raw)
  To: Wei Hu (Xavier), dev, stable; +Cc: huwei87

On 11/25/2019 9:00 AM, Wei Hu (Xavier) wrote:
> From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
> 
> In .tx_pkt_burst ops implementation function of hns3 PMD driver,
> there is one check whether there are enough BDs in the TX queue.
> If not, driver will stop sending the packets.
> 
> Currently in the 'for' process loop, the next_to_use member of
> TX queue is not updated in time after processing BDs of one packet,
> which results in the invalid action of checking whether there are
> enough BDs and failure in sending packets.
> 
> This patch fixes it by moving the assignment statment of the
> next_to_use member of TX queue to the place after porcessing TX BDs
> in the 'for' loop.
> 
> Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>

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

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

end of thread, other threads:[~2019-11-25 16:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-25  9:00 [dpdk-dev] [PATCH] net/hns3: fix checking enough Tx BDs Wei Hu (Xavier)
2019-11-25 15:55 ` Ferruh Yigit
2019-11-25 16:12 ` 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).