From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2363BA04E6; Wed, 9 Dec 2020 14:43:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0140FC9A2; Wed, 9 Dec 2020 14:43:29 +0100 (CET) Received: from us-smtp-delivery-181.mimecast.com (us-smtp-delivery-181.mimecast.com [216.205.24.181]) by dpdk.org (Postfix) with ESMTP id 11463C9A0 for ; Wed, 9 Dec 2020 14:43:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rbbn.com; s=mimecast20180816; t=1607521406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BvyG4IuLTuOH0mA0xnNIH7dvpxVdmbx4aeO0qwW21/M=; b=ELL17FiXvbng8SeM2y9UF86gBy2HxpkSZkL8T35mVNQzxgA/EMxDtVNQ8s/YougtpLEs1Q ylnNXxphd0DwaWaox1Ho4uuWkwmx71DYzt9nmPkYeaBBnuchtRF65KLJ0mtogcsk378vX1 hL+u5reSCNTEFfg0VTXEjXhJXiwiTak= Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08lp2049.outbound.protection.outlook.com [104.47.73.49]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-551-f49dYcdPMIW2phpTV1X2hg-1; Wed, 09 Dec 2020 08:43:25 -0500 X-MC-Unique: f49dYcdPMIW2phpTV1X2hg-1 Received: from DM6PR03MB4777.namprd03.prod.outlook.com (2603:10b6:5:18b::26) by DM6PR03MB3596.namprd03.prod.outlook.com (2603:10b6:5:b2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.23; Wed, 9 Dec 2020 13:43:23 +0000 Received: from DM6PR03MB4777.namprd03.prod.outlook.com ([fe80::5cc0:8293:cf4f:44f4]) by DM6PR03MB4777.namprd03.prod.outlook.com ([fe80::5cc0:8293:cf4f:44f4%6]) with mapi id 15.20.3654.013; Wed, 9 Dec 2020 13:43:23 +0000 From: Souvik Dey To: rasland@nvidia.com, matan@nvidia.com, shahafs@nvidia.com, viacheslavo@nvidia.com Cc: dev@dpdk.org, Souvik Dey Date: Wed, 9 Dec 2020 08:42:32 -0500 Message-Id: <20201209134232.12844-2-sodey@rbbn.com> X-Mailer: git-send-email 2.9.3.windows.1 In-Reply-To: <20201209134232.12844-1-sodey@rbbn.com> References: <20201209134232.12844-1-sodey@rbbn.com> X-Originating-IP: [72.70.55.110] X-ClientProxiedBy: MN2PR05CA0042.namprd05.prod.outlook.com (2603:10b6:208:236::11) To DM6PR03MB4777.namprd03.prod.outlook.com (2603:10b6:5:18b::26) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from SODEY-LMA.sonusnet.com (72.70.55.110) by MN2PR05CA0042.namprd05.prod.outlook.com (2603:10b6:208:236::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3654.7 via Frontend Transport; Wed, 9 Dec 2020 13:43:23 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f7855be4-5956-4ba7-0e19-08d89c486629 X-MS-TrafficTypeDiagnostic: DM6PR03MB3596: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: 7cOaQuge4RB7H9bHHQ60076r+EUnESIf/cBSKsi1LViAfJ4TB+3D+ttWflxVedrFPyjj46PvFc60DxYJvp6d22CxTTtdryVMOfjipxHVhJ1Zz39IINwNtfXDCH6RI8CzOyx9Z3xl5C2jWV8RQ5Rz9EurTMoWVeg97fx8/l6IVeykyGr5v1mSpnyT5zkZfqDFdbgdTxLnPbUCxbaPrXkg+Cuh0eHu+LKzvhCqRpBko3qLbPEkt5Pmx/ZUMTHPv+9N/lpkCKlf+YcH3ROHL8wOfmJg41x2cOlWUDSm69IRFdZKarDjfzK1N8aGrFtjHWLl2AwaCd0+dWF+UrhQurbZkObvZjkkELG9YSBxb+E0Sdb8lLwWkiUrAXSeEPcu1Ghz X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR03MB4777.namprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(366004)(136003)(376002)(5660300002)(36756003)(34490700003)(66556008)(4326008)(26005)(2906002)(2616005)(83380400001)(6486002)(186003)(956004)(107886003)(6512007)(16526019)(52116002)(508600001)(1076003)(8676002)(8936002)(86362001)(6506007)(6666004)(66946007)(66476007); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?hKjRt/dCC0Kxo9k6SBVw3Y/9VvVQOHVIMahjAe+vK0UmGYnM5NOy4hYZtVYX?= =?us-ascii?Q?4tVYC1lw3JvZ+2IRwzoNGSd6ntmV3K6mp6QWXnz+OJHDh7UmCQ8qrQDvrDIY?= =?us-ascii?Q?nQnpdQgaXPljhyQ46F+/k4fyHPLfbxqX1JQ9PGX9G1lXYsYI5AkqPIeUcMNx?= =?us-ascii?Q?qVIRjDZ/+iduqlAX2tsoWv+4vv0wt1TKkdsQxEXHwWyk9lPFSSCS8CfiWF87?= =?us-ascii?Q?f44EFDMwacQ31k3iklMSozTUNUFpnTTwtmusGpGz8jOc1alcoyN/SZ5hJtGW?= =?us-ascii?Q?C6xEKnbOBilgyPNJ2g3XGJ4z+A+KPDEXW+4yvWGCTKugt/Hrj89EVKSemBU1?= =?us-ascii?Q?05J64b3V5vXw88lfGZRwPObUVIq7X0ICdP0DZ93EYsGvuEA7fOCxGLtwreTa?= =?us-ascii?Q?uqSR4jk0zwD7jph8rF44PS0ER7cwVZN6D6lG6G0ClLfEGo10wJ0G8Ezin7uC?= =?us-ascii?Q?OXLIZiz2Nq7A3i74zPpVWzpwPOTTVpNaGAQ22fmzFw6LrC7+hsUkWIqzmIXf?= =?us-ascii?Q?RqwgWvKqFAT6OZo50kgpS4zbObmJ2poOELWFem9dskXGxmnZw8/dso6Ab+dD?= =?us-ascii?Q?vRpmYHT2Qy20dAblEq8ubEEGEZ7Z0Y2RM7sdzCuFHn1ab+SRCI5geMBqPVj9?= =?us-ascii?Q?VCzsY71Q53LeA8ZcjKS/tV9yP9w+dqma97wXpeEJaTU6hDndxe5m7zeYQ+mi?= =?us-ascii?Q?YssrfqvmqHhZsOGrCwqnIlEvvuG1E2hXtpwjjM2NLLXPsaHwYxdL92mx6cGs?= =?us-ascii?Q?tseHWCYo680w0avV1GpazxmaayGLQUmeO+YY7hEkBqLZy0D6dicnUuZL6ZCF?= =?us-ascii?Q?vj5VRNxSrQ7gsz7lBtMJvRcy0TRfhhH9JiYm0x54I+8WqYaGt3RHboDvgesR?= =?us-ascii?Q?35zlguJGqDF7F6TZ43YE7f6l/VfMLT9wN3B5yma/I3bBA/9JqZZrgHAtY3pE?= =?us-ascii?Q?ajgxkyxzR6JPZzi2/bV7mwah+6Spf93C9yKvoYcJi2Lq2Z/pvV3VO26lfR0J?= =?us-ascii?Q?JyVf?= X-OriginatorOrg: rbbn.com X-MS-Exchange-CrossTenant-AuthSource: DM6PR03MB4777.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2020 13:43:23.7700 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 29a671dc-ed7e-4a54-b1e5-8da1eb495dc3 X-MS-Exchange-CrossTenant-Network-Message-Id: f7855be4-5956-4ba7-0e19-08d89c486629 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: He5GZcss4Cm9kjWzixhi+Sk0uj/QQWSs4ahnkPTuHirmDVzqClx7/7E0W/0mcg+N X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB3596 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA81A106 smtp.mailfrom=sodey@rbbn.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: rbbn.com Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Subject: [dpdk-dev] [PATCH] net/mlx5:fix storing the synced MAC to internal table X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" As the internal MAC table is divided into Unicast and Multicast address section, we should check the type of synced MAC address before storing it to the internal table. Currently the check is not done, and the synced MAC of 33:33:00:00:00:01 gets stored in the unicast section (mostly index 1) which causes all subsequent mlx5_set_mc_addr_list() to fail with error -EADDRINUSE, as the mac_list conatins 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 case. Signed-off-by: Souvik Dey --- drivers/common/mlx5/linux/mlx5_nl.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/common/mlx5/linux/mlx5_nl.c b/drivers/common/mlx5/linu= x/mlx5_nl.c index 40d8620..da56add 100644 --- a/drivers/common/mlx5/linux/mlx5_nl.c +++ b/drivers/common/mlx5/linux/mlx5_nl.c @@ -758,11 +758,21 @@ mlx5_nl_mac_addr_sync(int nlsk_fd, unsigned int iface= _idx, =09=09=09=09break; =09=09if (j !=3D n) =09=09=09continue; -=09=09/* Find the first entry available. */ -=09=09for (j =3D 0; j !=3D n; ++j) { -=09=09=09if (rte_is_zero_ether_addr(&mac_addrs[j])) { -=09=09=09=09mac_addrs[j] =3D macs[i]; -=09=09=09=09break; +=09=09if (is_multicast_ether_addr(&macs[i])) { +=09=09=09/* Find the first entry available. */ +=09=09=09for (j =3D MLX5_MAX_UC_MAC_ADDRESSES; j !=3D n; ++j) { +=09=09=09=09if (rte_is_zero_ether_addr(&mac_addrs[j])) { +=09=09=09=09=09mac_addrs[j] =3D macs[i]; +=09=09=09=09=09break; +=09=09=09=09} +=09=09=09} +=09=09} else { +=09=09=09/* Find the first entry available. */ +=09=09=09for (j =3D 0; j !=3D MLX5_MAX_UC_MAC_ADDRESSES; ++j) { +=09=09=09=09if (rte_is_zero_ether_addr(&mac_addrs[j])) { +=09=09=09=09=09mac_addrs[j] =3D macs[i]; +=09=09=09=09=09break; +=09=09=09=09} =09=09=09} =09=09} =09} --=20 2.9.3.windows.1