From patchwork Thu Apr 13 09:58:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13210063 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93E70C77B6C for ; Thu, 13 Apr 2023 09:59:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229977AbjDMJ7o (ORCPT ); Thu, 13 Apr 2023 05:59:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229959AbjDMJ7l (ORCPT ); Thu, 13 Apr 2023 05:59:41 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2040.outbound.protection.outlook.com [40.107.94.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F6BF769F for ; Thu, 13 Apr 2023 02:59:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BG+ZfOoWIwPc1VAK4gnOGKVRVXQokLtzRhvWr6rVkpqvZi6jvqOsK4yh53iUPPvUzkHeAtoqS6jT4AerqFiT5dlupHJSRt4j27m9NNIQbTzaiIV9yzuwAoxENRPo/1boisKcIaT8N6DdmLu3FtU4cCky/ZFs8HHRFOvz5LoeKy8aSv37vNbF9Xx26g8JMz7GDy6FH6scessZMTIchENsWuI7LCW/ctT9swHaR6dTRVHAG63U0sV73EdKJn6DmoQuNsB/kV+ijagGPqgkspWAhcA6r7DSRmMPzex3jYtFudTS1H/yiBM/lvIQUlH+1DILcHm8qAOLIrFc+YL+R7KruA== 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=qcmW5XoYWRoEgZ0UlmwVtLC6KBdkA25Co/jTfaAJNF8=; b=J5pvn0sAQYOnC9+pKUzens5NzaDhDbbf07naMURh5izJz4nN9hAHe1sx2/D5PRRg/GUdZdVyYtGhZxpiuHgL126ganUNl2ijF7EGx5IyNPipBGy36o78eSE28/STGPf4loLzwd/NdVSIlVHUlL0u2tctO5d38NUkChMFCDyRv8RoJWE+bymgByWFc75sGkx9m9dNfmjt+zT3KFvrO1NfGeNjcWOmLlV5pzlwNoFbGoQVYYYCdyzUIJTtGnI7l7YPnpb0iR20nZlftMUUawQOZCFf8QTq0ZCL3FT2pqjy+pV+uOR1ZiX0CtnUDhz2JdXKboctjRrIByc8GRKaRHv+tA== 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=qcmW5XoYWRoEgZ0UlmwVtLC6KBdkA25Co/jTfaAJNF8=; b=cwn5t0TFEMpVF5+fsvnJV5TckWzlEAiv63t8PV8zJLVF7KuhbH/9h1BuBwaLHLCdV2HIO3fb+Kif8WwPEkFMTf9kV6qHadx+MOqDOe+7OCI7yEhh2Y8XJzdzYTpAg6/roNqRnUHMQDXyUiU6VNNN6KanXwNtXG3kyavZm/1GKZV3hApcsToQ94rXptQSASrudGf6JAm367MnH77VrF+AyMquVDozI5KYbDRAzJg9W7GdP6JS/RPjGXpbKx4vWKjSROVTNzdT9/T7kyuhIml3wtFXbzdW+7O24elDprkrD06XbgoSQtC1Kc3xTA5FTcLn1vtCiYwqUNrzEk9o3a+dCw== 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 BN9PR12MB5274.namprd12.prod.outlook.com (2603:10b6:408:11f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 09:59:32 +0000 Received: from CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::d228:dfe5:a8a8:28b3]) by CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::d228:dfe5:a8a8:28b3%5]) with mapi id 15.20.6277.036; Thu, 13 Apr 2023 09:59:32 +0000 From: Ido Schimmel To: netdev@vger.kernel.org, bridge@lists.linux-foundation.org Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, razor@blackwall.org, roopa@nvidia.com, petrm@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [RFC PATCH net-next 4/9] bridge: Take per-{Port, VLAN} neighbor suppression into account Date: Thu, 13 Apr 2023 12:58:25 +0300 Message-Id: <20230413095830.2182382-5-idosch@nvidia.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20230413095830.2182382-1-idosch@nvidia.com> References: <20230413095830.2182382-1-idosch@nvidia.com> X-ClientProxiedBy: MR2P264CA0086.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:32::26) To CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6179:EE_|BN9PR12MB5274:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f2aa94a-0030-4506-99b4-08db3c05c787 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BNShkm/tfIwbcXVCcDQEutGPFmQQwhj4uadEpItrl3YVb2AcAqya4yOJ0ZP6tXsHuOAUW9HcDWFYeXExNmSFrhhLFuLHtqZ58iOwPRsItix2S1Keu3KruoLEfk+/k0eQ+xQ/nWkEh3l0PuNR+MmDvyeUW+b50F/EwLgsNWEncbe/6tjmZidkdv4+lZMKPW55KVlVvrnWlIAV/yvfdlRbD1Boz23LbnU7Q2L9AbvqsjLka/EIe41o5FuugUykh95u9qP3onBcm/JUHyp2ljwvnRMF3suxgEU29giXrV5xOu9/sap4Jt53hAMyT3ksrCirG/Y0w8SAIJ0HqfrWy9sFw/nZjJld4BW+B/AhYvr0kEtf9phbD5tic1aH7GGzssz3yxIPh2dk/f0Eaz9zfDAcbOF0FaJpZCrzJGNqhPoFL3gX+YGGzKG8BXYPG3f6ll+YcSQ9fzkqa6nqKlxnjO66f12ODc9ojocRwxIvtlEwSkAQS0eMGG7seeQ62dbykIIwCJLIAvYZGp8Jv/+gt/VbnyohPybvPqIhd6rjwer2uFxhgygCGDk8dRwLiN5sE5Vs 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:(13230028)(4636009)(346002)(396003)(39860400002)(136003)(376002)(366004)(451199021)(1076003)(4326008)(66946007)(66476007)(66556008)(6506007)(6512007)(36756003)(107886003)(26005)(2906002)(6666004)(6486002)(2616005)(83380400001)(186003)(86362001)(5660300002)(8936002)(8676002)(38100700002)(478600001)(41300700001)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Y76anbzetgPCaLwyHDuCw9WzUli42i0Gz0m0SRSybms3pRT1FCwf7lKt2JC+J+vPz75B2fN6CHVWtyZ+wQPf+1YnoZHB/qDN3S2UPpaKkJfxhyD6hyUgBCZIrWLCU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TS8ondVndiPmEi1z4/MMz0a/dJVpKp1o9JMN6crlpJ/+ihc8YDE3yWqnhJTGuJB7kc7GhqTfiKy4i1IhzIy9IkTGdiydAOGTzpQTwEZb5kW6SiHINdeZZRQw/LKcO+rlhr/sY2flv8asO0iAipiaXY5/xFGSLT1umOSkNsFMbZDISuh8anroYRpxN1X+oLflVjHp7TxLwo10vb4xoVNWVTeUFx+WHmejgMVrTwu7lCgCVgqJkwVN3b3QPd5xkfg4GRAb6zvHJu9yxiqArz5PpY0a0VDQ569E6WXcafiuJML5WKuNa26sy0CqZQSq+vLs3x3lw99BYXA8Ca+lbEJq6z0a8R1sbteBE9TRWoBWMBfLQLrI1j7afy09cKo+tyssOpQBg3sJ6x32h0L X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f2aa94a-0030-4506-99b4-08db3c05c787 X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6179.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 09:59:32.5640 (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: YP8m9n+nszS/yTkiMo1o4AKTJAAbDmHj84zJ4y0yBSe9WtZx9ywSdqc88dQ86JpVX7WgZlnANkZL4+Iwhaf1uw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5274 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC The bridge driver gates the neighbor suppression code behind an internal per-bridge flag called 'BROPT_NEIGH_SUPPRESS_ENABLED'. The flag is set when at least one bridge port has neighbor suppression enabled. As a preparation for per-{Port, VLAN} neighbor suppression, make sure the global flag is also set if per-{Port, VLAN} neighbor suppression is enabled. That is, when the 'BR_NEIGH_VLAN_SUPPRESS' flag is set on at least one bridge port. Signed-off-by: Ido Schimmel --- net/bridge/br_arp_nd_proxy.c | 2 +- net/bridge/br_if.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/bridge/br_arp_nd_proxy.c b/net/bridge/br_arp_nd_proxy.c index b45c00c01dea..016a25a9e444 100644 --- a/net/bridge/br_arp_nd_proxy.c +++ b/net/bridge/br_arp_nd_proxy.c @@ -30,7 +30,7 @@ void br_recalculate_neigh_suppress_enabled(struct net_bridge *br) bool neigh_suppress = false; list_for_each_entry(p, &br->port_list, list) { - if (p->flags & BR_NEIGH_SUPPRESS) { + if (p->flags & (BR_NEIGH_SUPPRESS | BR_NEIGH_VLAN_SUPPRESS)) { neigh_suppress = true; break; } diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 24f01ff113f0..3f04b40f6056 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c @@ -759,7 +759,7 @@ void br_port_flags_change(struct net_bridge_port *p, unsigned long mask) if (mask & BR_AUTO_MASK) nbp_update_port_count(br); - if (mask & BR_NEIGH_SUPPRESS) + if (mask & (BR_NEIGH_SUPPRESS | BR_NEIGH_VLAN_SUPPRESS)) br_recalculate_neigh_suppress_enabled(br); }