public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: stable@dpdk.org, Dariusz Sosnowski <dsosnowski@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	Bing Zhao <bingz@nvidia.com>, Ori Kam <orika@nvidia.com>,
	Suanming Mou <suanmingm@nvidia.com>,
	Matan Azrad <matan@nvidia.com>,
	Adrien Mazarguil <adrien.mazarguil@6wind.com>,
	Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Subject: [PATCH] common/mlx5: fix mac deletion on Linux
Date: Wed, 18 Mar 2026 17:36:28 +0100	[thread overview]
Message-ID: <20260318163628.609968-1-david.marchand@redhat.com> (raw)

Re-enable debug logs unconditionally, this helps understanding why mac
deletions were silently failing (while a bridge fdb del command was
working fine).

testpmd> mac_addr add 0 FA:35:44:3F:58:31
testpmd> mac_addr remove 0 FA:35:44:3F:58:31
mlx5_common: Interface 35 cannot remove MAC address FA:35:44:3F:58:31
	Operation not supported

Then, fix mac deletion as the NLM_F_CREATE == 0x200 flag is relevant
with a RTM_NEWNEIGH op.
For a RTM_DELNEIGH op, 0x200 == NLM_F_BULK and passing this flag
makes the deletion fail miserably for a single mac.

Fixes: ccdcba53a3f4 ("net/mlx5: use Netlink to add/remove MAC addresses")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/common/mlx5/linux/mlx5_nl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/common/mlx5/linux/mlx5_nl.c b/drivers/common/mlx5/linux/mlx5_nl.c
index eceb3d796f..b50431fb61 100644
--- a/drivers/common/mlx5/linux/mlx5_nl.c
+++ b/drivers/common/mlx5/linux/mlx5_nl.c
@@ -581,8 +581,8 @@ mlx5_nl_mac_addr_modify(int nlsk_fd, unsigned int iface_idx,
 	} req = {
 		.hdr = {
 			.nlmsg_len = NLMSG_LENGTH(sizeof(struct ndmsg)),
-			.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE |
-				NLM_F_EXCL | NLM_F_ACK,
+			.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK |
+				add ? NLM_F_CREATE | NLM_F_EXCL : 0,
 			.nlmsg_type = add ? RTM_NEWNEIGH : RTM_DELNEIGH,
 		},
 		.ndm = {
@@ -612,7 +612,6 @@ mlx5_nl_mac_addr_modify(int nlsk_fd, unsigned int iface_idx,
 		goto error;
 	return 0;
 error:
-#ifdef RTE_PMD_MLX5_DEBUG
 	{
 		char m[RTE_ETHER_ADDR_FMT_SIZE];
 
@@ -622,7 +621,6 @@ mlx5_nl_mac_addr_modify(int nlsk_fd, unsigned int iface_idx,
 			iface_idx,
 			add ? "add" : "remove", m, strerror(rte_errno));
 	}
-#endif
 	return -rte_errno;
 }
 
-- 
2.53.0


             reply	other threads:[~2026-03-18 16:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-18 16:36 David Marchand [this message]
2026-03-19  8:41 ` [PATCH] common/mlx5: fix mac deletion on Linux David Marchand
2026-03-19 16:06 ` Dariusz Sosnowski
2026-03-19 18:28   ` David Marchand
2026-03-20 14:14 ` [PATCH v2] " David Marchand
2026-03-20 16:12   ` Dariusz Sosnowski
2026-03-24 12:30   ` Raslan Darawsheh

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=20260318163628.609968-1-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=nelio.laranjeiro@6wind.com \
    --cc=orika@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=suanmingm@nvidia.com \
    --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