From: Xiaoyun Li <xiaoyun.li@intel.com>
To: dev@dpdk.org, Jingjing Wu <jingjing.wu@intel.com>,
Beilei Xing <beilei.xing@intel.com>
Cc: Xiaoyun Li <xiaoyun.li@intel.com>, stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/iavf: fix tx thresh check issue
Date: Thu, 22 Jul 2021 15:56:20 +0800 [thread overview]
Message-ID: <20210722075620.472438-1-xiaoyun.li@intel.com> (raw)
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
next reply other threads:[~2021-07-22 8:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-22 7:56 Xiaoyun Li [this message]
2021-07-23 2:43 ` Xing, Beilei
2021-07-25 9:47 ` Zhang, Qi Z
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210722075620.472438-1-xiaoyun.li@intel.com \
--to=xiaoyun.li@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).