From: "Dey, Souvik" <sodey@rbbn.com>
To: viacheslavo@nvidia.com, shahafs@nvidia.com, matan@nvidia.com,
rasland@nvidia.com, stable@dpdk.org
Cc: christian.ehrhardt@canonical.com, dev@dpdk.org,
Souvik Dey <sodey@rbbn.com>
Subject: [dpdk-dev] [PATCH 19.11] net/mlx5: fix storing the synched MAC to internal table
Date: Fri, 12 Feb 2021 10:10:08 -0500 [thread overview]
Message-ID: <20210212151008.16948-1-sodey@rbbn.com> (raw)
From: Souvik Dey <sodey@rbbn.com>
[ upstream commit 493f0bb51c1144eedcff2bba199cab1b64ff9fd0 ]
As the internal MAC table is divided into Unicast and Multicast address
sections, we should check the type of synched MAC address before storing
it to the internal table. Currently the check is not done, and the
synched MAC of 33:33:00:00:00:01 gets stored in the unicast section
(mostly index 1) causing all subsequent mlx5_set_mc_addr_list()
to fail with error -EADDRINUSE, as the mac_list contains the MAC
33:33:00:00:00:01. This denies adding of any new multicast address to
the internal list and also fails to add the MAC address to the device
in case of SR-IOV VF.
Fixes: f22442cb5d42 ("net/mlx5: reduce Netlink commands dependencies")
Fixes: ccdcba53a3f4 ("net/mlx5: use Netlink to add/remove MAC addresses")
Signed-off-by: Souvik Dey <sodey@rbbn.com>
---
drivers/net/mlx5/mlx5_nl.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_nl.c b/drivers/net/mlx5/mlx5_nl.c
index 64580b9..add756d 100644
--- a/drivers/net/mlx5/mlx5_nl.c
+++ b/drivers/net/mlx5/mlx5_nl.c
@@ -678,11 +678,22 @@ mlx5_nl_mac_addr_sync(struct rte_eth_dev *dev)
break;
if (j != MLX5_MAX_MAC_ADDRESSES)
continue;
- /* Find the first entry available. */
- for (j = 0; j != MLX5_MAX_MAC_ADDRESSES; ++j) {
- if (rte_is_zero_ether_addr(&dev->data->mac_addrs[j])) {
- dev->data->mac_addrs[j] = macs[i];
- break;
+ if (rte_is_multicast_ether_addr(&macs[i])) {
+ /* Find the first entry available. */
+ for (j = MLX5_MAX_UC_MAC_ADDRESSES;
+ j != MLX5_MAX_MAC_ADDRESSES; ++j) {
+ if (rte_is_zero_ether_addr(&mac_addrs[j])) {
+ mac_addrs[j] = macs[i];
+ break;
+ }
+ }
+ } else {
+ /* Find the first entry available. */
+ for (j = 0; j != MLX5_MAX_UC_MAC_ADDRESSES; ++j) {
+ if (rte_is_zero_ether_addr(&mac_addrs[j])) {
+ mac_addrs[j] = macs[i];
+ break;
+ }
}
}
}
--
2.9.3.windows.1
Notice: This e-mail together with any attachments may contain information of Ribbon Communications Inc. and its Affiliates that is confidential and/or proprietary for the sole use of the intended recipient. Any review, disclosure, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please notify the sender immediately and then delete all copies, including any attachments.
next reply other threads:[~2021-02-12 15:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-12 15:10 Dey, Souvik [this message]
2021-02-15 12:21 ` Christian Ehrhardt
2021-02-15 16:41 ` Christian Ehrhardt
2021-02-17 21:03 ` [dpdk-dev] [PATCH 19.11 v2] " Dey, Souvik
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=20210212151008.16948-1-sodey@rbbn.com \
--to=sodey@rbbn.com \
--cc=christian.ehrhardt@canonical.com \
--cc=dev@dpdk.org \
--cc=matan@nvidia.com \
--cc=rasland@nvidia.com \
--cc=shahafs@nvidia.com \
--cc=stable@dpdk.org \
--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).