Skip to contentSkip to conversation

net/iavf: fix tx thresh check issue

PATCH Applied Xiaoyun Li 3 participants 3 messages Jul 22, 2021 – Jul 25, 2021 Network drivers

lore
Share & tools
lore

Xiaoyun Li

author
#0 lore raw

PATCH 1/1 net/iavf: fix tx thresh check issue

Function check_tx_thresh is called with wrong parameter. If the check fails, tx_queue_setup should return error not keep going. iThis patch fixes above issues.

Fixes 69dd4c3d0898 ("net/avf: enable queue and device")
---
 drivers/net/iavf/iavf_rxtx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/iavf/iavf_rxtx.c +2 -1
index d61b32fcee..e33fe4576b 100644
@@ -708,7 +708,8 @@ iavf_dev_tx_queue_setup(struct rte_eth_dev *dev,
 		tx_conf->tx_rs_thresh : DEFAULT_TX_RS_THRESH);
 	tx_free_thresh = (uint16_t)((tx_conf->tx_free_thresh) ?
 		tx_conf->tx_free_thresh : DEFAULT_TX_FREE_THRESH);
-	check_tx_thresh(nb_desc, tx_rs_thresh, tx_rs_thresh);
+	if (check_tx_thresh(nb_desc, tx_rs_thresh, tx_free_thresh) != 0)
+		return -EINVAL;
 
 	/* Free memory if needed. */
 	if (dev->data->tx_queues[queue_idx]) {
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines

-----Original Message-----
From: Li, Xiaoyun <[email protected]>
Sent: Thursday, July 22, 2021 3:56 PM
To: [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Cc: Li, Xiaoyun <[email protected]>; [email protected]
Subject: [PATCH] net/iavf: fix tx thresh check issue

Quoted 3 lines

Function check_tx_thresh is called with wrong parameter. If the check fails, tx_queue_setup should return error not keep going.
iThis patch fixes above issues.

Typo: This

Except that,

Quoted 25 lines
Fixes 69dd4c3d0898 ("net/avf: enable queue and device")
---
 drivers/net/iavf/iavf_rxtx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/iavf/iavf_rxtx.c index renamed from drivers/net/iavf/iavf_rxtx.c +0 -0

d61b32fcee..e33fe4576b 100644

drivers/net/iavf/iavf_rxtx.c +2 -2
@@ -708,7 +708,8 @@ iavf_dev_tx_queue_setup(struct rte_eth_dev *dev,
 		tx_conf->tx_rs_thresh : DEFAULT_TX_RS_THRESH);
 	tx_free_thresh = (uint16_t)((tx_conf->tx_free_thresh) ?
 		tx_conf->tx_free_thresh : DEFAULT_TX_FREE_THRESH);
-	check_tx_thresh(nb_desc, tx_rs_thresh, tx_rs_thresh);
+	if (check_tx_thresh(nb_desc, tx_rs_thresh, tx_free_thresh) != 0)
+		return -EINVAL;
 
 	/* Free memory if needed. */
 	if (dev->data->tx_queues[queue_idx]) {
--

2.25.1

Applied
#2 lore raw
Quoted 20 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Xing, Beilei
Sent: Friday, July 23, 2021 10:43 AM
To: Li, Xiaoyun <[email protected]>; [email protected]; Wu, Jingjing <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH] net/iavf: fix tx thresh check issue

Quoted 8 lines

-----Original Message-----
From: Li, Xiaoyun <[email protected]>
Sent: Thursday, July 22, 2021 3:56 PM
To: [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Cc: Li, Xiaoyun <[email protected]>; [email protected]
Subject: [PATCH] net/iavf: fix tx thresh check issue

Quoted 8 lines
Quoted 3 lines

Function check_tx_thresh is called with wrong parameter. If the check fails, tx_queue_setup should return error not keep going. iThis patch fixes above issues.

Typo: This

Except that,

Applied to dpdk-next-net-intel with typo fix

Thanks
Qi