From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E7D35A0550 for ; Mon, 15 Feb 2021 13:21:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DCBF81606DE; Mon, 15 Feb 2021 13:21:40 +0100 (CET) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id 6505D1606C5 for ; Mon, 15 Feb 2021 13:21:38 +0100 (CET) Received: from mail-qt1-f198.google.com ([209.85.160.198]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lBcsj-0007MT-Ue for stable@dpdk.org; Mon, 15 Feb 2021 12:21:38 +0000 Received: by mail-qt1-f198.google.com with SMTP id l63so5205514qtd.12 for ; Mon, 15 Feb 2021 04:21:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=YVWJh3HrcpYyuY/nIiTRTRGa3APKHV72Qy4k3z0ITfk=; b=Qop1ydDBfPO+RygCTEoa+pAm/IoWoE1SO0xPx2QgAUhbvr1OJ7CfCyFwKb6I2VkldY mvrBolkZE+Feci9j7aA8yXBm8/4L5CST3051ycie/PVYljvsLRG/YXyOCNCDm93Tf379 pihP7qFGG00b86sAOB1dLryUqyeZgrox1R7nUPXVS8aq4XygCQbH2U80Lf6eJc12FF6H EuFOGpzhc4W5TQ2XrZMmppquaWtYHaNSPdzcoC7lHsOUCNkBYW1sc1PMS9aOafgAys6m f6DzjrTwlNo+EO7gaJvA//1JTleSOFmfB7zI4fuCIzHe95bvwiMiScXnm3kh9yD305mQ zxhw== X-Gm-Message-State: AOAM531zvbVCgyo+Y2kmji++XOd+dk8lvO3mnLZGpvgPJH8MiNGumxwz fBhY+WNyxyiHzJUq6ZnRe2uaQjSBkwW+S932f4npiC+48WCgTBAZ7mLJniWkPSd8E7Y4SZWbPbu gwcbfvNPXJCm6ZlQQ2s3AwT0Il8Xglz2/LkjnDrg6 X-Received: by 2002:a05:620a:6d2:: with SMTP id 18mr14631026qky.33.1613391697026; Mon, 15 Feb 2021 04:21:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxR9g/GdFyDDcw+unteQJrWrdye3/sNA1Weazu/8g1amNt4t0y0ur0p6kRdlKZQRGiyxJSqocVACBGYFhYPlpQ= X-Received: by 2002:a05:620a:6d2:: with SMTP id 18mr14631002qky.33.1613391696778; Mon, 15 Feb 2021 04:21:36 -0800 (PST) MIME-Version: 1.0 References: <20210212151008.16948-1-sodey@rbbn.com> In-Reply-To: <20210212151008.16948-1-sodey@rbbn.com> From: Christian Ehrhardt Date: Mon, 15 Feb 2021 13:21:10 +0100 Message-ID: To: "Dey, Souvik" Cc: viacheslavo@nvidia.com, shahafs@nvidia.com, matan@nvidia.com, rasland@nvidia.com, dpdk stable , dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-stable] [PATCH 19.11] net/mlx5: fix storing the synched MAC to internal table X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Fri, Feb 12, 2021 at 4:10 PM Dey, Souvik wrote: > > From: Souvik Dey > > [ upstream commit 493f0bb51c1144eedcff2bba199cab1b64ff9fd0 ] Thanks, added > > 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 > --- > 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 !=3D MLX5_MAX_MAC_ADDRESSES) > continue; > - /* Find the first entry available. */ > - for (j =3D 0; j !=3D MLX5_MAX_MAC_ADDRESSES; ++j) { > - if (rte_is_zero_ether_addr(&dev->data->mac_addrs[= j])) { > - dev->data->mac_addrs[j] =3D macs[i]; > - break; > + if (rte_is_multicast_ether_addr(&macs[i])) { > + /* Find the first entry available. */ > + for (j =3D MLX5_MAX_UC_MAC_ADDRESSES; > + j !=3D MLX5_MAX_MAC_ADDRESSES; ++j) { > + if (rte_is_zero_ether_addr(&mac_addrs[j])= ) { > + mac_addrs[j] =3D macs[i]; > + break; > + } > + } > + } else { > + /* Find the first entry available. */ > + for (j =3D 0; j !=3D MLX5_MAX_UC_MAC_ADDRESSES; += +j) { > + if (rte_is_zero_ether_addr(&mac_addrs[j])= ) { > + mac_addrs[j] =3D 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, disc= losure, reliance or distribution by others or forwarding without express pe= rmission is strictly prohibited. If you are not the intended recipient, ple= ase notify the sender immediately and then delete all copies, including any= attachments. --=20 Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd