From: Sunyang Wu <sunyang.wu@jaguarmicro.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, ferruh.yigit@amd.com,
andrew.rybchenko@oktetlabs.ru, stable@dpdk.org
Subject: [PATCH] ethdev: keep promiscuous/allmulti value before enabling
Date: Mon, 21 Jul 2025 19:51:39 +0800 [thread overview]
Message-ID: <20250721115139.46728-1-sunyang.wu@jaguarmicro.com> (raw)
The values of the promiscuous and allmulticast variables
are set after calling the driver, according to the return value.
Fixes: 400d75818266 ("ethdev: check device promiscuous state")
de5ccf0775ae ("ethdev:do nothing if all-multicast mode is applied
again")
Cc: stable@dpdk.org
Signed-off-by: Sunyang Wu <sunyang.wu@jaguarmicro.com>
---
lib/ethdev/rte_ethdev.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index dd7c00bc94..41f96071e2 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -3018,7 +3018,8 @@ rte_eth_promiscuous_enable(uint16_t port_id)
return -ENOTSUP;
diag = dev->dev_ops->promiscuous_enable(dev);
- dev->data->promiscuous = (diag == 0) ? 1 : 0;
+ if (diag == 0)
+ dev->data->promiscuous = 1;
diag = eth_err(port_id, diag);
@@ -3086,7 +3087,8 @@ rte_eth_allmulticast_enable(uint16_t port_id)
if (dev->dev_ops->allmulticast_enable == NULL)
return -ENOTSUP;
diag = dev->dev_ops->allmulticast_enable(dev);
- dev->data->all_multicast = (diag == 0) ? 1 : 0;
+ if (diag == 0)
+ dev->data->all_multicast = 1;
diag = eth_err(port_id, diag);
--
2.19.0.rc0.windows.1
next reply other threads:[~2025-07-21 11:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-21 11:51 Sunyang Wu [this message]
2025-07-21 12:07 ` Thomas Monjalon
2025-07-21 12:13 ` 回复: " Sunyang Wu
2025-07-21 12:28 ` Thomas Monjalon
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=20250721115139.46728-1-sunyang.wu@jaguarmicro.com \
--to=sunyang.wu@jaguarmicro.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=stable@dpdk.org \
--cc=thomas@monjalon.net \
/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).