Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp825205rwi; Thu, 13 Oct 2022 05:52:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7UQkb+s8vf9k/QKYdd34VxeWAqc7SpWOixJtN8mDyQZj1cqqa87fDecsuUJXmap3kZiPjp X-Received: by 2002:a17:907:608f:b0:78e:1b60:60e2 with SMTP id ht15-20020a170907608f00b0078e1b6060e2mr595999ejc.382.1665665574256; Thu, 13 Oct 2022 05:52:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1665665574; cv=pass; d=google.com; s=arc-20160816; b=bAOHJYWa2AGyoiDivHkN+2JsjCZGwAgOsmbY9bin56mlKQVzccDH/jOZoS2kSipJ1b FP2qQ3J/TR9XE1M8KEHfUsyE4ejUIR64yRCxFNEFaSscGof0S/QrWHBJhLn3lWBUGLsk VakEi9mEz4r+vsGBPwdH5FHT+9hEGbRe8P6GWHhRRCdyv0Mrm5L+uDAYMym6NuK52iSB e7QEiDrlaXunZL6c7xeoOTrpKOtotNClLn+3NA8zJW+Bmgqp0v5XK0ormJmJOOPwLGIu m41d3wcd3gGeA+vqqm36hB6I0JaqtTaN68mitp/IAxNiBnO1T5o+KPFLFieJJFGB3CWU PMzQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HTOb6aZuMNrXGoFL+bY/yASFEjXcUko4NcXLXmZb7Qs=; b=w82TRlCqKYo/+PYxSzIyhPT6Rru7qiTGiR2NdNIgR3/CV/VhZSMxRvGcogC7gPDitE dUuu3360IHBVuacHB7K5OGmVrzQ7IxRdhUrQejFEZL3klcTBu3yzyuta0bWlPJyCPoIV DleTRHllx7AXtNp3P3Xh+E4hViUVlxpZKTgd8P3GuvMdBwmg7gEbgwDGi9nH05XAC7da zDY0zY8JOLsRi96VpIT+kvfEJEji+c7VwuAdE5B+NwapxMyuk7/DuzIZf3aDt34hvr65 JDW9HRTiGjiwOMpty0z/Vh5rNWLeLmNViwl7k3/KlEAijG2kSbLqWpViQx+e6UcNMmQr Y1cA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=aRHYCHQP; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020a056402518700b0045bdc422aeesi16127274edd.292.2022.10.13.05.52.23; Thu, 13 Oct 2022 05:52:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=aRHYCHQP; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229729AbiJMMl1 (ORCPT + 99 others); Thu, 13 Oct 2022 08:41:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229679AbiJMMlY (ORCPT ); Thu, 13 Oct 2022 08:41:24 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2059.outbound.protection.outlook.com [40.107.244.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B876F3F335; Thu, 13 Oct 2022 05:41:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iD4K/rW2jkcPcPyzZ0YQxK32e9+yNZGqFzBQXFGVdQ/BwuNHGFm/lE+BIdjwknnaAd34zPKfvbXQ6inF+NNbei882o3KMukb2LBdzonjr76iS0lt9zHSWV5kNeDOxrwnJVAsMWxBUYXP97rgmRonm/owEFsv+Li0L+AKEWxEVgLKBxbummoasKo/lsaZgo9zTveKDIe1OsqZ/jlCUjjBXBr/KemG2YH/NcjBazm50NHm7wRnQP387pmRKmMqOjWYGqrVnvRkzoclm8WrlQwKKBQqCMrjbJQIAx/VYgghAjsWyJ8Fxe8FGWJXb/79Kb1j5QeOHS/KI3jvmnCPZWL7+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HTOb6aZuMNrXGoFL+bY/yASFEjXcUko4NcXLXmZb7Qs=; b=Add3diYAvZBcWov4EvwWTDbfOzldHQOtAaaLHZdvYzLPWLnzbUUa4Lpj3U9vX/LQeSfjmDchgkBn7rp+952PEzdZVdC4ZdXrP9sJvUAZSu44OHsqTEQ5AmiJ2Xt2/XOzlFVcUsp2EiUhKHXhDln0dDdwHU22jYmJqAxS/xiSFAPG2a0IQ2WsxpOb3R5jMxJgB2cq/mY9zO5JtZY19WK7RaWKcUFEAudhPnEe49kSo25YSOePajhh9GKCug0tJ5H4sS9130cv4WuIdsC3rm6qPU3GMFgerUYhD89/BioyxbhTTqcouBU+M7QX2DXxCnf+mMktcVAUNHjnPNfDbC+oAA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HTOb6aZuMNrXGoFL+bY/yASFEjXcUko4NcXLXmZb7Qs=; b=aRHYCHQP8fbcbDi3lqpuj9Fb4gE9ffWyzE3CSAiPjKYHusPD2H6F0SpJIX+3Qi3aPy7b09jNL5tiPUYdfBl7qFnJmyOAnrmeAM2h9Jji+F8Aa75GfSzufRcIzY5RCUJphpEbmEQJ3hvad8HqZkitTlnE3GT4b4n3bnIH5qOEpQHoOjyfBW9EKprfmrn2eMXQjkIBGO8ThFummdndMxkU1NZobOI9ZBAFqU83peHYjcfnoP3Un3jHmlWNKusc9rbKiqmo6+XbHoOC4BwGVf9Jx/un11RhDKYAJPK+Qxp4I/eLhR5IfGqjksJgFRGhtVdGxS0awXtdtiY35k6aJXPUlg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) by CY5PR12MB6550.namprd12.prod.outlook.com (2603:10b6:930:42::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15; Thu, 13 Oct 2022 12:41:22 +0000 Received: from CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::4ff2:d93e:d200:227e]) by CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::4ff2:d93e:d200:227e%6]) with mapi id 15.20.5676.031; Thu, 13 Oct 2022 12:41:22 +0000 Date: Thu, 13 Oct 2022 15:41:15 +0300 From: Ido Schimmel To: "Hans J. Schultz" Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, Florian Fainelli , Andrew Lunn , Vivien Didelot , Vladimir Oltean , Eric Dumazet , Paolo Abeni , Kurt Kanzenbach , Hauke Mehrtens , Woojung Huh , UNGLinuxDriver@microchip.com, Sean Wang , Landen Chao , DENG Qingfang , Matthias Brugger , Claudiu Manoil , Alexandre Belloni , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Shuah Khan , Russell King , Christian Marangi , Daniel Borkmann , Yuwei Wang , Petr Machata , Florent Fourcot , Hans Schultz , Joachim Wiberg , Amit Cohen , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, bridge@lists.linux-foundation.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v7 net-next 1/9] net: bridge: add locked entry fdb flag to extend locked port feature Message-ID: References: <20221009174052.1927483-1-netdev@kapio-technology.com> <20221009174052.1927483-2-netdev@kapio-technology.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221009174052.1927483-2-netdev@kapio-technology.com> X-ClientProxiedBy: VI1PR04CA0137.eurprd04.prod.outlook.com (2603:10a6:803:f0::35) To CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6179:EE_|CY5PR12MB6550:EE_ X-MS-Office365-Filtering-Correlation-Id: d642b567-d51b-4d6b-e266-08daad183b80 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DX4nCQHAo383/x8njsXmpUjgRJjzx6uzsvfBdTWZwvXk2ip9GeG8ftRgi9gD+mPJURzoNK+vmL1EBNxQysd8pmyxVWV2BRSkjcGvOQGAM8Hy2sSj+PHsZsy2biuMcmUenhGGezv57zjQsGlNxEHhGW+WqojxbTNm4nIOCDjJJgyahr5ewq7VYEjY1rbBqWDnV2b63q7NR34Rv49sN64ylVUKu+jN/dbwRlknynl114xy3uXe4XIH+L1lfCxDGwcnvU50M7v7fgQlKs235KAVnvuZ4CH/66PAJdVx9iOp3iR92U8W9ippcYAaf5xglXuYMMOaoFK+KQoFO8n+fM3rcKCwN1zl2tlcnONGpiq8F3Fz0X0UkSd0wPLkTMC46KhccoEsOy5Tjc9EBWDKJlvYdx74qVaWVW5TGo0g3WBofJJPlyE0reLlVopwookgPmzSrw8wm/3xVquKyju7ked567LNh1605OEaeaDHLhXbu10Kmd1rfQi7z8TY3o4Pn6PXwptKxxnpQ3YLRkKxQTlv0xZTB9OJeMr/x2NO9Dq7rlv7ZClEuyO0fzBeqyDpnxC0KLF3tvotIH3DremgenvkxcuexhhlMHnzae7NTMFZAMhKtGYHOvDyBiDL8mmRjo3la0ezV8zV5H68zGQ0ym9AjT9xDh6Wa3Cpf4haXldAGrrk5+ijju7xXbBYZcslll6jFIbaCpyuslDjWxr9dD80Mw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR12MB6179.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(7916004)(4636009)(136003)(376002)(366004)(396003)(39860400002)(346002)(451199015)(66556008)(33716001)(7416002)(8936002)(5660300002)(4326008)(41300700001)(186003)(6486002)(83380400001)(66946007)(66476007)(6666004)(38100700002)(9686003)(86362001)(6506007)(26005)(478600001)(6512007)(8676002)(316002)(6916009)(54906003)(2906002)(7406005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?KdhLC7vUT5YkTUGSXcVIb8E29Q8EaAh1XEQEVLmY+PGwbz25jqNQisGwPioZ?= =?us-ascii?Q?aQsEK1/6AM3gMGqAfRdLCxlJ0wD44AkTet8nn1JTmN3BQWq9dRnvjhbxgUQ7?= =?us-ascii?Q?0CfeNmDDJRsWp3u6lyskUsaQ0vDEmddsKOaE0ZfQdI6tCD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dF9FJ/KXgiFDrwfAQH9Io/4hBNna/GgmDvQHogzKNb6CHCN+BmEoFqf14?= =?us-ascii?Q?umqtHFL7VITa/McW9IX8PYqn5gTGR8CrMp2r5K7tHZDcXW/ePHTbRVrB50l2?= =?us-ascii?Q?oAe+aYLEifAzVZ8W8I6RMytgQ4pbSizQ4YwdpeYCm2KQGfiEF0eNxVcazQKq?= =?us-ascii?Q?xlu5lE3gw2BwUm/l/Ebc/VxtKvkYFpBT8WoJIKpGcRy1+Tgg/2CUxIH7YhND?= =?us-ascii?Q?CTIQzM2lJi8ox2hBLsGhyZD/AllJ6h4oQE2thmGCDJEweI8rzH4lJ9PSsuM7?= =?us-ascii?Q?jmlBCNwBYkv5q7Qx19VooIdOYG5XbRl3wmqtOCMeQjsgSA5Bi/hVp65CL1x0?= =?us-ascii?Q?+MgL0nysyk4T9GEuYAXwCN1/9yMjqA1DmA2WHM+y0VcxytPnfERKN3+wBtl3?= =?us-ascii?Q?9TIOYPt2/x982BhnrtAIOFsw//H6H9ltj5r2mMZCntPOSziMiEgfToRu8dfv?= =?us-ascii?Q?ZPht14TD84pEQuHyBysKjFDcV5sxD0pFH1LfAZ1CLm9OooBg3iGdkETDDsXn?= =?us-ascii?Q?cm+WM/jCuYD6EdJRRuHsEfQkTkdG9J2s2hPTDewj?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: d642b567-d51b-4d6b-e266-08daad183b80 X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6179.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2022 12:41:21.9700 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: o48crjiwJYsgm3ZJhnXLaidzaNdMkn1pbwXbiodxJtAo0pNjCq4Nn8TWTgv/Jwo3ZanLIORqFwVaxp48FOjuyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6550 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 09, 2022 at 07:40:44PM +0200, Hans J. Schultz wrote: > diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c > index 74864dc46a7e..8008ceb45605 100644 > --- a/net/core/rtnetlink.c > +++ b/net/core/rtnetlink.c > @@ -4035,6 +4035,7 @@ int ndo_dflt_fdb_add(struct ndmsg *ndm, > const unsigned char *addr, u16 vid, > u16 flags) > { > + __u32 ext_flags = 0; > int err = -EINVAL; > > /* If aging addresses are supported device will need to > @@ -4050,6 +4051,14 @@ int ndo_dflt_fdb_add(struct ndmsg *ndm, > return err; > } > > + if (tb[NDA_FLAGS_EXT]) > + ext_flags = nla_get_u32(tb[NDA_FLAGS_EXT]); > + > + if (ext_flags & NTF_EXT_LOCKED) { > + netdev_info(dev, "invalid flags given to default FDB implementation\n"); > + return err; > + } I'm not sure it makes sense to deny specific flags in this case. It might be better to just error out if NDA_FLAGS_EXT was specified. > + > if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr)) > err = dev_uc_add_excl(dev, addr); > else if (is_multicast_ether_addr(addr)) > -- > 2.34.1 >