DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/iavf: fix tx thresh check issue
@ 2021-07-22  7:56 Xiaoyun Li
  2021-07-23  2:43 ` Xing, Beilei
  0 siblings, 1 reply; 3+ messages in thread
From: Xiaoyun Li @ 2021-07-22  7:56 UTC (permalink / raw)
  To: dev, Jingjing Wu, Beilei Xing; +Cc: Xiaoyun Li, stable

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")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index d61b32fcee..e33fe4576b 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -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


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

* Re: [dpdk-dev] [PATCH] net/iavf: fix tx thresh check issue
  2021-07-22  7:56 [dpdk-dev] [PATCH] net/iavf: fix tx thresh check issue Xiaoyun Li
@ 2021-07-23  2:43 ` Xing, Beilei
  2021-07-25  9:47   ` Zhang, Qi Z
  0 siblings, 1 reply; 3+ messages in thread
From: Xing, Beilei @ 2021-07-23  2:43 UTC (permalink / raw)
  To: Li, Xiaoyun, dev, Wu,  Jingjing; +Cc: stable



> -----Original Message-----
> From: Li, Xiaoyun <xiaoyun.li@intel.com>
> Sent: Thursday, July 22, 2021 3:56 PM
> To: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>
> Cc: Li, Xiaoyun <xiaoyun.li@intel.com>; stable@dpdk.org
> Subject: [PATCH] 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.

Typo: This

Except that,
Acked-by: Beilei Xing <beilei.xing@intel.com>

> 
> Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
> ---
>  drivers/net/iavf/iavf_rxtx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index
> d61b32fcee..e33fe4576b 100644
> --- a/drivers/net/iavf/iavf_rxtx.c
> +++ b/drivers/net/iavf/iavf_rxtx.c
> @@ -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


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

* Re: [dpdk-dev] [PATCH] net/iavf: fix tx thresh check issue
  2021-07-23  2:43 ` Xing, Beilei
@ 2021-07-25  9:47   ` Zhang, Qi Z
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Qi Z @ 2021-07-25  9:47 UTC (permalink / raw)
  To: Xing, Beilei, Li, Xiaoyun, dev, Wu, Jingjing; +Cc: stable



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Xing, Beilei
> Sent: Friday, July 23, 2021 10:43 AM
> To: Li, Xiaoyun <xiaoyun.li@intel.com>; dev@dpdk.org; Wu, Jingjing
> <jingjing.wu@intel.com>
> Cc: stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/iavf: fix tx thresh check issue
> 
> 
> 
> > -----Original Message-----
> > From: Li, Xiaoyun <xiaoyun.li@intel.com>
> > Sent: Thursday, July 22, 2021 3:56 PM
> > To: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei
> > <beilei.xing@intel.com>
> > Cc: Li, Xiaoyun <xiaoyun.li@intel.com>; stable@dpdk.org
> > Subject: [PATCH] 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.
> 
> Typo: This
> 
> Except that,
> Acked-by: Beilei Xing <beilei.xing@intel.com>

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

Thanks
Qi


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

end of thread, other threads:[~2021-07-25  9:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22  7:56 [dpdk-dev] [PATCH] net/iavf: fix tx thresh check issue Xiaoyun Li
2021-07-23  2:43 ` Xing, Beilei
2021-07-25  9:47   ` Zhang, Qi Z

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