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 DEAE5A054F; Mon, 15 Feb 2021 13:21:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C820D1606C5; Mon, 15 Feb 2021 13:21:39 +0100 (CET) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id 61EFC40FDF for ; Mon, 15 Feb 2021 13:21:38 +0100 (CET) Received: from mail-qv1-f71.google.com ([209.85.219.71]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lBcsj-0007MU-Uf for dev@dpdk.org; Mon, 15 Feb 2021 12:21:38 +0000 Received: by mail-qv1-f71.google.com with SMTP id n8so2091684qvo.18 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=UiEDCEVg4MERHj9wDA9T91yQ6U7NGNgrEq7/qRmr7MHGYgmvAw3YJaSRMt9EHAtET7 3cJ1QqZoEiam8PyFdHZYF52/Of0lBaeykroc/gi9j4KVMf0JOoiMRIuqwunO48mCHwUu BiSBO1F2h76L1rKLtYXsOuYp3rb1KpxnLMLj2pqrk6s0TLEVD9gZ1rTBCQaIQKf25shI 24dKtbbW+SPjHe5ScM5rjGG8upGVoJSoCA6mcK7vXYEuM7Lx/RGIdhA+IzCjCUyBL4IP LR8yj1YTN0APZzHzDOG5CZcrZf2KdhuH2NFpEqokVtPNLdEn5ou40pcUjOBwQiVSHESl U9pw== X-Gm-Message-State: AOAM531NDAViuEqaOnuFP9j3UXoTam622XJSr9OVlZr+dMY2aH988ZUX BGxJnkNOHYsOggKseLN5Vj0I+lwwBqGEA6SbXANvbAXeYefBGPxirk1BRTR9x8NXojO3GkMFu1q td144jV+0fIxGvAZNVrwWy2ELTFSpvCW7UyAy X-Received: by 2002:a05:620a:6d2:: with SMTP id 18mr14631025qky.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-dev] [PATCH 19.11] net/mlx5: fix storing the synched MAC to internal table X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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