From: Jiawen Wu <jiawenwu@trustnetic.com>
To: dev@dpdk.org
Cc: Jiawen Wu <jiawenwu@trustnetic.com>, stable@dpdk.org
Subject: [PATCH 06/19] net/txgbe: fix VF promiscuous and allmulticast
Date: Mon, 17 Jun 2024 17:53:16 +0800 [thread overview]
Message-ID: <20240617095319.16664-7-jiawenwu@trustnetic.com> (raw)
In-Reply-To: <20240617095319.16664-1-jiawenwu@trustnetic.com>
The configuration of allmulti and promiscuous modes conflicts
together. For instance, if we enable promiscuous mode, then enable and
disable allmulti, then the promiscuous mode is wrongly disabled.
Fix this behavior by:
- doing nothing when we set/unset allmulti if promiscuous mode is on
- restorting the proper mode (none or allmulti) when we disable
promiscuous mode
Fixes: 29072d593fe4 ("net/txgbe: support VF promiscuous and allmulticast")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/txgbe/txgbe_ethdev_vf.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/net/txgbe/txgbe_ethdev_vf.c b/drivers/net/txgbe/txgbe_ethdev_vf.c
index ec40419289..6ac34058ab 100644
--- a/drivers/net/txgbe/txgbe_ethdev_vf.c
+++ b/drivers/net/txgbe/txgbe_ethdev_vf.c
@@ -1202,9 +1202,13 @@ static int
txgbevf_dev_promiscuous_disable(struct rte_eth_dev *dev)
{
struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
+ int mode = TXGBEVF_XCAST_MODE_NONE;
int ret;
- switch (hw->mac.update_xcast_mode(hw, TXGBEVF_XCAST_MODE_NONE)) {
+ if (dev->data->all_multicast)
+ mode = TXGBEVF_XCAST_MODE_ALLMULTI;
+
+ switch (hw->mac.update_xcast_mode(hw, mode)) {
case 0:
ret = 0;
break;
@@ -1225,6 +1229,9 @@ txgbevf_dev_allmulticast_enable(struct rte_eth_dev *dev)
struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
int ret;
+ if (dev->data->promiscuous)
+ return 0;
+
switch (hw->mac.update_xcast_mode(hw, TXGBEVF_XCAST_MODE_ALLMULTI)) {
case 0:
ret = 0;
@@ -1246,6 +1253,9 @@ txgbevf_dev_allmulticast_disable(struct rte_eth_dev *dev)
struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
int ret;
+ if (dev->data->promiscuous)
+ return 0;
+
switch (hw->mac.update_xcast_mode(hw, TXGBEVF_XCAST_MODE_MULTI)) {
case 0:
ret = 0;
--
2.27.0
next prev parent reply other threads:[~2024-06-17 9:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240617095319.16664-1-jiawenwu@trustnetic.com>
2024-06-17 9:53 ` [PATCH 01/19] net/txgbe: fix to parse tunnel packets Jiawen Wu
2024-06-17 9:53 ` [PATCH 02/19] net/txgbe: fix flow filters in VT mode Jiawen Wu
2024-06-17 9:53 ` [PATCH 03/19] net/txgbe: fix Tx hang on queue disable Jiawen Wu
2024-06-17 9:53 ` [PATCH 04/19] net/txgbe: restrict the configuration of VLAN strip offload Jiawen Wu
2024-06-17 9:53 ` [PATCH 05/19] net/txgbe: reconfigure more MAC Rx registers Jiawen Wu
2024-06-17 9:53 ` Jiawen Wu [this message]
2024-06-17 9:53 ` [PATCH 07/19] net/ngbe: special config for YT8531SH-CA PHY Jiawen Wu
2024-06-17 9:53 ` [PATCH 08/19] net/ngbe: keep PHY power down while device probing Jiawen Wu
[not found] <20240618071150.21564-1-jiawenwu@trustnetic.com>
2024-06-18 7:11 ` [PATCH 06/19] net/txgbe: fix VF promiscuous and allmulticast Jiawen Wu
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=20240617095319.16664-7-jiawenwu@trustnetic.com \
--to=jiawenwu@trustnetic.com \
--cc=dev@dpdk.org \
--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).