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 73948A04E6; Wed, 9 Dec 2020 16:11:27 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ADDB5BE79; Wed, 9 Dec 2020 16:11:24 +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 C4461BE77 for ; Wed, 9 Dec 2020 16:11:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rbbn.com; s=mimecast20180816; t=1607526681; 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=XlM2lzkMMVH1fLZ3tlGYpjTZrAspGlhPdoQDeQtWwdxgSm1LY/sHJR+Z0xijveqlhUba6E F3NFM3xXeQI3eidqzGYspxQM8L3m1WGbfWL0bebKNmK7rmp4NUh9NO4FGVfZvxqMuJRbvM XstyBvY3GauITYzUZvvlv/YGvhV5RAk= Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-547-KgihDbyuNVGVTSsfHQ36SQ-1; Wed, 09 Dec 2020 10:11:19 -0500 X-MC-Unique: KgihDbyuNVGVTSsfHQ36SQ-1 Received: from DM6PR03MB4777.namprd03.prod.outlook.com (2603:10b6:5:18b::26) by DM5PR03MB3323.namprd03.prod.outlook.com (2603:10b6:4:3e::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.21; Wed, 9 Dec 2020 15:11:17 +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 15:11:17 +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 10:11:07 -0500 Message-Id: <20201209151108.12352-1-sodey@rbbn.com> X-Mailer: git-send-email 2.9.3.windows.1 X-Originating-IP: [72.70.55.110] X-ClientProxiedBy: MN2PR05CA0061.namprd05.prod.outlook.com (2603:10b6:208:236::30) 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 MN2PR05CA0061.namprd05.prod.outlook.com (2603:10b6:208:236::30) 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 15:11:16 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8d32e1a9-d8c2-4443-53bd-08d89c54ad7d X-MS-TrafficTypeDiagnostic: DM5PR03MB3323: 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: dV/fM/3bLfds3YNvGqEoKLPdaBXak7dEGz+kHXqJ8O0wMBTBbAHuz6PTDf4FcP31vtUb0Yv+rsKcQfWqAGvFBrQLWF1foEaS1I32oOKSmwvBEjHZTFnbuB1aLlx1GmIj+h5cSfA+zEJJbsJnSfFecc7I+S03zgToN1ti8AVUSEDlY42yPmyJ3j69xu4DCHw0E4trxqZuGUXWaWyD3NojERP1t2YPU1Me18BARXwIa+jTLoRb8pyQIPv5nUKtlwApmCax1YVoIRLrGPt6YSXx5RsVprnPIvjYBm/w4q4D+i6M9KHgYHW7Nhv/NeH3HDgbmDKD+YYOBYXSTD6ulokTrfHoy3sZ4bp4J92paxjHNKKQ4v2Yyv3QgC+gusetuwCF 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)(366004)(376002)(136003)(346002)(956004)(36756003)(2616005)(6666004)(6506007)(16526019)(1076003)(83380400001)(52116002)(86362001)(66556008)(34490700003)(26005)(66476007)(4326008)(8676002)(5660300002)(107886003)(66946007)(186003)(6512007)(8936002)(2906002)(6486002)(508600001); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?+UEDWKUZZ1Lsh/fkRktr9E6hy0dn6cb6c5vcM4A6is6YzGjNGGOxIKsyInAA?= =?us-ascii?Q?njphzLU6N1JaFhZo08PD9rtdr5fvL/FCt2AcjLDnJd7/NWUwlWISNoPZK+Ij?= =?us-ascii?Q?s2OWTjDsWGIPNSw49ne7+OKdKsGodRckD5/z69+6GRmeL7YB+feFBNW8kRRU?= =?us-ascii?Q?Rb1wfduW89hXfXs5U/ObjzMbyu+D+XfYArKpBynLqVIfSCMypkof9yN2Rfun?= =?us-ascii?Q?07gCIv2uneRsvZFQ6vKOWARwRvi8Ttb1DhKB4ZMpWMjxQOBIWHacDKZJdUNy?= =?us-ascii?Q?SLgqfdJAouHiTTOEv1feQ0KFUY6+fyLuNZGP/JFFBiNY3wS2aiOQXQQVAbSO?= =?us-ascii?Q?gxEgmWJrHnUcOialy+f2nv5ydiCPT+yYMRKbRn57ZiXJZ5oe4+XYaouELYKT?= =?us-ascii?Q?mq6vsp4O0fLq0IBTaanjBK3txKBZbKxzJoJkrHKpEqE/Z8ZkVHVy1TLfTWR6?= =?us-ascii?Q?+amKG2ObhdpfEQimMo0f8yBIYCfjTCrnveOHLDHCtxFDJz54nCxBWGcDnI05?= =?us-ascii?Q?VBT5ddzRfnVxHJoVLb478JHwWPuL4ByhCtWmczYxnzHws2S+MXVnoTQ9K79D?= =?us-ascii?Q?gwfY6gOkMEUFaSQAMIjkd7Jl1bhVzlpeckZaBj022tUA0Y4q8W2QC2DIQFw6?= =?us-ascii?Q?Cj5c8M5v/6Dj/Y0GIVtfUEcXeNoBgSqaA7m7znLo/lxR32aNydvwuMAV1lPh?= =?us-ascii?Q?PHP4DAKt9mlIXwYDqioJVXtPHNSyVLlDrMkkmy/1Pu+u/QJTDUJDUt/FZj6V?= =?us-ascii?Q?5GpyVwR305656lSRsxDxqFxaMsA9h3L/ZnLHPggvySHvRdxOj2U9JlRUDTXm?= =?us-ascii?Q?nxFvfq/iNirmlVBzX/ZFxKR4NeQptPdPxHz4Mobk3LGKkghB/VRSpXXriV7p?= =?us-ascii?Q?FERRzYZkTjHPacZSI5lNiHASLuTOcIEj04n8RmrOR29RgdygL7VaHQqlwefw?= =?us-ascii?Q?GQa9ZepKdKQmXlEGje/I3ElQMPoJxtquohqD2GWqgdrb7SfRf0jQFZOOdVGi?= =?us-ascii?Q?miPA?= 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 15:11:17.4483 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 29a671dc-ed7e-4a54-b1e5-8da1eb495dc3 X-MS-Exchange-CrossTenant-Network-Message-Id: 8d32e1a9-d8c2-4443-53bd-08d89c54ad7d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Tvh1T262GvbOKzlyYLqGFgK+J73B48fFp3hwgnqrTmeCQUVK6MdTbpv87dmI3zOE X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB3323 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