DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: add support for flows targeting multicast MAC addresses
@ 2025-08-07 11:59 Gavin Li
  2025-08-07 17:40 ` Patrick Robb
  0 siblings, 1 reply; 2+ messages in thread
From: Gavin Li @ 2025-08-07 11:59 UTC (permalink / raw)
  To: matan, viacheslavo, orika, thomas, Dariusz Sosnowski, Bing Zhao,
	Suanming Mou, Minggang Li (Gavin)
  Cc: dev, rasland, stable

Rules for multicast MAC addresses are intended to filter multicast traffic
and are managed through multicast MAC add/remove APIs. In mlx5_dev_spawn
function, devices (PF, VFs, and SFs) retrieve the netdev-configured MAC
addresses via netlink and store them in the PMD device data, which
includes multicast MAC addresses.

To update multicast MAC address rules, create them within
mlx5_traffic_enable.

Fixes: 2d0665a7f771 ("net/mlx5: align PF and VF/SF MAC address handling")
Cc: stable@dpdk.org

Signed-off-by: Gavin Li <gavinl@nvidia.com>
---
 drivers/net/mlx5/mlx5_trigger.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index 6c6f228afd..6e82a8b021 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -1813,7 +1813,8 @@ 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 rules for unicast and multicast mac addresses synchronized from kernel. */
+		if (!memcmp(mac, &cmp, sizeof(*mac)))
 			continue;
 		memcpy(&unicast.hdr.dst_addr.addr_bytes,
 		       mac->addr_bytes,
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] net/mlx5: add support for flows targeting multicast MAC addresses
  2025-08-07 11:59 [PATCH] net/mlx5: add support for flows targeting multicast MAC addresses Gavin Li
@ 2025-08-07 17:40 ` Patrick Robb
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick Robb @ 2025-08-07 17:40 UTC (permalink / raw)
  To: Gavin Li
  Cc: matan, viacheslavo, orika, thomas, Dariusz Sosnowski, Bing Zhao,
	Suanming Mou, dev, rasland, stable, Dean Marx, Andrew Bailey

[-- Attachment #1: Type: text/plain, Size: 2873 bytes --]

Hi Gavin, I'm just flagging that this patch has a failure for the
dynamic_config testsuite's test_disable_promisc_multicast testcase.

It's a testpmd testcase which disables allmulticast on the port and then
verifies that a multicast packet sent to the DUT is dropped, then enables
allmulticast and verifies that a multicast packet is received. It looks
like your series is failing for the initial check (that the packet is
dropped when allmulticast is disabled).

I'm not sure why your series is failing if it is just allowing multicast
addrs to be stored in PMD device data. Maybe it is the case that your
series is allowing the multicast address to be added (correctly), and then
that is exposing an existing issue with disabling allmulticast on a port
with the PMD? Otherwise, I'm not sure.

https://doc.dpdk.org/api/rte__ethdev_8h.html#a2fe97cde3f374385ef0b12f61e7c30da
https://doc.dpdk.org/guides/testpmd_app_ug/testpmd_funcs.html#set-allmulti

If you want to verify that allmulticast disable is working properly for a
future version of your patch you can validate it with testpmd, or even
better just run the DTS testsuite. If you need any help setting up DTS the
students at UNH are available to help with that and I added them to the CC
list.

Thanks.

On Thu, Aug 7, 2025 at 8:06 AM Gavin Li <gavinl@nvidia.com> wrote:

> Rules for multicast MAC addresses are intended to filter multicast traffic
> and are managed through multicast MAC add/remove APIs. In mlx5_dev_spawn
> function, devices (PF, VFs, and SFs) retrieve the netdev-configured MAC
> addresses via netlink and store them in the PMD device data, which
> includes multicast MAC addresses.
>
> To update multicast MAC address rules, create them within
> mlx5_traffic_enable.
>
> Fixes: 2d0665a7f771 ("net/mlx5: align PF and VF/SF MAC address handling")
> Cc: stable@dpdk.org
>
> Signed-off-by: Gavin Li <gavinl@nvidia.com>
> ---
>  drivers/net/mlx5/mlx5_trigger.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/mlx5/mlx5_trigger.c
> b/drivers/net/mlx5/mlx5_trigger.c
> index 6c6f228afd..6e82a8b021 100644
> --- a/drivers/net/mlx5/mlx5_trigger.c
> +++ b/drivers/net/mlx5/mlx5_trigger.c
> @@ -1813,7 +1813,8 @@ 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 rules for unicast and multicast mac addresses
> synchronized from kernel. */
> +               if (!memcmp(mac, &cmp, sizeof(*mac)))
>                         continue;
>                 memcpy(&unicast.hdr.dst_addr.addr_bytes,
>                        mac->addr_bytes,
> --
> 2.34.1
>
>

[-- Attachment #2: Type: text/html, Size: 3775 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-07 17:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-07 11:59 [PATCH] net/mlx5: add support for flows targeting multicast MAC addresses Gavin Li
2025-08-07 17:40 ` Patrick Robb

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).