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 F07F0A04E6; Wed, 9 Dec 2020 14:43:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C1FC9C96A; Wed, 9 Dec 2020 14:43:03 +0100 (CET) Received: from us-smtp-delivery-181.mimecast.com (us-smtp-delivery-181.mimecast.com [63.128.21.181]) by dpdk.org (Postfix) with ESMTP id 47685BE75 for ; Wed, 9 Dec 2020 14:43:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rbbn.com; s=mimecast20180816; t=1607521379; 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; bh=dNY6a3c/NKVlRDtf61u8vCixPZ8Oh4azJ3F63bCaBic=; b=TQ2yfoYAR0wA4llwv9IowPLbiJDb/o9OYZ8UyK2Al50eHDih6ZMBQj8VBLGdfpSTUDqPqQ KSty6jeND3+uJ1QIyx0R/cXYTAJ34pRgqJgzEDRKrvRPLcnLfcEIXcSPHbvPGq+gSZKVyf MZ9W5AZFz+N/9+olHAjellmL9g20YmE= Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08lp2044.outbound.protection.outlook.com [104.47.73.44]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-226-wRfWibQeOj-ko2Ggn0WINw-1; Wed, 09 Dec 2020 08:42:58 -0500 X-MC-Unique: wRfWibQeOj-ko2Ggn0WINw-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:42:56 +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:42:56 +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:31 -0500 Message-Id: <20201209134232.12844-1-sodey@rbbn.com> X-Mailer: git-send-email 2.9.3.windows.1 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:42:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 494558a6-1a79-4d1b-e716-08d89c485621 X-MS-TrafficTypeDiagnostic: DM6PR03MB3596: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: b8k1PzBnUkD5Ayc0OK7wYf9kkfEAzm+27XQ+p0R3k7VHsbzwVpoLVrjb3x6rPveY0pJqkpiPPrmX6Gm7qOSCSrBACoEdzxotJbteKHHm7kN0SqOl5e0UOkMtBY3R6YzweufMhw3eTTRD3+N/mDj8azlXPsfe9fGUn7nwnBC2wbMxKs6qVEJG5/VaKfSJM/421V0upjjG2R8Fh0jHru2lCZU1UM/isOjk7Hizfuid9qPALRD6bMXDZczfNrMiPqljZT2aWACwi3HvFOQNwlJzkmuq2rQm/U1MmoVUjsL2LkN+5u4BNJmmR6e6/nyPj12HX4T4klo/YdNF/b9Ee+elHUQw1wtw2lsBCWEzJkkHyqVMW9eG/fzemxQHVhQ2KznY 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?ku82KZb19GZ29AIa+jLwrJXou9k0WKhwjcURk+mQ2D+6tosyS3SzojIf2Cwt?= =?us-ascii?Q?WB8u7fCafyYlYujNDRyDLMWhdyCsFxQsBdem76xgIFDV+/XJI08/wgX8/SU1?= =?us-ascii?Q?9wAPOExYVt1Z0ZknpmZRr6wpdmWmyMrHbRv3yqB0tGgDTn8dRtP7IJHVGPJ4?= =?us-ascii?Q?XzvpQ/tSqvlKznCskpq311FadZ6Yiqc4dj9ERmkyoPWTyxdmFj+EkUF6SxRF?= =?us-ascii?Q?PthjOQ/fTiD2P13dG9y8uK2GZ7DvpdNuxiJXHnjoGw1gd7iqPdHbQRhfP6TD?= =?us-ascii?Q?ZHloBfn3YXQAwSsVcs9/0LoqCKNATn/e0uE3vJ9Ig+2rLkreO0ROglEbhYYF?= =?us-ascii?Q?kLzcr6FEz6RxZ692xHmD6EiivosJV/VEPpitlOOn9oAFDm7eVTJzohPBTHWT?= =?us-ascii?Q?qJi0Ozx2JYKhiJdCKs7ate2wVWCC2DGamiMz8h4nKqyPlmXS731SFRiASEBo?= =?us-ascii?Q?CLarTM3qA8g9oHDExuP14rLphJ16dZT6KeWtS5wumN3REeWMpoTOQ8zjTyI+?= =?us-ascii?Q?xHhJV/GyWTKwNiwr1WvLI0RLABl9dvEIqkD7KcVNSR8plGuHG3VsWqvaxX1/?= =?us-ascii?Q?C+UsnVT8+mP6S2TrLN1ejFSlZgrwzrJL9tWs8sMFl+AYXBYP4OTac9kmxDzi?= =?us-ascii?Q?VNAK8iVeidFEEduSKmHOQnLguqFXFdeTqF12T/Wr/q2woEv086yk1fNiC0i1?= =?us-ascii?Q?1B9XPs/79mcr4+PR8hlkHwLBmvigSukmeJ8GCKmPdkr55ymKaph6FQpJFTkL?= =?us-ascii?Q?jH3aCtF7UVLbCv3/+qhVywY1B13ZX42MJUMtaU7LhUfHB+jT+BtxYS9RlT9r?= =?us-ascii?Q?DXiDC0YViWCzGVvfmha520r1iDsoQ/gsnAXLcbu98nPF0s+oyjXY8VNKhuqp?= =?us-ascii?Q?n+BOBANZf/hPaYAyIbWHP/Ors7J33KQH9NEvn2/IQlx5dtKnYLBb9lnmti8S?= =?us-ascii?Q?xO4SBK07n1homQhyQZtFKnwkYpw5DxZVaf+2/uPeEmF/wSBkleq9GxKcSA9g?= =?us-ascii?Q?4Nbe?= 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:42:56.8396 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 29a671dc-ed7e-4a54-b1e5-8da1eb495dc3 X-MS-Exchange-CrossTenant-Network-Message-Id: 494558a6-1a79-4d1b-e716-08d89c485621 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6UZ0/nOZvRUjbp1OL4yYJjI5v53Vl4A5ctE2hJ3ZUAzRGmAMyP3+gctZ88pUjKvC 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" During the mlx5_dev_spawn(), it tries to sync the MAC address of the Device to the internal MAC table. In case of SR-IOV VF , the=20 mlx5_nl_mac_addr_sync() gets, 2 MAC address in the fresh start.=20 One the unicast MAC assigned to the VF on the host and the second the multicast mac of 33:33:00:00:00:01. Currently without check the=20 type of MAC we try to add the MAC 33:33:00:00:00:01 to the first free place in the MAC table which will be mostly index 1, as index 0 stores=20 the unicast MAC assigned to the VF. This causes issues subsequently when we try to add multicast address list. As every IPv6 IP generates=20 differnet multicast MAC, to support multiple IP on a single interface,=20 we need to add a list of multicast MAC. As an example, if we try to=20 add 3 multicast MAC as mentioned below mcast addr 0 - 33:33:00:00:00:01 mcast addr 1 - 01:00:5e:00:00:01 mcast addr 2 - 33:33:ff:68:fe:7d then, the addition of these MAC will fail with error -EADDRINUSE in=20 mlx5_internal_mac_addr_add(), and none of the MAC address will be=20 added to the device, which will lead of packet drop in case multicast promiscuous is not enable. To make this work, we should store the synced MAC to the proper section=20 of the internal table, after checking the type of the MAC synced. This check will make the MAC of 33:33:00:00:00:01(synced MAC) to be stored at=20 index 128(starting of MLX5_MAX_MC_MAC_ADDRESSES), which will be removed=20 and added again during the mlx5_set_mc_addr_list(). This will make sure=20 that all the multicast MACs are added properly to both the internal table and also the device, specially in case of SR-IOV VF. Souvik Dey (1): net/mlx5:fix storing the synced MAC to internal table drivers/common/mlx5/linux/mlx5_nl.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) --=20 2.9.3.windows.1