From patchwork Tue Oct 17 10:55: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: 13425013 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 4D7C74174D for ; Tue, 17 Oct 2023 10:56:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="Y0RMz46z" Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2072.outbound.protection.outlook.com [40.107.92.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E635F1 for ; Tue, 17 Oct 2023 03:56:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZOy/htI47UnNIvGJC1kpG0yk3G+9cyRN81hhz8lg5osM3kFccbEKsqbeoeKh68FIOGu9GckJxn+7FrMl2DeBcXFFAFf1bDXxSLIYPn0RyL8EFQQBGsMZa26PvAZgAK9JaMqmCWtUS+XEqXTZcgiGI7VZSuT4RLTYg2iufkoPy9GVeNnQRroZgwuILITL5q7h4CSdMIK0uQFn7GReMJTRqQwP3BR36smi2+vLTCS45A7XU2S5MSCZ9UKhA+bY7pY+ZTzLg80o5O0vWQSIWxfeSrrlik/MqzqGHOdm9I7XlW6bENyB2ix/fxJPTgsbXC41vk4drlsjiPGaoM7dlAU7Eg== 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=0/i4r1ZP/6X3+F5I+fYf+Bxh2wwsoj1c9yFAuwXfykQ=; b=FOTn38bkuK3+LxrPyMQ7Jc00PJnDNL5diizFZfNp6BDPKNY8vw2ki9qbmAtPXYr33e4MpsD1HwQ4n1NeDGwV3i2nx07qc3epZgXCUF0nvWliHkTr6x1cq/lIsADP79V9ydZM43G+LcyYBop+k0Z+M+qkMIrMlz4PsJYDk0VWHJ5c0Jxoy4Yc7eec1KndxX1enWFfFvk4RPz3jBos5m3REiH+3hTtW4a36R0ZJWgtErbPjOt/f614CxBQpfONKivKgmwkn/1oIWVAkjL6j+nG/6RpErxUAIOVbgLXtlefhU99NYNGW+uHG9B2pEDCIkWtGtBGgpWs28hvkYfVT+g19w== 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=0/i4r1ZP/6X3+F5I+fYf+Bxh2wwsoj1c9yFAuwXfykQ=; b=Y0RMz46zAbxsw7b5ehoHPgX5/xgLkm7kQqc/A+kTw8aXKoUP9H5pBTKr1pKxrf2qI+ILWtNpG75xeS/92C1H1kZXM86mTWu4F1LtuHP6eYfe0/LfVSP0HD5FV7yydxfjTqNlX6VrZXwXOyst9+y/0UVQhXIbfczzR+4oggEhwSGTrCgRJ5msNUUc4DJHfp+6h7raxakHBbaTOsJXg67HtkcCrzaWb/LsfHnJ1x+qw/l8RYEqbSOYbcj4sbOu+oX0s5lX5OJMltM3UI/mzwvx0LDBIqkwWHYQ3331B1xSCuDfLkrH3w+blsdOWPjYBUbdyPc3JncqG2/lUvqAgItluQ== Received: from CY5PR16CA0023.namprd16.prod.outlook.com (2603:10b6:930:10::33) by CH3PR12MB9282.namprd12.prod.outlook.com (2603:10b6:610:1cb::8) 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 10:55:58 +0000 Received: from CY4PEPF0000EE36.namprd05.prod.outlook.com (2603:10b6:930:10:cafe::3b) by CY5PR16CA0023.outlook.office365.com (2603:10b6:930:10::33) 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 10:55:57 +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 CY4PEPF0000EE36.mail.protection.outlook.com (10.167.242.42) 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 10:55:57 +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 03:55:50 -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 03:55:48 -0700 From: Amit Cohen To: CC: , , , , , Amit Cohen Subject: [PATCH iproute2-next v2 1/8] bridge: fdb: rename some variables to contain 'brport' Date: Tue, 17 Oct 2023 13:55:25 +0300 Message-ID: <20231017105532.3563683-2-amcohen@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017105532.3563683-1-amcohen@nvidia.com> References: <20231017105532.3563683-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: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE36:EE_|CH3PR12MB9282:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f6c9f43-7784-499a-d796-08dbceffa4aa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kWLWzP7qPJnv41HBv6grnLsKpLHTIB+TOTrfrbp4aIKKtfle8it9kh9Qp4oJbKcPIo34kbMTSZfGVHSau6YROknmEkuug9YDtxZR3ofBtEtQQPCCqj1ox9nr/ugVv5Ef45iVWe4jURt6cNQuy9MTu+1RTJPvAuZlSYAc46OJKmpjWWirBc/HivwZvDaIZvhHXVfF57Y2NH/Ww9mASlp5SmmiSPi5iZiUYpi8fCu21Z1sHyYgiQ+mbHMe9v1bGRJV1BjXyLkIRiWbKA3V3iX6LilXeme0Qt5E3TQObegdshYfaS8sUVQ1QrCEOkqBU1nyWRqdrzAmvR3Bqj6co1oWzfgbrqk4l/MsL6Fg2AE031VSoFmzG+5Rblf85fZSFJBVXmOR4zmX/JLblUqioGElhtGIL0iCCjvnsa9oNhgs2YjyKyneNutKV+76DvhO7NDYdrMxBM3g18GiOqupQgfbyQ3wfNBpi4KUE572uVui9tRolrNr5Q1xjurJCcjBNZ5TcoNmoKuysg4Gbk/mJVEAjexDp0jv16yMOGYdJpCZj90gF5GegXf9h5yTSmbloCRxoc5E3b2H5g9KRAK3S36x1IOHYW3dyMtF6BQJ1qTiYPAPBnohjNUfaWgHYhTOUgbusgTDJah9kyZ8HkPyOcK8mLqeIwQpp8kdDyDX9fpoD4jjHZdjMRf7enhRyDrt3n7B0D/MlvRnd6KPC+1YoR2A1OyAiLsXHMobhm+qP1KBWcWDbF/a210/b+oAQfn4Ieb3 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)(396003)(136003)(39860400002)(376002)(230922051799003)(451199024)(64100799003)(82310400011)(1800799009)(186009)(46966006)(36840700001)(40470700004)(336012)(40480700001)(40460700003)(82740400003)(36756003)(47076005)(83380400001)(36860700001)(7636003)(6666004)(356005)(26005)(16526019)(2906002)(54906003)(6916009)(316002)(70206006)(1076003)(2616005)(70586007)(478600001)(426003)(107886003)(86362001)(41300700001)(8936002)(8676002)(4326008)(5660300002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 10:55:57.6136 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9f6c9f43-7784-499a-d796-08dbceffa4aa 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: CY4PEPF0000EE36.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9282 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 10:55: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: 13425018 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 0F45C41777 for ; Tue, 17 Oct 2023 10:56:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="tikGF7d6" Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2089.outbound.protection.outlook.com [40.107.237.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5156B0 for ; Tue, 17 Oct 2023 03:56:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eEiWT79Uu5odcJcsNwFyIt1iAXFj75pF3BZYDJ6PgjpviDWF8KBy0DXbfKm/54C76hY00n3cdtJbq8cELjjy9LluG+AMnHx7QUpR/2RBDleSX5Hu77lJyeJaItF0fIR32dqVteqcVdfOn4bFOOqfpdX07vifR6LtkN/GcA6obmwx7VuCyVi3XvTkhYpRpwVybT3dT5eFECBPnX6G/reKYp56ErCY3XObNvtuVsAKvRaurcv0WzzMjPqc+dKwgK0LcthyjTOSEsJfPF9xS18/AKOvogMKqKAUSXYVe8RDDyReLBh8zTNfzfn9Uu3Gwu+sIBEw2fJCjDBDyOZ9kzw2Og== 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=x9p5xXOc7reC1U4JJ5P5FIWyfIzontEcRyzZBHMDshs=; b=Yy58vPdIT8DAroojM+BsfXk8fsET2HPJ8ED1c4llj9X2q9tq60z/7XJL6aEx88INr1njNs7mVHkxBNNefuagOd7kajpyKtImAys/aFj9GU8NW6vk48o8cA8dEENix3EhGdy01CZ5an7jV8B0rKg32jaxOVyrBl4forCoP6C6eTBHddiM00uYWLPpq4wLsJ93pqE7F0WnxzRKAT54qoCR1nRCBorLdvOmF7BivRvR//TJ1H6kq0dOFWfjyhplCaiksGbmHWKylVgH+glbct7ZSBdjHrCc9XgGRjI7NB798gkiHZd4U+SNlIoDCcwg478dsw1DZu7Xta3iXnIdPtsWYA== 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=x9p5xXOc7reC1U4JJ5P5FIWyfIzontEcRyzZBHMDshs=; b=tikGF7d6DpkM8m8lvmHuvdxzRh9YpTc9aenQsRJKAXzfcschDC/M+NUYM5IIzplKwvV06O+S0U42BZ4E8W3K/QMQQLaA8U4e9fIoBd/Z50Nw5/OQnPkMXNUN/y36Wboz1pdYbgUjbfSkhJ3wtjR0vsgKTz4cqkmYeOIKMEe7YkUkrI5ZrQPAGnNJ6eMNNxa5VJBfAy2OoCusKbGmclrV3WPy25ivQeKkNqNSztCExOCWa+6pUkuxDJP1jan+r54g2/xZOESouuHuKlAk4ceJm4BcKraSYlFPwWJxKmjlTXG7ymKzMOo9Z+cWM7z7BAfPINY86GD1771MPV5RCPE6Dw== Received: from BL0PR0102CA0034.prod.exchangelabs.com (2603:10b6:207:18::47) by DS7PR12MB5885.namprd12.prod.outlook.com (2603:10b6:8:78::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Tue, 17 Oct 2023 10:56:08 +0000 Received: from BL02EPF0001A0FD.namprd03.prod.outlook.com (2603:10b6:207:18:cafe::10) by BL0PR0102CA0034.outlook.office365.com (2603:10b6:207:18::47) 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 10:56: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 BL02EPF0001A0FD.mail.protection.outlook.com (10.167.242.104) 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 10:56: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 03:55: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 03:55:50 -0700 From: Amit Cohen To: CC: , , , , , Amit Cohen Subject: [PATCH iproute2-next v2 2/8] bridge: fdb: support match on source VNI in flush command Date: Tue, 17 Oct 2023 13:55:26 +0300 Message-ID: <20231017105532.3563683-3-amcohen@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017105532.3563683-1-amcohen@nvidia.com> References: <20231017105532.3563683-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: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A0FD:EE_|DS7PR12MB5885:EE_ X-MS-Office365-Filtering-Correlation-Id: 0e44d752-f87e-43f9-9b2b-08dbceffaacb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TzLIdPYFdSoSkvqQU1NMAVr2ABXvvp9pX581/KZfkHxadDSNW56ZeqINfj4trZM+h+Cz+/d23GGShija0j4YQY3PT2leBo/7CNd+QpE8Gqfay1+p8cNNQuehymjh9kKehhFBrSgoTC+XkmNLgJ3RI+ZlYd9VrwMNa64QRsJLBhyg2ZJMZE46liNAg0gG3gboxE0vwtYzdXLwGSE9xKN2AR9LtJ25bE4yikM/2q10D3zYr5ks09d2/mjFkd8dcon4EfKrFDUOlbseHQex7AXlF8mP2PSbycTZ9hTga6zZ3u7iUnfeShSSea8aeDWg4M7sHkkOgRlAi9/7ElvTz54wucE7lCNieVWPTq+ITTRt4VG/q41ARfkdN+QzPi/XwPI9tWeK/tCs4FQs/pajwvJVUNrpcD9jYQkCceWL2j3jdjXIz9p6emRe0VgJGsFSQo8gfhl2lVuC2JJ2BKYvGSNSnUCfUliFhHvJO6mFeKIqH1X1YgV9Ypob3kovKn/7sX/ml4MI2Q6Wm0XBSAUgDMYboiDRZhykBK5e9vB3jmNky828UPYQZnWZRSP+2d6wPvTWTMAqjff+WyuSmi5Pdwjv9WgKNrS/UbZWyjn8TIMoUiu8+jskRGiNhpsaI1excJ0x0ewhHAAVkbWVLoZpusNs87f0A/Hkos8s1AhWwCfE5WF6Rm7I0b250ExArSF9I9AAZGDNCfrITVOk60r/xbe/IRLJnn3+kZ5omMT3CCin26Y13KN3KF7U0j8Ak5lYVa6Z 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)(346002)(396003)(376002)(39860400002)(136003)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(82310400011)(36840700001)(40470700004)(46966006)(336012)(40480700001)(40460700003)(478600001)(6666004)(36860700001)(47076005)(82740400003)(86362001)(36756003)(7636003)(356005)(6916009)(2906002)(1076003)(107886003)(2616005)(26005)(16526019)(426003)(83380400001)(316002)(41300700001)(5660300002)(70206006)(70586007)(4326008)(8936002)(8676002)(54906003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 10:56:07.8322 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e44d752-f87e-43f9-9b2b-08dbceffaacb 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: BL02EPF0001A0FD.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5885 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 10:55: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: 13425014 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 4D76941212 for ; Tue, 17 Oct 2023 10:56:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="s9NO9PLj" Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2051.outbound.protection.outlook.com [40.107.237.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DB3B1BD for ; Tue, 17 Oct 2023 03:56:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GHa37DZCZ4Kq0RAmsVmFCoLrqR7nAq1WgHCV03eL78ugsYh0MG5JJZMbfCyoDbgRXtJ/6Nv0b+6AscNJcekJChO0MtcHe1+Y59w4QDjGoUcSxmFA36Z7dvquGAoBOtSoSgrTu7WvKhUXeVpfbM9xHSrZsHROymwGM3QbYn5EWgTvPtPM+jJR2BdiGMyuirlSu7hLYTYvH+pETY/N27OxyNhNGW0VLHXoRUjpGod4Qjo5lWXmf4nKH7y22u0BJQ/cuI9sQ8r01hOzEA8+JMEwU9ASpLyRkqmICp1IbMOqm4++beNfhFDb12uS3k6v8wA8sTxsW+kzgN15ONV74/c42g== 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=3amDYLM0hkVyxS2DCGU0TvBovMJYkDMGscZKhVJdQ+Y=; b=Lrba46N6BXQww8imUIqqpcLFtjTt/dToQYaLMvUqdU3NQSh1ByP4wRqjBu7k4+GtLRSc1QU+BKLSLWyz0eFXJoTO4yfTSldgCSf7oiTnqa1TcZ5DGqn+Q9yjc9tLZonQR5V7pUom2AA0HIlsJsb5hE/RDeO8ba0NWAV1kd44DvbGsp9k51xDsHVGfFs+6m3+9jYzCnM/jBhdXZ5wrQjYMpCcv7x3Iqwd37CekVhMAhjeL4WmqhiA1Ep6YcRB4ArP6j4wSLfmoR0pCe89gSstg6PC0y7ZY8FpSs0wqg4IjSi3XpFkvwFyTaUjVUrkRpzZSWEHyY4xgDxdlQznsxBBnA== 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=3amDYLM0hkVyxS2DCGU0TvBovMJYkDMGscZKhVJdQ+Y=; b=s9NO9PLjtIdCfUD9r48aiBOOYaV51WwVEerOo51P6lF/Nu8J7WEePhLkptpldo/hoKjdsQ9C3JRBw0gwrX+25bN4bcT3yEa7hS5oYTs1ObkZ/y9HKI+R+OQ6fThVz2c10UeRdpy5My/CPrveQhO/KTCmaL6la5Vg/sKHJtq3LMJcgPE9PBj8wqTnW0AUhzKBqB39hRmtO66jmTlbvWKgyspKJsVDweTxRK2PNl8H2uqsh3/gr35I/V/ULeqrU5WD75P7sQftd2sZ/FFQA9O26ojoznKFMqFSLlAtfOV/iQs1Ihm0qlqH6ExPVROWab6pOIgv2OB4QskoVcB9ZqXwQw== Received: from CYZPR20CA0014.namprd20.prod.outlook.com (2603:10b6:930:a2::8) by PH8PR12MB7110.namprd12.prod.outlook.com (2603:10b6:510:22e::11) 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 10:55:59 +0000 Received: from CY4PEPF0000EE32.namprd05.prod.outlook.com (2603:10b6:930:a2:cafe::9d) by CYZPR20CA0014.outlook.office365.com (2603:10b6:930:a2::8) 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 10:55:59 +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 CY4PEPF0000EE32.mail.protection.outlook.com (10.167.242.38) 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 10:55:59 +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 03:55:55 -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 03:55:53 -0700 From: Amit Cohen To: CC: , , , , , Amit Cohen Subject: [PATCH iproute2-next v2 3/8] bridge: fdb: support match on nexthop ID in flush command Date: Tue, 17 Oct 2023 13:55:27 +0300 Message-ID: <20231017105532.3563683-4-amcohen@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017105532.3563683-1-amcohen@nvidia.com> References: <20231017105532.3563683-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: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE32:EE_|PH8PR12MB7110:EE_ X-MS-Office365-Filtering-Correlation-Id: a4fbf751-ccc3-49e4-69f7-08dbceffa5a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N265DOM59ZrWpSeFbAQIg9Z7VTmB6U7BQsEnaBh7CIg45s+8dWue28maU21o+xbn61mrljIN0ndDmPSRY5Ff7qTjO/phzDka2WB7d6s+HheZC2pUWadmle0+ggzMFzd1hR7HTAe1NJv7C5u8c9FTbvkA/JQCav3Y8AnYxzxvN0OfgPQrr+38e184SpSelxcCkOJ162G5SmuP635sjL+aracw8Ohcszws1w6RD8HAmBRbTJmrS1u2e20fMse+ZJZikyJT/OH6BouukBW5so+ZTOnAdXaFNhyRJWp2i7RBtT8+Hsi50YGSCBf3FvHP6TswZP63WpXJSixt4FJYuFuY2NAvDWIzMWNtvhPfJoJ6QmvCjmIf65sQDFpHKn+x0sVr2XDzTo3hp3Th7mAxE/mwWxjbXIdX2BQHbZUHVpexwb7bBs5J9kwfv61+hCKfrAv6iMMEkcBSzfwAiw7gW55ArBqZmcw1cBeq2m5J22882GZqU03SLg8rXJM+gsrdf1xGDQIvzbBjC38atV2naXQGYlIg81DG5IVNoWE5mqj372rR9hOqaKhCmUA149JrKklFSuXqJtpoHNpKTDLLqtIdf2oMMb6jhBRN9yw51lG9pKFowwoOwsP3jbToAKzmajHb9vrAaa9By8ICMQMw4jvsn1sVzy5gnxcF6iFank2QkyHHtVl4B5eGVyUzLdo3bkNTyigIBjda30SdchrEfwAcKXbBZhjTi3vgMOTh9nLDdd7MqkL3MsVLeTjjHI2o1qhE 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)(396003)(136003)(39860400002)(376002)(230922051799003)(451199024)(64100799003)(82310400011)(1800799009)(186009)(40470700004)(36840700001)(46966006)(36860700001)(40480700001)(478600001)(6666004)(47076005)(40460700003)(70206006)(70586007)(54906003)(6916009)(316002)(7636003)(356005)(86362001)(82740400003)(36756003)(41300700001)(5660300002)(8936002)(4326008)(8676002)(2906002)(336012)(426003)(1076003)(107886003)(2616005)(16526019)(83380400001)(26005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 10:55:59.3117 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a4fbf751-ccc3-49e4-69f7-08dbceffa5a4 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: CY4PEPF0000EE32.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7110 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 Acked-by: Nikolay Aleksandrov --- Notes: v2: * Print 'nhid' instead of 'id' in the error * Use capital letters for 'ECMP' in man page 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..22a86922 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("\"nid\" 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..254b2fe9 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 10:55:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Cohen X-Patchwork-Id: 13425015 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 45E9B41765 for ; Tue, 17 Oct 2023 10:56:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="sMADj67E" Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2085.outbound.protection.outlook.com [40.107.212.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04250D54 for ; Tue, 17 Oct 2023 03:56:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P0MDyu1TkMM0OBbSEDKYL9uBo9sqyy/IDwQVpjHxkAPp09EKUaJIGraHzKLnhEAqQcU2mLAX9BnCL2eZvDvR6ZgThVuOoITH+lQHwQKRlMufyR0NeRqIQw9bNz+9LMqcFq5nvG0bH+ZqJSrmkl9XMXanO3gV6emVTYdPjsgGJqETorxOtd296kiBKpV3C0iQPpoNv4A7Rrcl6NOcLsiiPt+Fqh+g6PHdSQQGdUNd/SOKSw4IiGdNWZYjR0TW9SQwSpDi63sdMbchf4sxCWdFaKjGPAYPrS8KF9iFmmZqxF5rLRHHbf5cqq+c0BUm5s+ujUXYonDd1rG9LFsGWMw2Uw== 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=pOjn5iVSkDltjjHQa3vjh9w6ll0VWjCI+UFftX2szMU=; b=XzbCp3HuxEjfZMS/zTIjHobIsCSzb3D/+bYdFcGlp4gVf4PtS+w7A0sCbVutIpW62OrunaSY8lWe3my9SzDZLCqPmIrN87hI2Z0+hCDVWV+JOXS474sLJNRm35TVNZhHJTf+ld8L4f2+fARpK/0Zv9iSXLb9j14AzGX9fJVKJDEGY7J4ZoH+XjxFKOHbvwdds10ep+oGLKieSPSclJdKBpgBfEAhT9J/dVxv5mFJKLW3IDVUwIy+8UQ8pj8SjH4WbaOfHVE99qKpbcMxrLPFZD7AIAjshfrC6M6o+9sMD8O8N5Z5Q/rl4lQlBIPOYnSNHJByIP6LAm/IAme2nsoZOQ== 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=pOjn5iVSkDltjjHQa3vjh9w6ll0VWjCI+UFftX2szMU=; b=sMADj67EEThvMqdyGfY+N4oymBIZLKZ8ZWY38t6sX623ciw2L6pJWHoyprSxxg5SDr6W1RV15YLw1hpw1jlNSWuJ325yjppx+A797NKLLjq5eva+MXQms0m+njp1UHDEDaFXfjkY9v9mQl9gv944WIdboOK0Wj5Vd/qbpFWwLdTBK0i2a5JmhNE8ZeZICGqIbvCnv5HeqnpT8GyfKpkAwUQeKbgfJZ3YD3e62pN0y23WcHYWH2KSnaVXcivXwM36igpf1S8EExpZxcuwAs4Mo3JuSvgyfykcvspmzMXf6n0cAbhK8lqZLMjjBM3c05UPV3lz4DOY1StGXPJpi5fjhA== Received: from DM6PR01CA0002.prod.exchangelabs.com (2603:10b6:5:296::7) by CH0PR12MB5299.namprd12.prod.outlook.com (2603:10b6:610:d6::10) 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 10:56:02 +0000 Received: from CY4PEPF0000EE31.namprd05.prod.outlook.com (2603:10b6:5:296:cafe::6b) by DM6PR01CA0002.outlook.office365.com (2603:10b6:5:296::7) 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 10:56:02 +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 CY4PEPF0000EE31.mail.protection.outlook.com (10.167.242.37) 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 10:56:02 +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 03:55:57 -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 03:55:55 -0700 From: Amit Cohen To: CC: , , , , , Amit Cohen Subject: [PATCH iproute2-next v2 4/8] bridge: fdb: support match on destination VNI in flush command Date: Tue, 17 Oct 2023 13:55:28 +0300 Message-ID: <20231017105532.3563683-5-amcohen@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017105532.3563683-1-amcohen@nvidia.com> References: <20231017105532.3563683-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: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE31:EE_|CH0PR12MB5299:EE_ X-MS-Office365-Filtering-Correlation-Id: 98e7db44-aafe-4931-2ffb-08dbceffa791 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PfSbkZDzdviwn2lQRZX/JEiadMOEq8lUxha9il7rQxkDiMFxKMnFL2Lp41JA6Bprxaki5OiwTkE1s/BafrumkoxeLlsi/R5i5QifepIZt/1GxoYuQZGLjkic+9fC/yOqx7s6tEjyCloz7/LjHBsVh4kqRu2po21+RfPPJAB2eenpAZMX11qOV7amV8Iw31HMdE1fvuHgse5m3CzzaIHRjV4yF7yWa76G1/0sWA+/aL6AvioCJl49ZceG8kR6gliH9GfUggCJdevzOsu0JDBGodew9/EiMrs6D6V27Hw4iGYxgsyNaIspR7JNhWwGfqiHivNFKGQQgv6xISGF2r3ilx58SyfcgqscKWaHg68Hw5jF8uOPBaQm1sbIMIMy4+l6NP3aRH1/k4zWk84ZyPdWqH2+A0Wcr47a/hwMu3czeyREphDWbjLBOythy2Ghn77dGePedr024JWCnjsL5x0Qw0NKZVR23738kjarxh8UiMfIOuF899piXmyo8v6f8oADsiaiWb6T6ZeRgqKDRBVnZ4HBrtK/JZx8+wbZIjoujCnZzLvn2us9z04lfLJehW9DQkTacoNO+rPaBqttDTsrK1FbvE/GgC/3ylctK/G0P6seB7zCooWNNUN99mq5KwSuCPM2ToBYYpK3LbOLFOLZIytMeVcGfml4iIlGFWfc/lCkoD6iNTHlSdg3uGtjpQV0NHSL4oa7ysSuoDs0Ly+V3fugu43Vf6wEbTwkEmOv9Y651LiteCG6onlvpjIZxCZe 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)(396003)(136003)(376002)(346002)(39860400002)(230922051799003)(1800799009)(64100799003)(82310400011)(451199024)(186009)(36840700001)(40470700004)(46966006)(83380400001)(336012)(426003)(16526019)(26005)(1076003)(41300700001)(5660300002)(8936002)(4326008)(8676002)(107886003)(2616005)(40460700003)(36756003)(86362001)(7636003)(356005)(40480700001)(82740400003)(36860700001)(47076005)(2906002)(478600001)(316002)(70586007)(54906003)(6916009)(6666004)(70206006);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 10:56:02.5255 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 98e7db44-aafe-4931-2ffb-08dbceffa791 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: CY4PEPF0000EE31.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5299 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 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 22a86922..16cd7660 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("\"nid\" 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 254b2fe9..9341c77b 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 10:55:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Cohen X-Patchwork-Id: 13425017 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 F0D5641758 for ; Tue, 17 Oct 2023 10:56:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="CpgzaXUu" Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2070.outbound.protection.outlook.com [40.107.94.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D40F109 for ; Tue, 17 Oct 2023 03:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=leEqPx0MPQiVrL9Lf289SvlrSkpX6VtvhrH/HVV+91GMrddClJVZqS7UQcIcjJpgiLo08ARH39y2zff6h7YPHdllKQ2l3bOYvgckWACkMi8CEG+BLMjjwnHPyWBpi546Gi+LO/2vXw6s1trc+RoK1roUNl6aO8k1FsFjQuZKKiYyc0RowRBCLdWWOX3xeSlPK/nUMJT5AKfoJxmOpCvnR1B7DKJsLlueO7ziy1/fo0cXnriizvXyvU/NC026B+6Ww58gqs0rYbu6twBEKnrFlH38lh/ouFrq1k2hZibsEigzZ3XGzEHA2KQIfXtXQvpxuWHEvpGNiPAyYzr525uQOQ== 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=Qhe95pSa4U89mp8W5+defLHtXZd0gZxBcnzyGrOyQXQ=; b=iHrgboK7PnKbOLB62pueB3YoKKYUfndGSEP8EysWWBnhbM9zEx+FybSug0tIvs3ftcWtmoM/EUcQG77pyt/hVEs1wJtMDoSQmHG2UdVGa+c8rqQ+mAHJnWJ+f0aO/dppkPG5VIzHxUPSGxTcLk36bmGQ8dUmVrgowz0TNtJDiUmCQ48B8IwPIZsTQDw4/cXBvziYfXSXmJqc7L/pXFNETSoXwSK2QZtXBD1hWZxJUCHwUraX322bAoBmpwQKBCJMbtR70YS7KLQfLzM1LPdHn12HbqPrW1TAL8aF000Lvu/Rnoj3pqYEoXXz4UZ7+1R6WsKm/h9F7z97y7xjFICzVQ== 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=Qhe95pSa4U89mp8W5+defLHtXZd0gZxBcnzyGrOyQXQ=; b=CpgzaXUuN8vgK4TyzY9pg+PXKrt/FWPSrLBndS3Qj3W39zm8VO5dr9KqHX0mDWg71xMheUbh9yWVXzZLoJ4CvHijL3EAQelByxc9CEEhN9ErZccrMn749HJfd2U72QSn9lzrqOltt9Pj46y33lGs8aENEW0h4Lkr2QU8H6soL06wsBuHzW2y17O4TpSTvJvZhGXDYhfaSC2kMCEx0r1vccQQyvy7D+afj4JQDfEUHrodr68tyQKWAJlSIxQVgPxI60vewrX7aVj030+TQRJJy6RP6dqgnisr92HWf3h2v2qkho3JLKw5IIL4907daEcxA+EmL3CUv6tvO0Ce7eVdzw== Received: from MN2PR05CA0054.namprd05.prod.outlook.com (2603:10b6:208:236::23) by MW6PR12MB8866.namprd12.prod.outlook.com (2603:10b6:303:24c::16) 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 10:56:13 +0000 Received: from BL02EPF0001A0FB.namprd03.prod.outlook.com (2603:10b6:208:236:cafe::3e) by MN2PR05CA0054.outlook.office365.com (2603:10b6:208:236::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.18 via Frontend Transport; Tue, 17 Oct 2023 10:56:12 +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 BL02EPF0001A0FB.mail.protection.outlook.com (10.167.242.102) 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 10:56:12 +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 03:56:00 -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 03:55:57 -0700 From: Amit Cohen To: CC: , , , , , Amit Cohen Subject: [PATCH iproute2-next v2 5/8] bridge: fdb: support match on destination port in flush command Date: Tue, 17 Oct 2023 13:55:29 +0300 Message-ID: <20231017105532.3563683-6-amcohen@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017105532.3563683-1-amcohen@nvidia.com> References: <20231017105532.3563683-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: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A0FB:EE_|MW6PR12MB8866:EE_ X-MS-Office365-Filtering-Correlation-Id: 8e383146-867e-4455-a105-08dbceffad80 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NRpK/TI/bXUGYKq253ZWya1Bf+86hA32z4tU3WZEoRF/0oBysp53d+l8BY0/d8dahwkFd9svL9KRaOukG2suSH3nO/6L6glJa+xSQnlXnOtxptpKIC7Cshu6n0nPzZmZX/lfnEr9zO/OIoGVZs+WPKsW8sPq4//X/2N9svBJmsQA+3Zf0QzExwnZ2H2uedMnrdTnUfb45cLxpTy+03axP8R/Q+lqgohT1jdoYu9drlWuD4WTOFuSqIo8K39kHeZiHTzi8GLz7XJmW7dTdDzlqEE16nwDf6DEpPt1sbAR2YRmSNEzVvMv2OlB3NEoVpxKF9kG40sBB5LZK0m781w5PaxC6MwNr/Zw3JE9gCJDaxk71wKU403i/1mBNdzXHGQIx7HLfI2iLQ13BzsKn7WWBfJVdm/uclmmZAAKJM3eiDiz0aqlqGas12oGRRLpw8dO+UU1bSPkrvFOWBsr5dIFNRdxByiLwb5qJnmdZeUK1lhbZBe9ExV+RbUrv8+xitugugnhk8nKuJjfniWsUxOCJUftiX5zVmSQB4v2NzUAW7+5Ml2rpPLma7mS0BTPJPsPj0hlKLH/PaWg6shOKo1MZ/02rEALm/jmNNltv0m+GXt14Q+ECGyyH1SbdPKD4x30Ja4cKfAvdTaHC2XzkkecTe0lyM8fKWph+/NGc3coagwVfZuIpkK6fEe4DNs+jRCbFe4y8lYMGglrxg8DqHqG1bDElIH+QvCuyKWde8mkCCCEK/untVYt1oMnL600i8mE 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)(346002)(376002)(396003)(136003)(39860400002)(230922051799003)(186009)(1800799009)(82310400011)(64100799003)(451199024)(36840700001)(46966006)(40470700004)(83380400001)(336012)(426003)(16526019)(26005)(1076003)(5660300002)(41300700001)(8936002)(4326008)(8676002)(107886003)(2616005)(40460700003)(36756003)(86362001)(7636003)(356005)(40480700001)(82740400003)(36860700001)(47076005)(2906002)(478600001)(316002)(70586007)(54906003)(6916009)(6666004)(70206006);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 10:56:12.3740 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8e383146-867e-4455-a105-08dbceffad80 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: BL02EPF0001A0FB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8866 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 16cd7660..f2d882ed 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 9341c77b..cf23094c 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 10:55:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Cohen X-Patchwork-Id: 13425019 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 5A2C541762 for ; Tue, 17 Oct 2023 10:56:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="ePWd+GlO" Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2050.outbound.protection.outlook.com [40.107.237.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB86E112 for ; Tue, 17 Oct 2023 03:56:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jcOjeLCKZaJRZByJvHAsfK4pxmn5XsmUmi3reqsRz6gh9Fm6MI2qS/bYIRWo94Eyq9iLrRcgNUBMhryUwI4ud82pCphLPUVCIsVByI4+APfAWXK7Lm65OTH8cNZ/PIX9PllLyZeNbGLxvpEnPXVgxbtLeCKTC8PNXswUIdfO6It+eChStz/R7QxfgKw/u6+fI/GDuWQBxMSrB+bRP1J50KziCVLP1qBVsBrrUKqzCq5PGOO6psPDbxz54pfGvstQvaxjwtj8jQ+JADOXA695SD11OxidrXFojXtY4q07oVQxGeD0UmlThuXrL4Pbvu9NdHDlqiZc8hP//rv8I1j1Pw== 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=V3P3OZ35DDLj4tuf3t7hX+EXo21iC/sY+m0awGb6Igk=; b=nik904dE+HfF7ml/bvcRUaM3GakI2GjOhF/fPvvfmCOxzc1YDM/J9YHeX7Z7WlWxux4ZPHOX+XZRCgxbRO+VnCM5zxv8UMoMnCrQBmD0aGcgqxxYXXRWthDNFAGcXzxTv1zTQ7GBdUChKDfRCnbKkKZHWcrtRCs99FC0+xldnUgIOX8wzbfWiMX7C9J6shAtVVXF/rpULgNM/54bihicYg4EpIyJUx5ZA5Os64QcggacvMzvZStPFGy2hfpSAAI38Re2Jc167i0MSBkoSxB5+46Ra9rEhq1jNCIPiGhkjYKibm7GDA3skN1x/2E2uvhQaQRIBdAyK7kQLtJ/xPwEFQ== 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=V3P3OZ35DDLj4tuf3t7hX+EXo21iC/sY+m0awGb6Igk=; b=ePWd+GlOyd7q0nhlL7undnrSeJDDJdojsdOcMuAjQjnZjghAY8bl9lJnqaz7nC2ge97V+XMpGVniDwngEjsxSSyuy3+unCRQKJRMNT1JosckeTg3slAevM2BW0tuTucFyozi8KRdENRcNWAJHGxrpMNZv3BbOJBB3yDO9nc3dLAFz2Za01qu7iIHDtdwZXxUKoPwzpH+v2zuU5cGJe998DsJgDWCDiVXMngyVDJO1EjAS+uohiSPnTUuLVOOFU7AbjE2tJNF7B2SBPzToKm23mXK/e/BwbNZmTrKBQNMKDInXE+qlvNXzTpQQtJl6neEgy3szmTa6loS45Ldh6Hr2g== Received: from MN2PR05CA0062.namprd05.prod.outlook.com (2603:10b6:208:236::31) by CY8PR12MB8241.namprd12.prod.outlook.com (2603:10b6:930:76::10) 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 10:56:14 +0000 Received: from BL02EPF0001A0FB.namprd03.prod.outlook.com (2603:10b6:208:236:cafe::60) by MN2PR05CA0062.outlook.office365.com (2603:10b6:208:236::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.18 via Frontend Transport; Tue, 17 Oct 2023 10:56:14 +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 BL02EPF0001A0FB.mail.protection.outlook.com (10.167.242.102) 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 10:56:14 +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 03:56:02 -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 03:56:00 -0700 From: Amit Cohen To: CC: , , , , , Amit Cohen Subject: [PATCH iproute2-next v2 6/8] bridge: fdb: support match on destination IP in flush command Date: Tue, 17 Oct 2023 13:55:30 +0300 Message-ID: <20231017105532.3563683-7-amcohen@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017105532.3563683-1-amcohen@nvidia.com> References: <20231017105532.3563683-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: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A0FB:EE_|CY8PR12MB8241:EE_ X-MS-Office365-Filtering-Correlation-Id: 8cdc3300-960a-4263-e2ea-08dbceffae86 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CLgn8DjreidKqj0ZqQRoi17j+uIf3JANyydnzAvn1ZTAdcD9ZmplvSx/NyJhu/fW/a0hdgilKWyOoJHd44PUYr24jNbyrxmA2rGxRr2Ee+GeDe8o3XskGdu1eGHnD8PtltIpO4hdy12wdKkbA3tYHtDmoZqvrTul21FhTx3Z1baHJCIGmPlotwRd9LvSTrb/qSUKEzhHTtoldRr/pgEy7z2IC0ojBOCGs4FdAtEnr41d+k6RbWPiZZUpaga1rZ+MF3KbJvUPkDZk9oXhoXnF62RDOETVjnzKHDUj56lDLlpQbOTdeKO5HtVG+t8uFHl6RCIsgubwWU/6clSLNzJWrmOx2R3IbrKyVFwaPmyNdWJ3URyfins8ADE/OP9rJSj6Y5fGZ95L+rWXRq73u6GIes0vM+FrH1qTQ4cyOEH1LUAsFBN5S6dQdRBsLR1k6rrbi1BDucB6Keuu5sXkNNjTu9R1js2gac3kECsJ0wYaiUixrbIGnfaTDZeOAl9GCNACjTFrO9f2Egef4+P6njD3MMgn/wTufeClp8iPIrCZfyQFD8+JBK6v6cx5PTVIzsRLnYjZkMr+9F6d1GPd/ErpQrYS3vKJJoaMdFZ5xRs7SBzxdNq6h4+AN3alx0FSsZGTCOf/gCDqQok2YnghdnutdDdXhh/yCrk6EiIfNK/bQEygyer8WqG1DEcke4/p4/YLZzIo9sq0jEOVRKRAnnKRXx72H9B/wqhkesiTye1deE5dSSbUV8oSECp+ZgryH4Cf 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)(136003)(346002)(39860400002)(230922051799003)(1800799009)(186009)(451199024)(82310400011)(64100799003)(40470700004)(46966006)(36840700001)(2616005)(40460700003)(40480700001)(478600001)(70206006)(47076005)(54906003)(70586007)(6916009)(6666004)(7636003)(36860700001)(83380400001)(86362001)(356005)(82740400003)(316002)(426003)(107886003)(26005)(16526019)(1076003)(41300700001)(336012)(5660300002)(36756003)(2906002)(4326008)(8676002)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 10:56:14.1083 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8cdc3300-960a-4263-e2ea-08dbceffae86 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: BL02EPF0001A0FB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8241 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 f2d882ed..8311fa08 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 cf23094c..e3051f89 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 10:55:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Cohen X-Patchwork-Id: 13425021 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 0094541AA1 for ; Tue, 17 Oct 2023 10:56:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="efWGTXmo" Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2077.outbound.protection.outlook.com [40.107.101.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39DE6107 for ; Tue, 17 Oct 2023 03:56:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IqXt/9nAN+AdXEtDBGLCXvRU+OOC9YYU2ZQDfj5rRBT4VSLM95Vf2mBUv5KkIoYSMnxHmlNWaTgXU92oKVAiV8iNQLINJDPUHjuzlUq0x4lzGB/rESi6/NQ8tzp3WLVFKTlgVEZBPr0v6vUHPovzXMdg0DPFd+tAMi2eApbmi8lBO+GPZ7KUNOWBzvOe8Ara2dt4kw4CyIZKz9RBAMbcr8G92smsrfGFv3N8Pa+Hic9iJVgEaitaDtOvHzMo0TeFboikVk/sY4IKnA9skrj3YNdX49sVWwAfEhFSp0kInkvQu5y59BHh7m+2FFkuUXBGYnXOYRqZl4XaZ9r5qwPB4A== 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=8CQuPWy4s2VTsgnwF9N03aOaS+o2BXhr55Jt3JdVV1I=; b=HFa1pzbXTYFwADCSAI6671jlVECBv9NJL2jEod5eeFFIS5FagWV5AYwkyMkUWgBpRYK17nYshBN0d4z3Eeb08HwbkVf7HboIDWwRt6DPjn54lXYkKMWrONizzl42D3/FvAV4flR8z920Yy3oUgvFW9rbVLMXfT7YjZn7VfukVweY5p1A7jcA5daBUS7ctpi78xTJJtlX9/LcsQOlntedl92ptQy2Rx4x3p/zzHu8sJ9g70rrDCMdCRdTR+K3P6wnv8SgCM4NT1W7gytDTOjA1h3AnDIzuD5IoEPW+jfsrpU7P7SE5CHQ203rkYuWmCeqKNRZA8FRcEUVbbSSwWaGFg== 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=8CQuPWy4s2VTsgnwF9N03aOaS+o2BXhr55Jt3JdVV1I=; b=efWGTXmoDPIrZilueHN0RIT33uL+BkMMgAVjyDOhFMsNqf6hOYOyzvJ+Tn6b2DKlsD8Mat+LrsKFUC3cYyUhrse/QMMSxRYDe0e0al0BvDWFgPpP8lpbdqnt6jLmXRP3kF7v0lx2dQX/m+iW7dXOTmWTQQDTgssYy6rWHkXHkEujvjlnQxC1e14Nszb69E4pUA1ywLVeqCw36wY6MM4hjGG/iQjPXY6sWFNiP8wpHsD7hCeai7HjCvIO6m+T4VcOmvcWb/8lkG2mfRXWVdMuBxjzwb3DzbV/ooAPaSNe213dEmpP9l7v7XPaRBuUFp2UI5M5q6HCnDs9MZuemSkwPA== Received: from BL0PR02CA0138.namprd02.prod.outlook.com (2603:10b6:208:35::43) by SN7PR12MB7324.namprd12.prod.outlook.com (2603:10b6:806:29b::12) 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 10:56:19 +0000 Received: from BL02EPF0001A0FC.namprd03.prod.outlook.com (2603:10b6:208:35:cafe::90) by BL0PR02CA0138.outlook.office365.com (2603:10b6:208:35::43) 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 10:56:18 +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 BL02EPF0001A0FC.mail.protection.outlook.com (10.167.242.103) 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 10:56:18 +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 03:56: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 03:56:02 -0700 From: Amit Cohen To: CC: , , , , , Amit Cohen Subject: [PATCH iproute2-next v2 7/8] bridge: fdb: support match on [no]router flag in flush command Date: Tue, 17 Oct 2023 13:55:31 +0300 Message-ID: <20231017105532.3563683-8-amcohen@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017105532.3563683-1-amcohen@nvidia.com> References: <20231017105532.3563683-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: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A0FC:EE_|SN7PR12MB7324:EE_ X-MS-Office365-Filtering-Correlation-Id: 0090f1a0-ebe5-47c3-7b0e-08dbceffb13a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sOydGwvfYwaE7e23kEEh5gSv4XaqGR/z2ejwA90RIDbVQlpQ3hJCg9uDJnO/IESDKPDKQJFdag7j4IdzvZBhLDIHnN1G32OLK4gVxMMeEtcnJCnr6OpO+vtsJCUSGl6feFCDCfw8jOhOcgOMMEkBckHohqWpKwLAdP2DhQXia5xNhZWFR6Z8ZVbKkVqnShdb2IlPs87oMM+cY2VRDnAT6r5vH423xE7HFqhtIvaMx2JvxntFC5hGvUKgMxdkJSC+Sfs/RVmLeQHlMZDkirvZy0uSmSRfQUSs+C/g/fRopw4WSWOgOIgNt6u1Wwsmj+W8AFia9V/3juRMqkD0sStqgb0RuP57BA+A4iEGO0AL7EtrtP/55cXkYmuWPvk+iIKTJhgopMz2lIAFU/U/U/BLRhn1Z5Rto7uHidWcWza64d8G2KnWmpidlP9srmSUoLjg/L5b7gj7wLgC0bYyjZt3M7KBRkwWMplbi7B6pYVMuAwBLgIZ6wnIRl3oyC1R1GLBuTiAxY1JozZ7TGA8nozW7TtaZ1srgKKpKI+NRXTOG66KSkrqYlR2Bjpd7Aj6b+o88GPZGdJUHrMFQDRg+Y+l3l2OIn0BHYqehi3u8limXrYiLpaZtN9IAubV1CBS+zXOaw3IVGsFxVWj2PrrQeRG0xbDr1CWEbvz4J6dVWshLqV1htcSHd09AI9VgwssAJFUSgtJR57cGJ1hvdHHRO43WjFwpbA7xWEoYbeBv5PrD6MMVN2XKoFtmKLskLHvg8gi 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)(39860400002)(136003)(346002)(396003)(376002)(230922051799003)(64100799003)(1800799009)(82310400011)(186009)(451199024)(36840700001)(40470700004)(46966006)(2906002)(40480700001)(356005)(7636003)(86362001)(478600001)(41300700001)(54906003)(36756003)(70206006)(70586007)(6916009)(36860700001)(6666004)(316002)(8936002)(8676002)(40460700003)(16526019)(66574015)(26005)(82740400003)(1076003)(336012)(426003)(107886003)(2616005)(83380400001)(4326008)(47076005)(5660300002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 10:56:18.5626 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0090f1a0-ebe5-47c3-7b0e-08dbceffb13a 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: BL02EPF0001A0FC.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7324 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 8311fa08..7b444366 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 e3051f89..e5c6064c 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 10:55:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Cohen X-Patchwork-Id: 13425020 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 CCCA141A91 for ; Tue, 17 Oct 2023 10:56:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="jpprEmYe" Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2081.outbound.protection.outlook.com [40.107.223.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3643511D for ; Tue, 17 Oct 2023 03:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XXpRkMmSY+pJ+kvk1yf+DZ/iucULqjN9aPWC1SmA0GGQQFbd9XsP4FzTgWLWuLKS4yD+NP99HchyXAaTwgJ/u5kLJr7bsbOGAbdGJ6eC2P5rVKbgqD8AzgTfHfMEibHP7p8r7T7ACrpYQpK76ZTXSE8bCxRSHZbZFeWOCvRC7Yg+ros42U9ca8/+M+5XBISEpCdSFrrCIjf7HGkB0jVnWKcsTvmj9f/+5FQDyWtIx253zEBwOoh1zJwLzI1DT1P+3cuHS77J4ZqIGbVRWZa7dsJqBlmE1cEaCKMozZFNKn8ueXgOc3IUEsk6/lgoFOZkGcs6JJ4JdE9E7L64iXZW5g== 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=/u26NP98Lpbkhrdc2ZvS5NmrCK/8yrJ03Lj1/3+IyZk=; b=XqpkPbe+x3wArw/vmh6bK6r3ZOXQRbmIux7CktT0HquyqaTwn6wNPlgFIb8bL/pZiFqeb/I44yg8qFiG4L0ETO2MtYcedarbM/PMb35l5iDkpPSJwCuuo62xryHzfVtUyfKM55mtG56yKTF/Q6lRa/LFAVbaQjxXRXnDbLczcR/5G7XNDhQ2yLoTpIkkF5jtnK7UzlKgnF2Tme/VbVdEzYkwmR7GFNglUFexnErtqpSho6Jyk3ZoaXD3CcYtzui2Zak9sHOnWUdSIjjbmOqrKH6Ce6F+O7rAcV2PgKCtc5SCsW/IzBEK/VsEI3RN374toIa+rtb1URTo2vCJfJHMWQ== 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=/u26NP98Lpbkhrdc2ZvS5NmrCK/8yrJ03Lj1/3+IyZk=; b=jpprEmYe9qkTnIHdcLNWq77TDfQcoqyfftePPx0xdKDw8yvtLr3xHD+bdMjcRcXbEJU6OLCne8n+hhJY36plgGxcgkvqeTL+slWpfDFfkQcu9uePzZYJv0KRqmP2LHUz2cTn3k7eRs5Ci4IB7+BO8i5OxpQa22LNoCKro+vgmLRJEU96SSussoaGxTrw64pSXfrC3Rc5K4XFVi2AHXRKhlseO/fHz6Psz7jU1BO131RISUtQDRQ9yz0Tx5ABOQRmmRnPvatcnoCwGnRtYs2mTN2gQ9OK/lMyQrwWsOyGMSqyD7fobshgjpyUUAsNFPscGtJAuU+2UfnIGXQgnEM7+g== Received: from DS7PR03CA0228.namprd03.prod.outlook.com (2603:10b6:5:3ba::23) by DM6PR12MB4481.namprd12.prod.outlook.com (2603:10b6:5:2af::11) 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 10:56:17 +0000 Received: from CY4PEPF0000EE35.namprd05.prod.outlook.com (2603:10b6:5:3ba:cafe::87) by DS7PR03CA0228.outlook.office365.com (2603:10b6:5:3ba::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 10:56:16 +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 CY4PEPF0000EE35.mail.protection.outlook.com (10.167.242.41) 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 10:56:16 +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 03:56:07 -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 03:56:04 -0700 From: Amit Cohen To: CC: , , , , , Amit Cohen Subject: [PATCH iproute2-next v2 8/8] man: bridge: add a note about using 'master' and 'self' with flush Date: Tue, 17 Oct 2023 13:55:32 +0300 Message-ID: <20231017105532.3563683-9-amcohen@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231017105532.3563683-1-amcohen@nvidia.com> References: <20231017105532.3563683-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: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE35:EE_|DM6PR12MB4481:EE_ X-MS-Office365-Filtering-Correlation-Id: 0adec836-1c9c-4414-cfa3-08dbceffb007 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yb7/aO1fheCO2hHO1BeikpuzvwzScodjqiAmrNORg8Qp82ppi6XE6W6/6llg/5UD6cJSisvFkJwpoVx91mDoYEDkC4ZGA1PVYDHaE1bUioSGcPO04ntI0mwSffsWZwjY9ZeMoBKoI3uD2z2DZah5iieFe1dT4sIKBc/YgVbV+1WRZ4xrmj+pBuf9D0OqI4zXXIww5q8CGeauCM1HTqu9qAmq+sYWjV6wOFdJLA3zezfUxvlzTurd4hMRkMdkVL9VHrHVRB1geGMpRIQrMei++wnh1NGQM6fOQtnK24qo+MiWkZukR2/ewr7HM7UBHLPfWhALscA0RH5nEqrQy2JHQPUPWojIFyL5YOPjQ+9kqlD/mHw+jdAakdb0FNT63tOSpoKlSDU1aev8n4c6g0TbKo/0DLCue5WplI9SOTEbuRdgXBEAqPs2OdatNPbrHxAqvSZVZiJe+dACVwCru7iExSzY8HknNnsbh+qnDallhLLKS3yCyP1lZ8dGj3VuFUD7NeR43h1qkXG3ERuDd+cJcxGf+eo+RXEXUKVqlshkrsT/kU4eO337FdKzzp9Nnzqdifd0yCfKvLqHko8vCwRrXrjElzJ9WWXBkV/dDaumYhQo4I+WgT5SY/pTe1tFHMIZukX2xVdFGAYAkvfQKfJMnxlxdxL+FzTtKb/zkXOwl5v3T06PxRwIM0D6dSqJquljFW0N1YOfE86HrbXCOo4xiruUL57DlzCenwGIpvpWantb8n+7Jd45zYSMcjfhNUPR 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)(396003)(346002)(376002)(230922051799003)(1800799009)(82310400011)(64100799003)(186009)(451199024)(36840700001)(40470700004)(46966006)(70206006)(70586007)(40480700001)(316002)(54906003)(6916009)(86362001)(2906002)(40460700003)(5660300002)(41300700001)(8936002)(8676002)(4326008)(36756003)(2616005)(1076003)(478600001)(107886003)(6666004)(47076005)(336012)(426003)(82740400003)(7636003)(356005)(16526019)(26005)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 10:56:16.7247 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0adec836-1c9c-4414-cfa3-08dbceffb007 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: CY4PEPF0000EE35.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4481 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 e5c6064c..07bb9787 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