From: Gavin Li <gavinl@nvidia.com>
To: <matan@nvidia.com>, <viacheslavo@nvidia.com>, <orika@nvidia.com>,
<thomas@monjalon.net>, Dariusz Sosnowski <dsosnowski@nvidia.com>,
Bing Zhao <bingz@nvidia.com>, Suanming Mou <suanmingm@nvidia.com>,
"Minggang Li (Gavin)" <gavinl@nvidia.com>
Cc: <dev@dpdk.org>, <rasland@nvidia.com>
Subject: [PATCH V4 2/2] net/mlx5: add support for flows targeting multicast MAC addresses
Date: Fri, 29 Aug 2025 12:08:30 +0300 [thread overview]
Message-ID: <20250829090830.1049176-3-gavinl@nvidia.com> (raw)
In-Reply-To: <20250829090830.1049176-1-gavinl@nvidia.com>
Device multicast MAC addresses are managed using the mac_addr_add and
mac_addr_remove APIs.
In the mlx5_dev_spawn function, devices such as PF, VFs, and SFs obtain
the MAC addresses configured in netdev via netlink and store them in the
PMD device data, which also includes multicast MAC addresses. Default
rules are created for each MAC address to filter traffic accordingly.
Previously, multicast MAC address flows were mistakenly disabled, which
caused mac_addr_add to stop functioning for multicast MAC addresses,
resulting in missed multicast traffic.
To address this, default rules for multicast MAC addresses created by
PMD should now be set up within mlx5_traffic_enable to properly update
and manage multicast MAC address rules.
Fixes: 2d0665a7f771 ("net/mlx5: align PF and VF/SF MAC address handling")
Signed-off-by: Gavin Li <gavinl@nvidia.com>
---
drivers/net/mlx5/mlx5_trigger.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index 6c6f228afd..46479fbf09 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -1813,7 +1813,10 @@ mlx5_traffic_enable(struct rte_eth_dev *dev)
for (i = 0; i != MLX5_MAX_MAC_ADDRESSES; ++i) {
struct rte_ether_addr *mac = &dev->data->mac_addrs[i];
- if (!memcmp(mac, &cmp, sizeof(*mac)) || rte_is_multicast_ether_addr(mac))
+ /* Add flows for unicast and multicast mac addresses added by API. */
+ if (!memcmp(mac, &cmp, sizeof(*mac)) ||
+ !BITFIELD_ISSET(priv->mac_own, i) ||
+ (dev->data->all_multicast && rte_is_multicast_ether_addr(mac)))
continue;
memcpy(&unicast.hdr.dst_addr.addr_bytes,
mac->addr_bytes,
--
2.34.1
prev parent reply other threads:[~2025-08-29 9:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 14:13 [PATCH V3 0/2] resolve flow creation issue for " Gavin Li
2025-08-25 14:13 ` [PATCH V3 1/2] net/mlx5: update how MAC address bit-fields are used Gavin Li
2025-08-25 14:54 ` Thomas Monjalon
2025-08-27 14:02 ` Minggang(Gavin) Li
2025-08-25 14:13 ` [PATCH V3 2/2] net/mlx5: add support for flows targeting multicast MAC addresses Gavin Li
2025-08-25 14:52 ` Thomas Monjalon
2025-08-27 14:05 ` Minggang(Gavin) Li
2025-08-29 9:08 ` [PATCH V4 0/2] resolve flow creation issue for " Gavin Li
2025-08-29 9:08 ` [PATCH V4 1/2] net/mlx5: update how MAC address bit-fields are used Gavin Li
2025-08-29 9:08 ` Gavin Li [this message]
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=20250829090830.1049176-3-gavinl@nvidia.com \
--to=gavinl@nvidia.com \
--cc=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=rasland@nvidia.com \
--cc=suanmingm@nvidia.com \
--cc=thomas@monjalon.net \
--cc=viacheslavo@nvidia.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).