From: Benjamin Le Berre <benjamin.le_berre@6wind.com>
To: ajit.khaparde@broadcom.com, somnath.kotur@broadcom.com
Cc: dev@dpdk.org, Benjamin Le Berre <benjamin.le_berre@6wind.com>
Subject: [PATCH] net/bnxt: return -EBUSY if port is active during MTU change
Date: Thu, 15 Sep 2022 13:29:06 +0200 [thread overview]
Message-ID: <20220915112906.4487-1-benjamin.le_berre@6wind.com> (raw)
When the BNXT PMD was made to disallow MTU changes on active ports, the
error code chosen for the case in bnxt_set_mtu_op() was -EPERM.
The doc comment for rte_eth_dev_set_mtu() in lib/ethdev/rte_ethdev.h
lists -EBUSY as the value to be used if the port must be stopped before
applying an MTU change and does not list -EPERM as a possible return
value.
This patch makes bnxt_set_mtu_op() return -EBUSY instead of -EPERM so
that rte_eth_dev_set_mtu() behaves as expected.
Fixes: a42ab1eb33ff ("net/bnxt: disallow MTU change when device is started")
Signed-off-by: Benjamin Le Berre <benjamin.le_berre@6wind.com>
---
Hi,
Should I Cc stable@dpdk.org?
Thanks,
Benjamin.
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index e275d3a53fda..c07a41c693da 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3030,7 +3030,7 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)
/* Return if port is active */
if (eth_dev->data->dev_started) {
PMD_DRV_LOG(ERR, "Stop port before changing MTU\n");
- return -EPERM;
+ return -EBUSY;
}
/* Exit if receive queues are not configured yet */
--
2.30.2
next reply other threads:[~2022-09-15 11:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 11:29 Benjamin Le Berre [this message]
2022-10-04 3:53 ` Ajit Khaparde
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=20220915112906.4487-1-benjamin.le_berre@6wind.com \
--to=benjamin.le_berre@6wind.com \
--cc=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--cc=somnath.kotur@broadcom.com \
/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).