From patchwork Tue Oct 17 07:02:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Cohen X-Patchwork-Id: 13424655 X-Patchwork-Delegate: dsahern@gmail.com Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F985168A7 for ; Tue, 17 Oct 2023 07:03:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="Hc0BhGNO" Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2079.outbound.protection.outlook.com [40.107.220.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E478B83 for ; Tue, 17 Oct 2023 00:03:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C8KZifIVbrdTSpYK4Eq1RZZdo6SNpo2108n/1IN/8P8Yvp9zxVmvq1CgyDG5kLvgINp6rlwZ/SZIkDeB8V63zbNLOC/UjLdZgtNmh/IoB7dORSK/oPEUjhCvuIHdUfxbHnN9Migj6UMmexDNPCCIaY3kcL3zft7RNheDYu4J0c87D1+87Z2X9kuQhA/Vo7YrorPA8aX4Nlx8xlKFEhtPxvzuI7viLFeHwBZ1z4mnNrkK0JICO+TWuw/L3ianjUtQ9koiWV+iCHv+vvXCIRWctuMHuQrq5aN5nAkVobyTDo7kCuHXchOy2ZRdXiwVQgREzVqwdH3TqpM8xiucY8d9wg== 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=bvkGxaYVWhuK5yywPQ0S8DNtSiNUh32Camz0Vwr/V84=; b=dIbozP57DxRarmOhe3Fv9LBE0gOYFwyB08Meqjwft+8lKvBxCNjRUp+6f6b39sbmohA6AReJ4i3LYJuhJ3ncTr5kQLHbWiN9G3xhzh8JngoMpeEAvDSQC+cMc92DkQZqMoTSJ8am8F2Ky+qVDoMnnyxuvNKMpscuYVCV/qirSnI8h2rfCRLEWS60OAumAiBUin8IB1Ynv1kTwBjvuSga980X3FDBIOa6uNwdL9o1NfhbLbdrFmOLFHcwxXpeJmJnn0t7bSuhPSAJJB/MfzcTHQH+Ge2qfZtSQv7NSWn+F/Y5W7CiXT9sup+z01l1TvAi6D0LdyipwLNmtpFccSkZdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=bvkGxaYVWhuK5yywPQ0S8DNtSiNUh32Camz0Vwr/V84=; b=Hc0BhGNOsqXYkzTI0ntql9TwYeqDDwcrTbB2wJomhKUGRzEHG0QJ1m17r2I7lLHNzYPtpCUWNnWcGAV7c/rLHI8ffXIwcDUrSQwk7s8cZj1hWse9Sarm1zlWzSh1GUTZMzGsotAAFDqlmgGMwatSk2VM8Ypmfqf8QuN/e/yRiL7nC/pQWEzyCg/xueaHj1OVyzTpArbhdPj23oAFBn+DQDXgyHLb0JAtG7eW9kjQsQQ28ki01Tfc3z/vo0pQOwvhczyllJkF0j2w/HVygNbkfhKcaE3AVXppBtEVs07Lw9b0g8CEdlGYxFKmWyFzXbKujOP4KuXNiVJ9qbHC1QHbng== Received: from MW3PR06CA0010.namprd06.prod.outlook.com (2603:10b6:303:2a::15) by PH7PR12MB6737.namprd12.prod.outlook.com (2603:10b6:510:1a8::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.34; Tue, 17 Oct 2023 07:03:05 +0000 Received: from MWH0EPF000989E8.namprd02.prod.outlook.com (2603:10b6:303:2a:cafe::ff) by MW3PR06CA0010.outlook.office365.com (2603:10b6:303:2a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.31 via Frontend Transport; Tue, 17 Oct 2023 07:03:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by MWH0EPF000989E8.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.21 via Frontend Transport; Tue, 17 Oct 2023 07:03:04 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 17 Oct 2023 00:02:46 -0700 Received: from dev-r-vrt-156.mtr.labs.mlnx (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 17 Oct 2023 00:02:43 -0700 From: Amit Cohen To: CC: , , , , , Amit Cohen Subject: [PATCH iproute2-next 1/8] bridge: fdb: rename some variables to contain 'brport' Date: Tue, 17 Oct 2023 10:02:20 +0300 Message-ID: <20231017070227.3560105-2-amcohen@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017070227.3560105-1-amcohen@nvidia.com> References: <20231017070227.3560105-1-amcohen@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E8:EE_|PH7PR12MB6737:EE_ X-MS-Office365-Filtering-Correlation-Id: 43f033b8-2508-45f4-d43a-08dbcedf1c31 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h0e/f9n/q0DISU37gaV7lBDymGJYxBC8Y03cjL+PjYRghjYjean1h8CJNuk7QDop3qj1YWBpywzfNX1fWDxSH7YeIhS0JWnedNf8CBxIIKoritp8s2Ov36KdqMQXtGH9RBUhERIZuaHMDsta+w5oEStNlRqAdihoOBfiBVpUl4SqvpPRXGnBMCICX+Mmg9GSYcEiz8akcZY71yL33WF6v4O3+GB6LfR65msHgniICq5pT2qQ3bJKLTtEa/A560fI1F5zy/Y81JILWI4s0H9y1R7N16FeMBIWlhQdTN1H2GbS6xU4DePuGHB3uJnQkj+pznWyvrdm1u8sYXuM/1hETw8wUvBsyZLdHmhsCphiCisC7bKBDxzue/gA4OaA4hiTEpE7vOSjCH5kRP+6BpDj2X8JxfK6OW+DyIZyYxaz4PU0U6RiPr7BL+Qy+giAs152O7NSY6hzbits4w49kVRiZ9de4Sx1WV9fAoJrtSVl7hetl4/ZJBRkMaAUwLE34fzXWK3kTXa0Kdu34j5BQR+J5QKg+1lvF2+RlLopHvz5shdRVIAnvbcrVCRy6t23uCFjn/xv/bPB2+En/+NwlObSVuE3ESbFCiIFATthIFdBDxyofmJcINSldkwj30lnlhxSNJP0yUAkFtExy2yUdiiOLnYCFoji8GO5l6PbRsYomUEKowxaZb4RnpazZveee/pC8HXQ7JQ4nvXuGrs08COuQ6aT/uZUWIy9uhiQHzDyaUI= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(346002)(376002)(396003)(136003)(230922051799003)(64100799003)(82310400011)(451199024)(186009)(1800799009)(40470700004)(46966006)(36840700001)(40480700001)(8936002)(8676002)(4326008)(5660300002)(2906002)(41300700001)(40460700003)(86362001)(36756003)(16526019)(82740400003)(1076003)(2616005)(356005)(107886003)(7636003)(26005)(83380400001)(6666004)(478600001)(426003)(36860700001)(336012)(47076005)(70586007)(316002)(54906003)(70206006)(6916009);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 07:03:04.7394 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 43f033b8-2508-45f4-d43a-08dbcedf1c31 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000989E8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6737 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_BLOCKED,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 X-Patchwork-Delegate: dsahern@gmail.com Currently, the flush command supports the keyword 'brport'. To handle this argument the variables 'port_ifidx' and 'port' are used. A following patch will add support for 'port' keyword in flush command, rename the existing variables to include 'brport' prefix, so then it will be clear that they are used to parse 'brport' argument. Signed-off-by: Amit Cohen Acked-by: Nikolay Aleksandrov --- bridge/fdb.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bridge/fdb.c b/bridge/fdb.c index d7ef26fd..e01e14f1 100644 --- a/bridge/fdb.c +++ b/bridge/fdb.c @@ -696,10 +696,10 @@ static int fdb_flush(int argc, char **argv) }; unsigned short ndm_state_mask = 0; unsigned short ndm_flags_mask = 0; - short vid = -1, port_ifidx = -1; + short vid = -1, brport_ifidx = -1; + char *d = NULL, *brport = NULL; unsigned short ndm_flags = 0; unsigned short ndm_state = 0; - char *d = NULL, *port = NULL; while (argc > 0) { if (strcmp(*argv, "dev") == 0) { @@ -752,10 +752,10 @@ static int fdb_flush(int argc, char **argv) ndm_flags &= ~NTF_OFFLOADED; ndm_flags_mask |= NTF_OFFLOADED; } else if (strcmp(*argv, "brport") == 0) { - if (port) + if (brport) duparg2("brport", *argv); NEXT_ARG(); - port = *argv; + brport = *argv; } else if (strcmp(*argv, "vlan") == 0) { if (vid >= 0) duparg2("vlan", *argv); @@ -783,11 +783,11 @@ static int fdb_flush(int argc, char **argv) return -1; } - if (port) { - port_ifidx = ll_name_to_index(port); - if (port_ifidx == 0) { + if (brport) { + brport_ifidx = ll_name_to_index(brport); + if (brport_ifidx == 0) { fprintf(stderr, "Cannot find bridge port device \"%s\"\n", - port); + brport); return -1; } } @@ -803,8 +803,8 @@ static int fdb_flush(int argc, char **argv) req.ndm.ndm_flags = ndm_flags; req.ndm.ndm_state = ndm_state; - if (port_ifidx > -1) - addattr32(&req.n, sizeof(req), NDA_IFINDEX, port_ifidx); + if (brport_ifidx > -1) + addattr32(&req.n, sizeof(req), NDA_IFINDEX, brport_ifidx); if (vid > -1) addattr16(&req.n, sizeof(req), NDA_VLAN, vid); if (ndm_flags_mask) From patchwork Tue Oct 17 07:02:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Cohen X-Patchwork-Id: 13424657 X-Patchwork-Delegate: dsahern@gmail.com Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62006171D8 for ; Tue, 17 Oct 2023 07:03:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="R4N1BQLw" Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2060.outbound.protection.outlook.com [40.107.223.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D5129F for ; Tue, 17 Oct 2023 00:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H+pTRweAquAdkshWxJczn9uozu0ruS4cawlx68BT6ysoRZqxS08zmPD5e9a7k6poR9QIsfjO2Jxy+QEjTeSF40Iw0OgAewMCqu5tigNloG378Sd36/qWBOzzte8RRpruoBS7jLNpuiTUWTTyVX2VI+lvmfP6HqZAfHCCvfssOZe9orW1RuHktNmcTlx07H/AbZTZVkwRugkL5xcPJzNupmALXqWIwhgPYi1tT1Px+Ce29NOD5CW85Fk4aIcTMKn+uGEEWqAKuMSLE8alzFF0QQJEC7PNNiSYBjnuc8AEBb+NSXEzw0KigQ+GAvdrw6ayXRhT5wL6tuH7COcDb682Gw== 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=SGGtTjVK0HroQQ7REw9R4Cm1hHoPV9/JA9udfoyH+FM=; b=C1RBrmqyZhk6//CHqlkIUOqvc5kdcldEulDHy+yuDoaxxaXumEyI+dJvMwK0rqA2HX9Twl41I0ST4XSjtVFQOxdoy4eKNMP0lY51tWY9TGMiNGsi28JlyI4CspmGdlVe/AjX8HCMr80dzKEn1CGO0wineerufagzaAFoMyIZ06dCyX+c7ZeKE5f0/Luh1q3ScD3GWGMBBgnkdTLiEoBfHHvuquV3jA6d+f1VMXcfrOstjIJj6EnwuAhzk5b0722iiq/kjNDnrLinYf+PAXhBS20zcsW7EdNLCj3QGXUS8HdaNGUvfWYMSY3+hdrZv9/a2njn474YGJZB7lVDN8HqXw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=SGGtTjVK0HroQQ7REw9R4Cm1hHoPV9/JA9udfoyH+FM=; b=R4N1BQLw0vO+wS92xPrPC9cSv8xEmQtwNHUsBBaeVHuyVAsdy34QrXRPCuDnfoplz4T9OZv0A7cA3MEzyzGHlHOOFsRYsGOC62XqFJ9oHU5UQB0xgLCBwkEMbY4LRAWkUnv4O0Qylp3Afte5hcfEm7FikChq+T4SAhiQuQNPUGL1B4hkWAmG2mgGTlZhBXaGf1KLFMa3UmM7B/SpbUUuIf4FQfVBFrLSunBiNdFx8KdcsA0K5Epg52LDv+eO17cOOUtX79THbJz2BcRbwxeHim0Wa1tQrWkeNAeJsjYYz8lsCG95C88gkLD6r0rVQywbE+6PLrq9IaWiRnw65FtXDw== Received: from MW3PR06CA0005.namprd06.prod.outlook.com (2603:10b6:303:2a::10) by SA1PR12MB6727.namprd12.prod.outlook.com (2603:10b6:806:256::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.34; Tue, 17 Oct 2023 07:03:06 +0000 Received: from MWH0EPF000989E8.namprd02.prod.outlook.com (2603:10b6:303:2a:cafe::63) by MW3PR06CA0005.outlook.office365.com (2603:10b6:303:2a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.34 via Frontend Transport; Tue, 17 Oct 2023 07:03:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by MWH0EPF000989E8.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.21 via Frontend Transport; Tue, 17 Oct 2023 07:03:06 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 17 Oct 2023 00:02:48 -0700 Received: from dev-r-vrt-156.mtr.labs.mlnx (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 17 Oct 2023 00:02:46 -0700 From: Amit Cohen To: CC: , , , , , Amit Cohen Subject: [PATCH iproute2-next 2/8] bridge: fdb: support match on source VNI in flush command Date: Tue, 17 Oct 2023 10:02:21 +0300 Message-ID: <20231017070227.3560105-3-amcohen@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017070227.3560105-1-amcohen@nvidia.com> References: <20231017070227.3560105-1-amcohen@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E8:EE_|SA1PR12MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: 44ceb8eb-4331-4462-181c-08dbcedf1d19 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TyG7ITKhWrj88tNGxcruOQEYjsnTieEQeqqS7v31VcAH5fK0qksmCQMJnpWg7d/O+lz/JX++AU09GMwpwxlAqcmwo7gZWLNUvLVvarh7ZMieZRRcRe55Tml6TV7E0FFNgoTlZDW7SVtjXx/NDKmGbZies2aeJIzTuwPe9pLFSpShjKxmm9qbW79T+/4RZ8ZReeHIV4dZNlp05Des0VuhONzHM0qAZTQ4MPuDlVerJBrUWDVPMN2LIBEV+h1nQkYlxUdEESyuIplrgf0LdoGrAEC/gsMAyE5KLrl1RcC1V2tYIHqOhdych0BRfhGDRmdBXDS+V+Hi5c5ag1N5hDoTtHg57X3mQ2Rsq6n7V8ccx0WZNmtiunXr7bItflLvyAQ1KqIiOPQ7GKqaKQtiiLTGxOG5J49ag/EeDQGstS/rzZUSmTAQ5EtvX+TCD1hOIEJL8KMzpoLBEOP/vII6fxx+CWkA15zkDVGg01UUsl9mVJ/85if2VlNwjs+Kw5DsPi+6nPfErL0/PXZj7US280ru/KsOjCz/exl5oWauJ1fBaTJgGiZ1zE2rIZ0FAW0mz/+E/Eb5Qkg74Fks9/vDVKVa8RIz0uLlcf2dcZjfZnk+rgqAh5AjAf9tB9ygrb7ln8klXgCilvDzdesdXC1DJ3xUy+a0VO1u/DOC4zpQmgzoTTkThld0N9ilMDldjYLPEDsYMzkTsBnpLvpznATd4YsA3LdOEC5T4Od+MmMj8bsT4xM= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(136003)(39860400002)(396003)(376002)(346002)(230922051799003)(186009)(64100799003)(82310400011)(1800799009)(451199024)(46966006)(40470700004)(36840700001)(40460700003)(70586007)(6916009)(316002)(70206006)(1076003)(54906003)(16526019)(40480700001)(36756003)(426003)(83380400001)(356005)(82740400003)(7636003)(47076005)(86362001)(36860700001)(2616005)(107886003)(478600001)(6666004)(336012)(41300700001)(5660300002)(26005)(2906002)(8676002)(4326008)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 07:03:06.2707 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 44ceb8eb-4331-4462-181c-08dbcedf1d19 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000989E8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6727 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_BLOCKED,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 X-Patchwork-Delegate: dsahern@gmail.com Extend "fdb flush" command to match fdb entries with a specific source VNI. Example: $ bridge fdb flush dev vx10 src_vni 1000 This will flush all fdb entries pointing to vx10 with source VNI 1000. Signed-off-by: Amit Cohen Acked-by: Nikolay Aleksandrov --- bridge/fdb.c | 12 +++++++++++- man/man8/bridge.8 | 8 ++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/bridge/fdb.c b/bridge/fdb.c index e01e14f1..12d19f08 100644 --- a/bridge/fdb.c +++ b/bridge/fdb.c @@ -45,7 +45,7 @@ static void usage(void) " [ state STATE ] [ dynamic ] ]\n" " bridge fdb get [ to ] LLADDR [ br BRDEV ] { brport | dev } DEV\n" " [ vlan VID ] [ vni VNI ] [ self ] [ master ] [ dynamic ]\n" - " bridge fdb flush dev DEV [ brport DEV ] [ vlan VID ]\n" + " bridge fdb flush dev DEV [ brport DEV ] [ vlan VID ] [ src_vni VNI ]\n" " [ self ] [ master ] [ [no]permanent | [no]static | [no]dynamic ]\n" " [ [no]added_by_user ] [ [no]extern_learn ] [ [no]sticky ]\n" " [ [no]offloaded ]\n"); @@ -700,6 +700,8 @@ static int fdb_flush(int argc, char **argv) char *d = NULL, *brport = NULL; unsigned short ndm_flags = 0; unsigned short ndm_state = 0; + unsigned long src_vni = ~0; + char *endptr; while (argc > 0) { if (strcmp(*argv, "dev") == 0) { @@ -761,6 +763,12 @@ static int fdb_flush(int argc, char **argv) duparg2("vlan", *argv); NEXT_ARG(); vid = atoi(*argv); + } else if (strcmp(*argv, "src_vni") == 0) { + NEXT_ARG(); + src_vni = strtoul(*argv, &endptr, 0); + if ((endptr && *endptr) || + (src_vni >> 24) || src_vni == ULONG_MAX) + invarg("invalid src VNI\n", *argv); } else if (strcmp(*argv, "help") == 0) { NEXT_ARG(); } else { @@ -807,6 +815,8 @@ static int fdb_flush(int argc, char **argv) addattr32(&req.n, sizeof(req), NDA_IFINDEX, brport_ifidx); if (vid > -1) addattr16(&req.n, sizeof(req), NDA_VLAN, vid); + if (src_vni != ~0) + addattr32(&req.n, sizeof(req), NDA_SRC_VNI, src_vni); if (ndm_flags_mask) addattr8(&req.n, sizeof(req), NDA_NDM_FLAGS_MASK, ndm_flags_mask); diff --git a/man/man8/bridge.8 b/man/man8/bridge.8 index c52c9331..b1e96327 100644 --- a/man/man8/bridge.8 +++ b/man/man8/bridge.8 @@ -128,6 +128,8 @@ bridge \- show / manipulate bridge addresses and devices .IR DEV " ] [ " .B vlan .IR VID " ] [ " +.B src_vni +.IR VNI " ] [ " .BR self " ] [ " master " ] [ " .BR [no]permanent " | " [no]static " | " [no]dynamic " ] [ " .BR [no]added_by_user " ] [ " [no]extern_learn " ] [ " @@ -892,6 +894,12 @@ specified by this option will override the one specified by dev above. the target VLAN ID for the operation. Match forwarding table entries only with the specified VLAN ID. +.TP +.BI src_vni " VNI" +the src VNI Network Identifier (or VXLAN Segment ID) for the operation. Match +forwarding table entries only with the specified VNI. Valid if the referenced +device is a VXLAN type device. + .TP .B self the operation is fulfilled directly by the driver for the specified network From patchwork Tue Oct 17 07:02:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Cohen X-Patchwork-Id: 13424656 X-Patchwork-Delegate: dsahern@gmail.com Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 847FA168B3 for ; Tue, 17 Oct 2023 07:03:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="rVE/w7jk" Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2076.outbound.protection.outlook.com [40.107.100.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F06DF93 for ; Tue, 17 Oct 2023 00:03:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jfaqim0zeDjnvf1zI6oJkD9ug/69d5j/5KSoYN246f7gCbdTWZgRIvYcCori9jlvlH3R7d/4auHByRZxFMaEVKQ3Cdh0K9d8e1+4wZXsLa1jvw/5g3Gt09up2yVfX1/jLoyOtZlsbUuwEftlL5Df8DH+dTC0odqAIxI3i/GckoSc1BHQwWVUVcIDvXWfSVlgnzuL84SRDdRJ+OyIzS0AIbqQjLi1VFA1vwV4z2TLx18BQWnwCeSv8UXmGfr0yBqcT4wn22jt8Cn1NJ0lR0EctY8+wduoWV833eL2vsWgWurHlDF8DNTWczhPvZ0MyUn3ggXAn8o4GWhpZ9P1mvMqSA== 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=GqSCRspfjOPG4gm2hXILvLYYcEZc3Gbi/mY54Wut7NI=; b=kw60+xJ+QNb7jRWWimuXH67XgAMHkLAriY9CdL86rAgzCz+B2Avl2Ci54MMNjtnhWhHozZg3cZ+pW+P1eyl2Fbv8ZavRmWDiYE6TM3QgQ0/VDWB5CaOTGpL4HiuO7FNXCbjDUYQsTe57fRJQV5gwJAQSxwq9Bf+sXBPug9MwZHeIajAKGVedZUAhT/iMt+lhBdGCqeHQ2RF6YfLx+dVdr9bMk1utFB9y2xiqDSkxcULwTavtnxp1rCa9U5TShIQpswzcpnQjijKpbn/7nL+xM94azwBUL64Y5UoyJTZes/V3IsnY6scd5TuLbcm/LvTr27iGXIDV7CaW8H/CIw6OaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=GqSCRspfjOPG4gm2hXILvLYYcEZc3Gbi/mY54Wut7NI=; b=rVE/w7jk9f2AhQh3SskgotLgGuXH+knPBrr4yFGZmsK41p9/x+rJiI6sQx7TWtSTgvwfpS4pcaU8AQmR0M3AarNz4IYpm4GITM+lJ5CwtN+p907pqWR1FK+Pukwwd1KFSvTpMly6B/jJKwxu2+XywwSoGv0Jxt/ByLlY3TvpAg/roAOBX1zQSc+2MaVjPZpKs3slbJ1cKPphLqlBdRCkPlGnVRaPu4qfetAz0NIz9W59FE4pftKjjw4J+TMEmerB8M8c1ADfrRDBdtxpUzV1BikFmyHBQL7Or1kze/H5RANKd+vrNKCllcFKzh7qTTDcG6PHo2EMYR6R7txfuo3vcA== Received: from CY5PR19CA0055.namprd19.prod.outlook.com (2603:10b6:930:1a::32) by CY5PR12MB6275.namprd12.prod.outlook.com (2603:10b6:930:20::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35; Tue, 17 Oct 2023 07:03:06 +0000 Received: from CY4PEPF0000E9CE.namprd03.prod.outlook.com (2603:10b6:930:1a:cafe::e8) by CY5PR19CA0055.outlook.office365.com (2603:10b6:930:1a::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35 via Frontend Transport; Tue, 17 Oct 2023 07:03:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CY4PEPF0000E9CE.mail.protection.outlook.com (10.167.241.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.22 via Frontend Transport; Tue, 17 Oct 2023 07:03:06 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 17 Oct 2023 00:02:51 -0700 Received: from dev-r-vrt-156.mtr.labs.mlnx (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 17 Oct 2023 00:02:48 -0700 From: Amit Cohen To: CC: , , , , , Amit Cohen Subject: [PATCH iproute2-next 3/8] bridge: fdb: support match on nexthop ID in flush command Date: Tue, 17 Oct 2023 10:02:22 +0300 Message-ID: <20231017070227.3560105-4-amcohen@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017070227.3560105-1-amcohen@nvidia.com> References: <20231017070227.3560105-1-amcohen@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9CE:EE_|CY5PR12MB6275:EE_ X-MS-Office365-Filtering-Correlation-Id: ad015f13-fb02-41f4-53e1-08dbcedf1ceb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pErAbVaod6klHuJlWY/haK+4WDvniJgH9qrtrxhTfsGovvsWUNP2SIRiWiHlVbyaEfQuKwmgvfVk7mbtkElfg3tRXGre4Ep8hlKacYuC3q8Ibca8X72lZts3hNLgAAzTTjmwBKRX148iflIybI0NElGx4mCTFBb1wnjawrLx7tDIBGuaUL807Vaa20M/RJsHedTQlmIi0ajglRdC1eFBZ3y3RCBQHEzexEXe0R2/fKGzspQ/ddy6BB9y0AqbtGM6/9/HKxwTDKw9djdFFRyp6j6s+nMemZ3yxI3vcRWozRDGHVdlUIa2wNP2+kJejcKjWDuK7DHrY36/ZCmSqYWLhDmJDuqxhr1cUa6OHu3oj8DcnvUXNzzXMqAVo3e3aM8FilpvrY3jjjczA01b4GClaytZ1YRguaGzCZMIRM65wvPTagHzcvQ4sU4JBEjNGLLT9gNMttls5xcKXx11n3u7dIziMSLPD1mChZiVfyWypYQ+h87X2GL0XoOA/tGVa4CaLNlSeAqQFq7xwGeRqfay/Z+CazbtBv0VmVxUQQ3GiMEXYFPk1UaLubDzG9YoI6V6bbjbNnW/XH4bE4HlTXA542Qol6Hd7pkvZ4oKlUtyAstWjLfYW5z7QxrivVIouublXkHs+pPGxG8QaYtla9clPuV5RBTIrRAJCyqnm05ylFEh65akR988HoNR2NY/Nsb8aTtJejXz1vs1QJNuoDI99dycQqmAtq8Y16VVhOuRjfdAByAaAvqc5KiG9zgqztGS X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(396003)(39860400002)(136003)(346002)(376002)(230922051799003)(1800799009)(451199024)(82310400011)(64100799003)(186009)(36840700001)(46966006)(40470700004)(40480700001)(5660300002)(6666004)(40460700003)(2906002)(26005)(36756003)(36860700001)(2616005)(426003)(107886003)(336012)(16526019)(83380400001)(7636003)(86362001)(47076005)(356005)(82740400003)(478600001)(1076003)(41300700001)(6916009)(316002)(54906003)(70586007)(70206006)(4326008)(8676002)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 07:03:06.0176 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ad015f13-fb02-41f4-53e1-08dbcedf1ceb X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9CE.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6275 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_BLOCKED,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 X-Patchwork-Delegate: dsahern@gmail.com Extend "fdb flush" command to match fdb entries with a specific nexthop ID. Example: $ bridge fdb flush dev vx10 nhid 2 This will flush all fdb entries pointing to vx10 with nexthop ID 2. Signed-off-by: Amit Cohen --- bridge/fdb.c | 10 +++++++++- man/man8/bridge.8 | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/bridge/fdb.c b/bridge/fdb.c index 12d19f08..6ae1011a 100644 --- a/bridge/fdb.c +++ b/bridge/fdb.c @@ -46,7 +46,8 @@ static void usage(void) " bridge fdb get [ to ] LLADDR [ br BRDEV ] { brport | dev } DEV\n" " [ vlan VID ] [ vni VNI ] [ self ] [ master ] [ dynamic ]\n" " bridge fdb flush dev DEV [ brport DEV ] [ vlan VID ] [ src_vni VNI ]\n" - " [ self ] [ master ] [ [no]permanent | [no]static | [no]dynamic ]\n" + " [ nhid NHID ] [ self ] [ master ]\n" + " [ [no]permanent | [no]static | [no]dynamic ]\n" " [ [no]added_by_user ] [ [no]extern_learn ] [ [no]sticky ]\n" " [ [no]offloaded ]\n"); exit(-1); @@ -701,6 +702,7 @@ static int fdb_flush(int argc, char **argv) unsigned short ndm_flags = 0; unsigned short ndm_state = 0; unsigned long src_vni = ~0; + __u32 nhid = 0; char *endptr; while (argc > 0) { @@ -769,6 +771,10 @@ static int fdb_flush(int argc, char **argv) if ((endptr && *endptr) || (src_vni >> 24) || src_vni == ULONG_MAX) invarg("invalid src VNI\n", *argv); + } else if (strcmp(*argv, "nhid") == 0) { + NEXT_ARG(); + if (get_u32(&nhid, *argv, 0)) + invarg("\"id\" value is invalid\n", *argv); } else if (strcmp(*argv, "help") == 0) { NEXT_ARG(); } else { @@ -817,6 +823,8 @@ static int fdb_flush(int argc, char **argv) addattr16(&req.n, sizeof(req), NDA_VLAN, vid); if (src_vni != ~0) addattr32(&req.n, sizeof(req), NDA_SRC_VNI, src_vni); + if (nhid > 0) + addattr32(&req.n, sizeof(req), NDA_NH_ID, nhid); if (ndm_flags_mask) addattr8(&req.n, sizeof(req), NDA_NDM_FLAGS_MASK, ndm_flags_mask); diff --git a/man/man8/bridge.8 b/man/man8/bridge.8 index b1e96327..eaeee81b 100644 --- a/man/man8/bridge.8 +++ b/man/man8/bridge.8 @@ -130,6 +130,8 @@ bridge \- show / manipulate bridge addresses and devices .IR VID " ] [ " .B src_vni .IR VNI " ] [ " +.B nhid +.IR NHID " ] [" .BR self " ] [ " master " ] [ " .BR [no]permanent " | " [no]static " | " [no]dynamic " ] [ " .BR [no]added_by_user " ] [ " [no]extern_learn " ] [ " @@ -900,6 +902,11 @@ the src VNI Network Identifier (or VXLAN Segment ID) for the operation. Match forwarding table entries only with the specified VNI. Valid if the referenced device is a VXLAN type device. +.TP +.BI nhid " NHID" +the ecmp nexthop group for the operation. Match forwarding table entries only +with the specified NHID. Valid if the referenced device is a VXLAN type device. + .TP .B self the operation is fulfilled directly by the driver for the specified network From patchwork Tue Oct 17 07:02:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Cohen X-Patchwork-Id: 13424658 X-Patchwork-Delegate: dsahern@gmail.com Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC262179A1 for ; Tue, 17 Oct 2023 07:03:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="HkbmImJW" Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2082.outbound.protection.outlook.com [40.107.223.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CA09B6 for ; Tue, 17 Oct 2023 00:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aNJb3LzbeWKRdjd2GcN/umH+19NdqeKApma2CYyFQUQxaREqXvo+nnv+qWDyPem0MgQSUOymI+ij37T9/lwN4eHDWrrJtl4h//XiY6DOxf9KNU+GMlxsA0bWpAh4LomBvCVH6conHvsryysJfc/nHwcoFE3PFYgRtNwUe1dijTJkBpE1A+LF+Kzh7FredRPK1rMohxCu/TzFiPuPRptsUS15AJx+lHIPzWUy/hcBw0XpseHJmOjkIvhNCn0eMskoqNkzDM6knaIZFSr5Ux+8ritfDmRx1e77Riq6tWuKj40w8pf9uMfiojb7qFeHJW9/Use/TQO/bX7xhe1Jk6z80A== 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=uW4+QHLQvpx9uMZjKglP83W0EYpNN6YlBVoSFK7AbGY=; b=LSo/p81R2ZRuD8XJszpvq1dhkt7mgIMPNUDajcTfqA3QBNlz1Mg68iT9qZ3MDgh9azXrYhftL3dBw5p8RM/9dSdwEMw9oXCRLcI0julUhDyA9VEpc4365L4xizY43XRTkBYfa0BXCQ+VyeLxWpf/k9NwOaCZ5A/alnX6o0mJ1WfwqBjFTsRYGW0CpKg5swTRhtjY7A/KPAkZfaqZCOhvStMcAAbOXG+in7bldmKLmg7JBmxM16V6X6n/jGssEa3WV6MuCaKaNjjcwhNj4fdkKsYLpxxNUNM7WTK8eBrq+OD3UAPdxg4WweJGU6ZzgVPAQH6NjVAYiAmqGixtlcsl2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=uW4+QHLQvpx9uMZjKglP83W0EYpNN6YlBVoSFK7AbGY=; b=HkbmImJWZ/Kha/N3vJyh55bwSyJ2i/Y5YLkiZ2mZY2gmYD3a6+vC2TSzpOlOrtcGmDUNBo5z9jHIwxuB8NBo7SSUq2eXzgKnmvibBGmW6sldvKacOmR3+BOiK0FdDwqatprNdIlqw8f21lU2Jqw/R7lFCWHVFAz5NKI0DxL0YWoZX989yjI7OxzRySZ25vtlKYPWVYaf2wb3jFKSiRLjkMpGvfBVueo9M+EatD2E5mWJSzTccsfgdp6dGerVtJtC3j97dZvIG6y0PIrdUkFepoFMXwma+IYqStT7pSWFRUzCALUJ6NqtE0q3sN+s/xSvry40x9ZtO+2NaHn+YV5IaA== Received: from CY5PR19CA0040.namprd19.prod.outlook.com (2603:10b6:930:1a::31) by SA1PR12MB8860.namprd12.prod.outlook.com (2603:10b6:806:38b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35; Tue, 17 Oct 2023 07:03:07 +0000 Received: from CY4PEPF0000E9CE.namprd03.prod.outlook.com (2603:10b6:930:1a:cafe::20) by CY5PR19CA0040.outlook.office365.com (2603:10b6:930:1a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35 via Frontend Transport; Tue, 17 Oct 2023 07:03:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CY4PEPF0000E9CE.mail.protection.outlook.com (10.167.241.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.22 via Frontend Transport; Tue, 17 Oct 2023 07:03:07 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 17 Oct 2023 00:02:53 -0700 Received: from dev-r-vrt-156.mtr.labs.mlnx (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 17 Oct 2023 00:02:51 -0700 From: Amit Cohen To: CC: , , , , , Amit Cohen Subject: [PATCH iproute2-next 4/8] bridge: fdb: support match on destination VNI in flush command Date: Tue, 17 Oct 2023 10:02:23 +0300 Message-ID: <20231017070227.3560105-5-amcohen@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017070227.3560105-1-amcohen@nvidia.com> References: <20231017070227.3560105-1-amcohen@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9CE:EE_|SA1PR12MB8860:EE_ X-MS-Office365-Filtering-Correlation-Id: 9298a177-99cf-4120-d62b-08dbcedf1d8f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bX9QHuV2quowQnRNgfPqtzilT1TT2aGQPtJtKkys5kq/+2SUwYxaa88AYG2fNv5HVdNNuu5Dm3cvhcVHLdwMdNwJJvA9MW0RvUccIu+WmpYJ8+RkyIo8DUoYC7vbKUH1xJt4mHAy1XUI6u2/LoXYi0uxze3lMwnYKnmAzLABmTy8bUpMzA90asQu7V5J4FteJwOB//VUuxOscCimYy/t0rCQAreNy6z1xDTeLZ1rCO/wNCtA/EMZJaxcAUYpw2xZQO0O1bAWACEWc/DN8fCjGe4+hD3iaZ9vxFEzhKWUZgPSk5BLahdiDwAegTG3drvWz6n/g3vwQ96gKXgePJSu9z//saQhy4SLWNZYyFdshKgVhQ/XYRlyOpmfKihrxLnagqtbUb9P2QnPaZsirDt2icsnDuYGSfYQkI8pn2KxskZSbuj36FruZPfkglrPTX/Ub0TuGyoQ5AJlhxMzVvvGhWau2xlZAlB14pYrm/3KwASmwmIVAqtB+BfaO+09qhxwPUnoQA+VPDifEj4dgsvOP4+dEcYw0hjg6FqTwB3GIcJDATYmnSoLqgiLi4SMMGFPHqPx4KXp2hP6Hov1fjFmpBYHIlNKlLb/RFRN71w5UzHbRkfaaRfKngHH0khXD/GG9slUYLy+7ShLChMa6s4FPr2ykKDFMmI6NZu6jAhZEN1HG3B/CvLLFECARlLOQGWGWsP8VXNK1Ao1UtFv+zXK8rzi/djIY1CnNdcDls85u8bBTndaKm++ZIl8F5rFhOj6 X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(376002)(396003)(346002)(39860400002)(136003)(230922051799003)(64100799003)(1800799009)(82310400011)(186009)(451199024)(40470700004)(36840700001)(46966006)(83380400001)(336012)(26005)(426003)(16526019)(1076003)(8676002)(5660300002)(4326008)(8936002)(107886003)(2616005)(36756003)(40460700003)(86362001)(356005)(7636003)(40480700001)(82740400003)(41300700001)(47076005)(2906002)(316002)(70586007)(54906003)(70206006)(6916009)(6666004)(478600001)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 07:03:07.0958 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9298a177-99cf-4120-d62b-08dbcedf1d8f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9CE.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8860 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 X-Patchwork-Delegate: dsahern@gmail.com Extend "fdb flush" command to match fdb entries with a specific destination VNI. Example: $ bridge fdb flush dev vx10 vni 1000 This will flush all fdb entries pointing to vx10 with destination VNI 1000. Signed-off-by: Amit Cohen Acked-by: Nikolay Aleksandrov --- bridge/fdb.c | 11 ++++++++++- man/man8/bridge.8 | 8 ++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/bridge/fdb.c b/bridge/fdb.c index 6ae1011a..69f0d9e4 100644 --- a/bridge/fdb.c +++ b/bridge/fdb.c @@ -46,7 +46,7 @@ static void usage(void) " bridge fdb get [ to ] LLADDR [ br BRDEV ] { brport | dev } DEV\n" " [ vlan VID ] [ vni VNI ] [ self ] [ master ] [ dynamic ]\n" " bridge fdb flush dev DEV [ brport DEV ] [ vlan VID ] [ src_vni VNI ]\n" - " [ nhid NHID ] [ self ] [ master ]\n" + " [ nhid NHID ] [ vni VNI ] [ self ] [ master ]\n" " [ [no]permanent | [no]static | [no]dynamic ]\n" " [ [no]added_by_user ] [ [no]extern_learn ] [ [no]sticky ]\n" " [ [no]offloaded ]\n"); @@ -702,6 +702,7 @@ static int fdb_flush(int argc, char **argv) unsigned short ndm_flags = 0; unsigned short ndm_state = 0; unsigned long src_vni = ~0; + unsigned long vni = ~0; __u32 nhid = 0; char *endptr; @@ -775,6 +776,12 @@ static int fdb_flush(int argc, char **argv) NEXT_ARG(); if (get_u32(&nhid, *argv, 0)) invarg("\"id\" value is invalid\n", *argv); + } else if (strcmp(*argv, "vni") == 0) { + NEXT_ARG(); + vni = strtoul(*argv, &endptr, 0); + if ((endptr && *endptr) || + (vni >> 24) || vni == ULONG_MAX) + invarg("invalid VNI\n", *argv); } else if (strcmp(*argv, "help") == 0) { NEXT_ARG(); } else { @@ -825,6 +832,8 @@ static int fdb_flush(int argc, char **argv) addattr32(&req.n, sizeof(req), NDA_SRC_VNI, src_vni); if (nhid > 0) addattr32(&req.n, sizeof(req), NDA_NH_ID, nhid); + if (vni != ~0) + addattr32(&req.n, sizeof(req), NDA_VNI, vni); if (ndm_flags_mask) addattr8(&req.n, sizeof(req), NDA_NDM_FLAGS_MASK, ndm_flags_mask); diff --git a/man/man8/bridge.8 b/man/man8/bridge.8 index eaeee81b..b21d9b25 100644 --- a/man/man8/bridge.8 +++ b/man/man8/bridge.8 @@ -132,6 +132,8 @@ bridge \- show / manipulate bridge addresses and devices .IR VNI " ] [ " .B nhid .IR NHID " ] [" +.B vni +.IR VNI " ] [ " .BR self " ] [ " master " ] [ " .BR [no]permanent " | " [no]static " | " [no]dynamic " ] [ " .BR [no]added_by_user " ] [ " [no]extern_learn " ] [ " @@ -907,6 +909,12 @@ device is a VXLAN type device. the ecmp nexthop group for the operation. Match forwarding table entries only with the specified NHID. Valid if the referenced device is a VXLAN type device. +.TP +.BI vni " VNI" +the VXLAN VNI Network Identifier (or VXLAN Segment ID) for the operation. Match +forwarding table entries only with the specified VNI. Valid if the referenced +device is a VXLAN type device. + .TP .B self the operation is fulfilled directly by the driver for the specified network From patchwork Tue Oct 17 07:02:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Cohen X-Patchwork-Id: 13424659 X-Patchwork-Delegate: dsahern@gmail.com Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 465F9182DC for ; Tue, 17 Oct 2023 07:03:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="Qh8o76O1" Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2043.outbound.protection.outlook.com [40.107.92.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C203AB for ; Tue, 17 Oct 2023 00:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mXdm2zUL5dtlAPz5DcXAis02egsD3G7C0vhLpb57Ow2unBX8kso/pvldjVK61/25hkulPM4Un6CGVK7SlzOih1lTj4qLQ0IAnxuA/rp88M677aL9UoBM12em6T4eJXuDxrm9LbMUE5JEem/sAtnmCTmwS/F+5hjdFI/sV6TRV0v6vBg+ZP05NdD4ylo9KiKFylA2HrjyQ1B3nhCNUv/dHPkAps1GvJb+aRzFWKebK99O/iYA+eoZ5/VbzqGid/AZLfNWiL4E0e0BPANcmWHXVLvQzeMWR6iN8reniaYbdoNCkOhgfKfHTcsPPDPAQ5E64c9GaSaelvltrNz3nETSwA== 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=YpGv+CP7ih4+MvNZAQ8CtQOcujNTjqOQzTfoVu2SXNU=; b=YZ4Xr7l3janlKxPnIWEW3DdbZlg1+A2aKD9awgX2v8WrvxjZ2bJE1eIDZy1TFj/imqqq3CTAI5tfBU9txnRYTPZsFxAfhA5fmrnx3hk0V0idefDxQF55xud2yNeERrGGfej/Vtk7i6DSHc5Bb7wobfWv94xHxTRSap1VbG/FjEUVDfczM4Hnzk6YN7EAxSJcc9uKSLBskrB7XCYhHUDRv3KXdGtAgBiGgQvF21pnPCupBWT2qSdDjWXqEpagVPCHfG2ddXiBtn7jenQ8w0Vzm+HI/cMKf1gxKOVnEOWIXQgEKrhnKlU8GME+tKYiV7H5t9pbdgmX3/u2FhefbAIdLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=YpGv+CP7ih4+MvNZAQ8CtQOcujNTjqOQzTfoVu2SXNU=; b=Qh8o76O1ED1TLiVqcM2sKKk6PBYH5COjqLFh8NR/8ZGP1AVgHV6bpFYSHn1mGgjcMLD7i0J/Hkj+AePo0wK2mmUe4cE5tET8Sv1Yn1DYO06RCiHfVAkRm5nnhP9W6cR0r4TZnIHZWch3/Dyio2VZxVrq/wcNHr+QYGlXJtc5abXrwar3/4eED8FYP1c8EBX74Jl1Uk5MW+p4Sh/0sSFihsAaT2dhMCO28mRg95p14bF5sAeWycAfJFWTpG4DmcU/IoJU6JEZuuT7rtzKIRX2dLvXpIsPWWmQ97pHTFHTM4KTYCRE+XXKDRk9YKqmeS3k4jMQXr5ZTsRmzDoZy4pLSQ== Received: from CYXPR03CA0073.namprd03.prod.outlook.com (2603:10b6:930:d3::23) by PH7PR12MB5830.namprd12.prod.outlook.com (2603:10b6:510:1d5::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35; Tue, 17 Oct 2023 07:03:09 +0000 Received: from CY4PEPF0000E9D4.namprd03.prod.outlook.com (2603:10b6:930:d3:cafe::95) by CYXPR03CA0073.outlook.office365.com (2603:10b6:930:d3::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36 via Frontend Transport; Tue, 17 Oct 2023 07:03:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CY4PEPF0000E9D4.mail.protection.outlook.com (10.167.241.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.22 via Frontend Transport; Tue, 17 Oct 2023 07:03:08 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 17 Oct 2023 00:02:56 -0700 Received: from dev-r-vrt-156.mtr.labs.mlnx (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 17 Oct 2023 00:02:53 -0700 From: Amit Cohen To: CC: , , , , , Amit Cohen Subject: [PATCH iproute2-next 5/8] bridge: fdb: support match on destination port in flush command Date: Tue, 17 Oct 2023 10:02:24 +0300 Message-ID: <20231017070227.3560105-6-amcohen@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017070227.3560105-1-amcohen@nvidia.com> References: <20231017070227.3560105-1-amcohen@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D4:EE_|PH7PR12MB5830:EE_ X-MS-Office365-Filtering-Correlation-Id: 84789046-e54c-43ad-a92e-08dbcedf1e8f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q/NhF7W+THjxRqGGPp2MA23sxK5joNruI3KtSMORqXODx+AJKQkzZ9z+j2Stm1P6omLVmHduWIBEpE8FfOqymGeMlCa5eNzdpP5yP5Am+276v7S3k+2w5tPHaT55omDkOZvW/vS39eccLY0uHCXD2mbuiYOBYhGh2PWYsvQR/44YoKTq8m/fl50GnF9KPCM7LMkcCZ62PBr69P2aPce74omXuX3nxIVzTMgnikQsZJlpzYYVwiLTlNu8I3HCINezaCj7Unr6Rip7H/hIFbONEvojAXDLQ/iaPBAboSd6420x9CImxcsziTP8fwpIQ93y4vp/dcgRmJY/Nq32Van3u6MTPzeJmty2JTUmxTUujDvY9VVGSwVDLvfvw/TVEb9L6OQCZQ7Y68FYzd198THtTGlKL/jMgYaCwHXSk9tlHAwdZeMwrjP6wOIOf2lFlsCPxdy+oxP3EY81fvMisKCN0vOzdx7gq9cEFo35CXAlaEvEzgATHAwxXNvaAJ9k8lmFF/xjlE358Wlys5Llp8frUrW4zJ0HQaiZnUw156Ki3Ov5AVBi3AtTn+0KOlRCijIyQzVRbupIGl6UXGqNQs9ZRZ69yKSaVk/qhd5m39CKf9i/Q6uwfDvrZInbo1Ghwy4eKhtBSLSVMm/z+jHLZCCd7h5ns4QLoZKx/XqHd8Z8BJetK4ivXo030JeNm7itT2t+ZuO8LWAW0xBRGqAOnp3M68/mgucBfVRaB+BTBqp+tAA= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(136003)(346002)(376002)(39860400002)(396003)(230922051799003)(82310400011)(1800799009)(64100799003)(451199024)(186009)(36840700001)(40470700004)(46966006)(36860700001)(47076005)(40480700001)(7636003)(356005)(82740400003)(478600001)(2906002)(54906003)(70586007)(316002)(70206006)(6666004)(6916009)(8936002)(5660300002)(41300700001)(4326008)(8676002)(2616005)(107886003)(83380400001)(336012)(426003)(1076003)(26005)(16526019)(40460700003)(36756003)(86362001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 07:03:08.7723 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 84789046-e54c-43ad-a92e-08dbcedf1e8f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9D4.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5830 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_BLOCKED,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 X-Patchwork-Delegate: dsahern@gmail.com Extend "fdb flush" command to match fdb entries with a specific destination port. Example: $ bridge fdb flush dev vx10 port 1111 This will flush all fdb entries pointing to vx10 with destination port 1111. Signed-off-by: Amit Cohen Acked-by: Nikolay Aleksandrov --- bridge/fdb.c | 21 ++++++++++++++++++++- man/man8/bridge.8 | 8 ++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/bridge/fdb.c b/bridge/fdb.c index 69f0d9e4..d9665bd5 100644 --- a/bridge/fdb.c +++ b/bridge/fdb.c @@ -46,7 +46,7 @@ static void usage(void) " bridge fdb get [ to ] LLADDR [ br BRDEV ] { brport | dev } DEV\n" " [ vlan VID ] [ vni VNI ] [ self ] [ master ] [ dynamic ]\n" " bridge fdb flush dev DEV [ brport DEV ] [ vlan VID ] [ src_vni VNI ]\n" - " [ nhid NHID ] [ vni VNI ] [ self ] [ master ]\n" + " [ nhid NHID ] [ vni VNI ] [ port PORT ] [ self ] [ master ]\n" " [ [no]permanent | [no]static | [no]dynamic ]\n" " [ [no]added_by_user ] [ [no]extern_learn ] [ [no]sticky ]\n" " [ [no]offloaded ]\n"); @@ -703,6 +703,7 @@ static int fdb_flush(int argc, char **argv) unsigned short ndm_state = 0; unsigned long src_vni = ~0; unsigned long vni = ~0; + unsigned long port = 0; __u32 nhid = 0; char *endptr; @@ -782,6 +783,18 @@ static int fdb_flush(int argc, char **argv) if ((endptr && *endptr) || (vni >> 24) || vni == ULONG_MAX) invarg("invalid VNI\n", *argv); + } else if (strcmp(*argv, "port") == 0) { + NEXT_ARG(); + port = strtoul(*argv, &endptr, 0); + if (endptr && *endptr) { + struct servent *pse; + + pse = getservbyname(*argv, "udp"); + if (!pse) + invarg("invalid port\n", *argv); + port = ntohs(pse->s_port); + } else if (port > 0xffff) + invarg("invalid port\n", *argv); } else if (strcmp(*argv, "help") == 0) { NEXT_ARG(); } else { @@ -834,6 +847,12 @@ static int fdb_flush(int argc, char **argv) addattr32(&req.n, sizeof(req), NDA_NH_ID, nhid); if (vni != ~0) addattr32(&req.n, sizeof(req), NDA_VNI, vni); + if (port) { + unsigned short dport; + + dport = htons((unsigned short)port); + addattr16(&req.n, sizeof(req), NDA_PORT, dport); + } if (ndm_flags_mask) addattr8(&req.n, sizeof(req), NDA_NDM_FLAGS_MASK, ndm_flags_mask); diff --git a/man/man8/bridge.8 b/man/man8/bridge.8 index b21d9b25..4255364d 100644 --- a/man/man8/bridge.8 +++ b/man/man8/bridge.8 @@ -134,6 +134,8 @@ bridge \- show / manipulate bridge addresses and devices .IR NHID " ] [" .B vni .IR VNI " ] [ " +.B port +.IR PORT " ] [" .BR self " ] [ " master " ] [ " .BR [no]permanent " | " [no]static " | " [no]dynamic " ] [ " .BR [no]added_by_user " ] [ " [no]extern_learn " ] [ " @@ -915,6 +917,12 @@ the VXLAN VNI Network Identifier (or VXLAN Segment ID) for the operation. Match forwarding table entries only with the specified VNI. Valid if the referenced device is a VXLAN type device. +.TP +.BI port " PORT" +the UDP destination PORT number for the operation. Match forwarding table +entries only with the specified PORT. Valid if the referenced device is a VXLAN +type device. + .TP .B self the operation is fulfilled directly by the driver for the specified network From patchwork Tue Oct 17 07:02:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Cohen X-Patchwork-Id: 13424661 X-Patchwork-Delegate: dsahern@gmail.com Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57A0E168A9 for ; Tue, 17 Oct 2023 07:03:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="ARw6wgP/" Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2078.outbound.protection.outlook.com [40.107.220.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 607729F for ; Tue, 17 Oct 2023 00:03:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cFqz2+MewbU9xu7UQsBQOKgA0Y2ZsTlxQM/nNKSWOxJaNp77DTYEgcH2kKBeqfzhFfdPSUD6RaBAdrlyfF6fJeF18FB1SfnWmqFCmF4V4QTbvdX6ffTf/U+ZIfXP5ff8RlCDWkk8Tg8TSyKDC5jowsR8oFh9CFAS/wLC9dE5uBtXjwCDiNPlpapgN7TwOWLCNkoyOPBA1smBa/pDdYWEqbFP+PYxS8kgLkw3hTqg+lFB6SGKF94an2dGSxWogEpVSbMHKML1q/MO8bqmItZSrXfCyBZwir81BcXo+rN9rTbwamTuYZiCC6S5pPAbNwtWJETtsS3q/T+gs/MM0NSpDg== 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=GJeSRFMCy2J9nrxU0qcnoKIvYZz0a+JmtGAGourmjBw=; b=iLRWik55NNE008/znzMLKLRLSyFERoyJ6prAiGMaDzCkMbDkGLCwznczrgEZpx9zcqKV/TXSrybz4K2PB1YbBBmOD6j3GLOBlt4LDGdjTXQCo3DXqoVMElQVnmKoP9LXEEHt4HFavBT33vLg5t1pigiZiyt/1+69V+gR27+mRH9/kwZv8cvS9h7f3X4itoES4U2AkZA38id0sX7p8L3+w11NZ8E9kq7fWU9+YtEqI0FP/q0/YkoJo++7ixl3Q42x8eayS+B82MfpgxNv2i/91QEealBSnZpoweSG/SmJVfKNsdbiBE1QM97l98qTsFet1Ew/PcT+bGeYc4/NcfBBfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=GJeSRFMCy2J9nrxU0qcnoKIvYZz0a+JmtGAGourmjBw=; b=ARw6wgP/+2mDrtiEJ7LCRFFIswdAV1p+Zt5TGvb/xeAgFUk3t6Sq1EW4Vhra6f8ovCMKbkT0uloJMqwu+0+OOl8Qe6HdVjXWDnDNjXudPHbk4WPC3YCTPiOOTaZlRWh3/G8zJZldICahzXfjR3rNhr9amc1TYZ0j8lW4oTDsy89G+5MhkFHlkegOnikdNQsy1ZC/WXYhzQMOslrYRkHs73d038HSEuVIg9D/vA1hB0aBLgfiyvEiTWn0Spa6lV9p279gWxMbKr/20+3xeYIjWfiB4ATRr8oOWrRWlrfgcCWmy4h+iePFS0jv/MolUB2eGsg5ykEIFXMdSch0oZ7ocQ== Received: from MW3PR06CA0024.namprd06.prod.outlook.com (2603:10b6:303:2a::29) by SA1PR12MB6800.namprd12.prod.outlook.com (2603:10b6:806:25c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.34; Tue, 17 Oct 2023 07:03:13 +0000 Received: from MWH0EPF000989E8.namprd02.prod.outlook.com (2603:10b6:303:2a:cafe::b8) by MW3PR06CA0024.outlook.office365.com (2603:10b6:303:2a::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.34 via Frontend Transport; Tue, 17 Oct 2023 07:03:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by MWH0EPF000989E8.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.21 via Frontend Transport; Tue, 17 Oct 2023 07:03:12 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 17 Oct 2023 00:02:58 -0700 Received: from dev-r-vrt-156.mtr.labs.mlnx (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 17 Oct 2023 00:02:56 -0700 From: Amit Cohen To: CC: , , , , , Amit Cohen Subject: [PATCH iproute2-next 6/8] bridge: fdb: support match on destination IP in flush command Date: Tue, 17 Oct 2023 10:02:25 +0300 Message-ID: <20231017070227.3560105-7-amcohen@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017070227.3560105-1-amcohen@nvidia.com> References: <20231017070227.3560105-1-amcohen@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E8:EE_|SA1PR12MB6800:EE_ X-MS-Office365-Filtering-Correlation-Id: 2ba1a221-8e40-4db5-fcc7-08dbcedf210b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MVeVbmHQ+e/wZwzp0rd1jv7FYOWu9iKW0cc8KfPKf7IcsspxKNUIU2rFbqK2Nrzi58PTm/9nBtPDvj05iNxlp6Ss8YYrMTuottBuN+yA/NHTMXI10s5XnHwGzUn0uQgqSuVACwkBlSif7y/+azCdo+hqUT7RNfU0GLVNrBcBYHJNZnuFhtWa7rxmsYy5Vs4unOq/BqaXsDHgOvOQHHXEiqJH+kyI7XSvOFRWBcZD48VP82ptisHK7NBe7pFx/qspe4/tEj0nwDM2Z2eTZDtk1YQSbKFonb2fIpNIkP/YWCJwI0VRAQplrrX5Xrik5CQf1WBBTiQKEG/eD6it4MGP/VXFxeqWoo7B2YmsjHNof2oK0jpxiph/8a7P4ST2oTeWblGDtooRoprCzV0w0MmwbsFVZQrso5ixhC/SEwSjFJAonBEsQ4vFsPow/n76suXPcHDYNLLmXYZcNdtxDSI5PTX95q+UrwkPxJMbDAWT3AU2PDp5G0N5IYc3jTgRULa6dYD+gS1uZlDJA+WWx3ouDmx9aUg8R60SSfbxcNDwtE5xb71q4jYkSOCVdv04EkhB62KNRg6IoGKPBRhunlyrua8okckzzuHv2voF6v/xA1q2hRbDdUY5mIhoNk/Uva0PFQR3fXGvEWrtYwKPcMaIAESfRSk2Abjyis/27UcP0Xst1uEMG9DHqdus0l4Lm40xxlwXBiI2pHrQr5WakOxvEdycuMokod0ZvzTsosmL3II= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(346002)(136003)(396003)(376002)(39860400002)(230922051799003)(64100799003)(1800799009)(186009)(82310400011)(451199024)(40470700004)(46966006)(36840700001)(47076005)(6666004)(83380400001)(36860700001)(336012)(426003)(16526019)(26005)(82740400003)(40460700003)(107886003)(40480700001)(2906002)(5660300002)(8936002)(86362001)(6916009)(8676002)(4326008)(316002)(54906003)(70586007)(70206006)(41300700001)(36756003)(7636003)(2616005)(356005)(478600001)(1076003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 07:03:12.8800 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ba1a221-8e40-4db5-fcc7-08dbcedf210b X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000989E8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6800 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_BLOCKED,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 X-Patchwork-Delegate: dsahern@gmail.com Extend "fdb flush" command to match fdb entries with a specific destination IP. Example: $ bridge fdb flush dev vx10 dst 192.1.1.1 This will flush all fdb entries pointing to vx10 with destination IP 192.1.1.1 Signed-off-by: Amit Cohen Acked-by: Nikolay Aleksandrov --- bridge/fdb.c | 14 ++++++++++++-- man/man8/bridge.8 | 8 ++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/bridge/fdb.c b/bridge/fdb.c index d9665bd5..35100e68 100644 --- a/bridge/fdb.c +++ b/bridge/fdb.c @@ -46,8 +46,8 @@ static void usage(void) " bridge fdb get [ to ] LLADDR [ br BRDEV ] { brport | dev } DEV\n" " [ vlan VID ] [ vni VNI ] [ self ] [ master ] [ dynamic ]\n" " bridge fdb flush dev DEV [ brport DEV ] [ vlan VID ] [ src_vni VNI ]\n" - " [ nhid NHID ] [ vni VNI ] [ port PORT ] [ self ] [ master ]\n" - " [ [no]permanent | [no]static | [no]dynamic ]\n" + " [ nhid NHID ] [ vni VNI ] [ port PORT ] [ dst IPADDR ] [ self ]\n" + " [ master ] [ [no]permanent | [no]static | [no]dynamic ]\n" " [ [no]added_by_user ] [ [no]extern_learn ] [ [no]sticky ]\n" " [ [no]offloaded ]\n"); exit(-1); @@ -704,6 +704,8 @@ static int fdb_flush(int argc, char **argv) unsigned long src_vni = ~0; unsigned long vni = ~0; unsigned long port = 0; + inet_prefix dst; + int dst_ok = 0; __u32 nhid = 0; char *endptr; @@ -795,6 +797,12 @@ static int fdb_flush(int argc, char **argv) port = ntohs(pse->s_port); } else if (port > 0xffff) invarg("invalid port\n", *argv); + } else if (strcmp(*argv, "dst") == 0) { + NEXT_ARG(); + if (dst_ok) + duparg2("dst", *argv); + get_addr(&dst, *argv, preferred_family); + dst_ok = 1; } else if (strcmp(*argv, "help") == 0) { NEXT_ARG(); } else { @@ -853,6 +861,8 @@ static int fdb_flush(int argc, char **argv) dport = htons((unsigned short)port); addattr16(&req.n, sizeof(req), NDA_PORT, dport); } + if (dst_ok) + addattr_l(&req.n, sizeof(req), NDA_DST, &dst.data, dst.bytelen); if (ndm_flags_mask) addattr8(&req.n, sizeof(req), NDA_NDM_FLAGS_MASK, ndm_flags_mask); diff --git a/man/man8/bridge.8 b/man/man8/bridge.8 index 4255364d..df440c33 100644 --- a/man/man8/bridge.8 +++ b/man/man8/bridge.8 @@ -136,6 +136,8 @@ bridge \- show / manipulate bridge addresses and devices .IR VNI " ] [ " .B port .IR PORT " ] [" +.B dst +.IR IPADDR " ] [ " .BR self " ] [ " master " ] [ " .BR [no]permanent " | " [no]static " | " [no]dynamic " ] [ " .BR [no]added_by_user " ] [ " [no]extern_learn " ] [ " @@ -923,6 +925,12 @@ the UDP destination PORT number for the operation. Match forwarding table entries only with the specified PORT. Valid if the referenced device is a VXLAN type device. +.TP +.BI dst " IPADDR" +the IP address of the destination VXLAN tunnel endpoint for the operation. Match +forwarding table entries only with the specified IPADDR. Valid if the referenced +device is a VXLAN type device. + .TP .B self the operation is fulfilled directly by the driver for the specified network From patchwork Tue Oct 17 07:02:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Cohen X-Patchwork-Id: 13424662 X-Patchwork-Delegate: dsahern@gmail.com Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1BE3C171DF for ; Tue, 17 Oct 2023 07:03:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="NU1jbXLo" Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A48BAB for ; Tue, 17 Oct 2023 00:03:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OkYwDrWSjJJzO031jEgVPrvy3MW6sVqLNxLQU49uUtdal0tpWsVZir8guX7lsn2oQDMRQeqi3JG2dsfJ1jz9WOrjT5J8nT7FqOLYu6WBY1yp5PttN+zr5Pg+EslcXcMhGQsGH3CMg0PET+R8xA5LNwO+vI9duYuQWTjCkxHj5XB0uzSQSWX4Qq+OEYRvY3o7imckBdybCNAJw3/pny3DumphmdVHVbPvMFAwXrcfKyneF6XUtnga+h+ADujKAJtRAeXnlucZJoEY17QMV034+0TFo0ug/TElZ19AiuV/5LuwKQkzM9pZNQIhjUCk278mG5Azb3PwkyZsOXb2g98YEQ== 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=BcJ9kSJh+m37dCtSP1rGJg7Eroof9V7Zyxb7KdFcOLM=; b=GOCCyfrSMYNaU70FhPpdpme/4+LmILJslznVLQLCukCuhMfdOfTSsA2iwHLDtiKThtHwzDMwV5afAl2oMSimWy1LJXF9QXGvddG2PDufMEAc+PYKdvTtssu+e8lP1rMwFCYLEtFmMJUJkz9HoffTvgCE709Eo8o0UnKyDso5sY1vBJh0ePPUlWH6s14SqHgZI4X0V77RYj4NjwFd27Q1R7e/b3krOaFJmBq+uK+ltm7jr1tJGRTyLcLC83h7irY/RHle89Pcy/qkbaXcE/YUynRz42Wec9FSoQSSQKAOkLdGYpe0BmGJgCqO9rvt33M726G9vVocH/yEtlTHIjAAHQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=BcJ9kSJh+m37dCtSP1rGJg7Eroof9V7Zyxb7KdFcOLM=; b=NU1jbXLoMLQBaucSQoSFD1KSYQGIa2sA+IhUfcbkPkGnmCbs5/tVKT5DtRDOWHzh5x8MeTsMPo10VENzwOa2klsb2u7mfNcRouQnrcaj0SbJ60ovY8nAiwqnH1HnWeQemHm7ejERre8AQS5yB9+6liavDxloV6FpxCV1v2GDJ8uNyDxOWZbtD9QlE+ciCJxu2f3R2f/Zk6MkEbhKzncf1v88vsWKvQPlv4NWLE4PO92fxLqKCtw/OoODgcKdK2Dd2Dlqwsm56f9tXpk3kGmmTxVpkxm7ma7jaJWz3wIS2qPWskC7zrOPFtOtvhtqzWGkVfn7OI9tkYy5RoEOK+k5MQ== Received: from MW4PR04CA0314.namprd04.prod.outlook.com (2603:10b6:303:82::19) by DS7PR12MB5813.namprd12.prod.outlook.com (2603:10b6:8:75::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Tue, 17 Oct 2023 07:03:15 +0000 Received: from MWH0EPF000989E6.namprd02.prod.outlook.com (2603:10b6:303:82:cafe::14) by MW4PR04CA0314.outlook.office365.com (2603:10b6:303:82::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36 via Frontend Transport; Tue, 17 Oct 2023 07:03:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by MWH0EPF000989E6.mail.protection.outlook.com (10.167.241.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.21 via Frontend Transport; Tue, 17 Oct 2023 07:03:14 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 17 Oct 2023 00:03:01 -0700 Received: from dev-r-vrt-156.mtr.labs.mlnx (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 17 Oct 2023 00:02:59 -0700 From: Amit Cohen To: CC: , , , , , Amit Cohen Subject: [PATCH iproute2-next 7/8] bridge: fdb: support match on [no]router flag in flush command Date: Tue, 17 Oct 2023 10:02:26 +0300 Message-ID: <20231017070227.3560105-8-amcohen@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017070227.3560105-1-amcohen@nvidia.com> References: <20231017070227.3560105-1-amcohen@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E6:EE_|DS7PR12MB5813:EE_ X-MS-Office365-Filtering-Correlation-Id: fbaaad15-74e1-4f31-8b79-08dbcedf223f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vRadEQp6tpTNr4wnnVVO+Dwo2mrK8xjgxumFtPA/0RqEy1M5IhwKBHeFmYxVGz4jenkHqmVIViDnVNQBhLYuBOOrQz0kp2BhQSH/aS+Ja1YbkpkbCSUd12qyR/7iawSBGL7PEj9p27GZIAugvbBITVPYc1mVjSOFMyUO4GwYVk3n9ncBFl6AGcOq6n9iMIjL9KURpUC4P8vigc9JbyIBlAqCd8idncLZ5rWWQkWGe0cEGNmfhT5TRUA5E2yG1gTTaYmNNW6xcsTr7j4AO3D9SJjkfU1iZ9NqBgjlu3TEYs1T05BWxg/dO4suFy2rdj/NglmTBVYOS4GQFxBDIeBoNPGlZENjLrwF6qi7JdlxvzlgSfMp/szxmPT9Olnx0k5Y6IAlx1+OJkF8mLVrUBfb/X4JFjsAL82JZk/IXf6KOqSnjUVSeWCax+73HznpHROP4EzWEpol5q46eOsrTdOP4oNKSHunR5r4+0pNYJfKsVm/T6ZL9D3f0IO9TXJ6IJWymZ7bsA2+/0DV8Kxaav/zNCtgZf8NoMRoCMG8IslGYRq84Xgca+Gg8JmAUdeebzxC2chxH34ptRkLyGh2Q6K2Uvd2bvkm5EUaQYEwU91Utx1lpMxAb5cqAIvZkrrDbdmMeqKbpd3To5rKt3hXBTYy6+EsIYN5Z1DU506hSEFLd6cAYA6MnfRlE5NrjOwR8SelKMq3MU9n6Y+uDSrqjE+LbT3vBls87jGdnWBWn/DXBcY= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(136003)(346002)(396003)(376002)(230922051799003)(1800799009)(64100799003)(186009)(82310400011)(451199024)(40470700004)(46966006)(36840700001)(6666004)(478600001)(107886003)(83380400001)(66574015)(2616005)(1076003)(26005)(336012)(426003)(16526019)(2906002)(5660300002)(54906003)(70206006)(70586007)(6916009)(316002)(8676002)(41300700001)(8936002)(4326008)(47076005)(36860700001)(86362001)(36756003)(82740400003)(356005)(7636003)(40460700003)(40480700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 07:03:14.9113 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fbaaad15-74e1-4f31-8b79-08dbcedf223f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000989E6.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5813 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_BLOCKED,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 X-Patchwork-Delegate: dsahern@gmail.com Extend "fdb flush" command to match entries with or without (if "no" is prepended) router flag. Examples: $ bridge fdb flush dev vx10 router This will delete all fdb entries pointing to vx10 with router flag. $ bridge fdb flush dev vx10 norouter This will delete all fdb entries pointing to vx10, except the ones with router flag. Signed-off-by: Amit Cohen Acked-by: Nikolay Aleksandrov --- bridge/fdb.c | 8 +++++++- man/man8/bridge.8 | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/bridge/fdb.c b/bridge/fdb.c index 35100e68..ef0b3290 100644 --- a/bridge/fdb.c +++ b/bridge/fdb.c @@ -49,7 +49,7 @@ static void usage(void) " [ nhid NHID ] [ vni VNI ] [ port PORT ] [ dst IPADDR ] [ self ]\n" " [ master ] [ [no]permanent | [no]static | [no]dynamic ]\n" " [ [no]added_by_user ] [ [no]extern_learn ] [ [no]sticky ]\n" - " [ [no]offloaded ]\n"); + " [ [no]offloaded ] [ [no]router ]\n"); exit(-1); } @@ -759,6 +759,12 @@ static int fdb_flush(int argc, char **argv) } else if (strcmp(*argv, "nooffloaded") == 0) { ndm_flags &= ~NTF_OFFLOADED; ndm_flags_mask |= NTF_OFFLOADED; + } else if (strcmp(*argv, "router") == 0) { + ndm_flags |= NTF_ROUTER; + ndm_flags_mask |= NTF_ROUTER; + } else if (strcmp(*argv, "norouter") == 0) { + ndm_flags &= ~NTF_ROUTER; + ndm_flags_mask |= NTF_ROUTER; } else if (strcmp(*argv, "brport") == 0) { if (brport) duparg2("brport", *argv); diff --git a/man/man8/bridge.8 b/man/man8/bridge.8 index df440c33..f76bf96b 100644 --- a/man/man8/bridge.8 +++ b/man/man8/bridge.8 @@ -141,7 +141,7 @@ bridge \- show / manipulate bridge addresses and devices .BR self " ] [ " master " ] [ " .BR [no]permanent " | " [no]static " | " [no]dynamic " ] [ " .BR [no]added_by_user " ] [ " [no]extern_learn " ] [ " -.BR [no]sticky " ] [ " [no]offloaded " ]" +.BR [no]sticky " ] [ " [no]offloaded " ] [ " [no]router " ]" .ti -8 .BR "bridge mdb" " { " add " | " del " | " replace " } " @@ -980,6 +980,13 @@ if specified then only entries with offloaded flag will be deleted or respective if "no" is prepended then only entries without offloaded flag will be deleted. .sp +.TP +.B [no]router +if specified then only entries with router flag will be deleted or respectively +if "no" is prepended then only entries without router flag will be deleted. Valid +if the referenced device is a VXLAN type device. +.sp + .SH bridge mdb - multicast group database management .B mdb From patchwork Tue Oct 17 07:02:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Cohen X-Patchwork-Id: 13424660 X-Patchwork-Delegate: dsahern@gmail.com Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD472171C5 for ; Tue, 17 Oct 2023 07:03:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="WwnX6MQ0" Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2077.outbound.protection.outlook.com [40.107.223.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CDC7F5 for ; Tue, 17 Oct 2023 00:03:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iX1aJ27FE3IIFO3SN7Q+y73TXGnXczN+LHq7GcAvYK9XXyzjrRhhXUN1WKrKaZGuxTTsAni/HZl1hsNzAfPOuc562uEP8zvofgarUuTK/oLTsjjZGiuB9jA/nZVofeJKVh0fFtJCQr7pEaFVtzsIxiWKO+Rmp1Of5qbm0BhET3eiKaqh2Gd6stx55lUrQkUualgECdRWf/xWk+FLRLEA8hv3aecvxwbX1CTtyMYHZ3QaCmqESFQFcaD1lFiYFWsl9gAaymB2wQoo0lrRduAXRef1Qs1NOXw2PK1B+5VxFUFkoileznBafcO7i61+d9DOqqosEoDMb76XRc/7gU6/gg== 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=bukTiZgSHneh0UAY9aN87ojPocTE7xV/Z8cQ2+taoEg=; b=W+2nZTkvr3wo2GE0R88lm+5IGNQc5LjdSZ33jbAHBHVu0TZN6ZbzSCnwixOa9hJ+C7krfyGqyCnMm8hn7hbCopcBoY/l9d5PD6qMO1isubwBJnRI2e5FaLET7OMCm82QZHuwygNrezEe7PQPo+Z1jjmWWsR6KNGSwuadm8SzRJwimSsrK7FsA4+2E2CXI/eyjQIgiYRBjvRi4qbNvNhhL7P15Lq9Qu/uLR16GL4AzWAq2vLE9Bu0ROvm/0ssRH30JPi7iT1W5Vva8JhMpTtimf9yJDK1DmEeCTqkIETAUNPvcYZFlppgJJ0C/I/EPv6Ld5/AZyU8ytYM+R3ML4JOGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=bukTiZgSHneh0UAY9aN87ojPocTE7xV/Z8cQ2+taoEg=; b=WwnX6MQ0y8wq0C9oe4GdeXvWwbjWLDDyaEUwM08TFl5E8L9sZr3r0vtTYIeGOaZwyNnyYkDWRq2JAedGSq+e1VfGj5kOep0bDF6YP/bSibGnvueROwQV1cDWo/rdxoVkIkyOXUVhK0HB6eO3UDo7rEwCy91sZ3FC/Aj56c2YCb1nFax3Vim/coN3EEG/S1qxj7lya1Rr1Owo0EOHzvHizDAwRO4Ff7JfpiU5cdCU2u3Lbhkpbc7RQKkwkiZQXCZyW0Psk4frlmqAljC7iZXe3OZ1gHGkGMK1zvf9GuYUEpUMWn9/k8A/Wa1XhVGqMB06qfPQp2Wc4uQXdo/9sl2QRA== Received: from CY5P221CA0130.NAMP221.PROD.OUTLOOK.COM (2603:10b6:930:1f::16) by SN7PR12MB7369.namprd12.prod.outlook.com (2603:10b6:806:298::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Tue, 17 Oct 2023 07:03:15 +0000 Received: from CY4PEPF0000E9D3.namprd03.prod.outlook.com (2603:10b6:930:1f:cafe::dd) by CY5P221CA0130.outlook.office365.com (2603:10b6:930:1f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.21 via Frontend Transport; Tue, 17 Oct 2023 07:03:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CY4PEPF0000E9D3.mail.protection.outlook.com (10.167.241.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.22 via Frontend Transport; Tue, 17 Oct 2023 07:03:15 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 17 Oct 2023 00:03:04 -0700 Received: from dev-r-vrt-156.mtr.labs.mlnx (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 17 Oct 2023 00:03:01 -0700 From: Amit Cohen To: CC: , , , , , Amit Cohen Subject: [PATCH iproute2-next 8/8] man: bridge: add a note about using 'master' and 'self' with flush Date: Tue, 17 Oct 2023 10:02:27 +0300 Message-ID: <20231017070227.3560105-9-amcohen@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017070227.3560105-1-amcohen@nvidia.com> References: <20231017070227.3560105-1-amcohen@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D3:EE_|SN7PR12MB7369:EE_ X-MS-Office365-Filtering-Correlation-Id: 63c1d711-106e-409c-be2e-08dbcedf2277 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ggM9rTsksq3Xo3a6V9oMdyvLJSTgyCYKIwWOXgA0VKyHEE2hkDfo1etlDpCu8S8puXR3ZghfHVZHFKOMCb+X+DO15tsC9sHtElOavGNoqJxIYCb8gc8MtY5khhnWlacJljt2sbQPIPM9gZK4BuDGvsayz9bNvZb+hBrVZYJqB7xL0yWAWKzzBtXvK4kOkGJW/clmb8eKDJaH3RRUljV3/y3c6DBeuv6pQjpiEFcy5wJXPvRRP2stm4ONnNJBywsF4gYUuV/pocFOmygxwHRLInsuUhFS3GNuI7X4/BKh8bXD3/aZ1JugwjayZ7dd/0i4DGlwDkhRCF0UUwHK5tO17A6PSOQyMSoR+bvtwgzoaJRCxZl9scE5NC9bzXgfTOhNJeCS3pU6GmzEhMz95Z1CvUAV/Bns6MoNQMFCNZtqi0kFszWlLI18gKmjdy/tz4aMlnucY66xQLEy5LpbdkFkeYphjrFytmsCVPmzcfsl8GFW/8ZBZNiyPZhAemPHiq06DtRXFIKUgx+hRiju91iYmoYELmSoOz0PZ6oUbifAeJGUrDgH9dm8ov1Vnkd6ye6bVNFDtmzQ0ze2KZ9vG5FHATSqUY893CN+ZZr235CfpRD5InzeU6OB5UnelMzHJU67tNS7kmVO/fp+LJ6XncQrhOqai++JyfpTPEdMfcD4gytYHv943VFXUMgSmPkztQZpQZz8mDN1gIkb4sN/DDoHHcYo6hk3EuNyYRpK7pmInVg= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(376002)(346002)(39860400002)(396003)(136003)(230922051799003)(82310400011)(1800799009)(451199024)(64100799003)(186009)(40470700004)(46966006)(36840700001)(47076005)(8936002)(4326008)(316002)(8676002)(36860700001)(70586007)(478600001)(6666004)(336012)(26005)(16526019)(1076003)(107886003)(6916009)(70206006)(54906003)(426003)(2616005)(2906002)(36756003)(356005)(82740400003)(5660300002)(86362001)(7636003)(41300700001)(40480700001)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 07:03:15.3265 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 63c1d711-106e-409c-be2e-08dbcedf2277 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9D3.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7369 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_BLOCKED,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 X-Patchwork-Delegate: dsahern@gmail.com When 'master' and 'self' keywords are used, the command will be handled by the driver of the device itself and by the driver that the device is master on. For VXLAN, such command will be handled by VXLAN driver and by bridge driver in case that the VXLAN is master on a bridge. The bridge driver and VXLAN driver do not support the same arguments for flush command, for example - "vlan" is supported by bridge and not by VXLAN and "vni" is supported by VXLAN and not by bridge. The following command returns an error: $ bridge fdb flush dev vx10 vlan 1 self master Error: Unsupported attribute. This error comes from the VXLAN driver, which does not support flush by VLAN, but this command is handled by bridge driver, so entries in bridge are flushed even though user gets an error. Note in the man page that such command is not recommended, instead, user should run flush command twice - once with 'self' and once with 'master', and each one with the supported attributes. Signed-off-by: Amit Cohen Acked-by: Nikolay Aleksandrov --- man/man8/bridge.8 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/man/man8/bridge.8 b/man/man8/bridge.8 index f76bf96b..ee6f2260 100644 --- a/man/man8/bridge.8 +++ b/man/man8/bridge.8 @@ -943,6 +943,11 @@ command can also be used on the bridge device itself. The flag is set by default .B master if the specified network device is a port that belongs to a master device such as a bridge, the operation is fulfilled by the master device's driver. +Flush with both 'master' and 'self' is not recommended with attributes that are +not supported by all devices (e.g., vlan, vni). Such command will be handled by +bridge or VXLAN driver, but will return an error from the driver that does not +support the attribute. Instead, run flush twice - once with 'self' and once +with 'master', and each one with the supported attributes. .TP .B [no]permanent