From patchwork Tue Mar 21 13:01:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13182711 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A13A3C6FD1D for ; Tue, 21 Mar 2023 13:02:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230095AbjCUNCU (ORCPT ); Tue, 21 Mar 2023 09:02:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229911AbjCUNCT (ORCPT ); Tue, 21 Mar 2023 09:02:19 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2060.outbound.protection.outlook.com [40.107.244.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DB374BEB6 for ; Tue, 21 Mar 2023 06:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Oe2SZvP89SIvfZu3cYKq7pgsNH0GSY0zmvwvkyLpFrwC9zFrkQYum7oQ7nTKx2xS3HRFa/HKfYNd2+QKzK7sRa8Tbl5JFUSYlUVXCUQScj3e/zK/DgBmd2Xt9UquzOGVN14dxpY0x7lgohdNIKnLGioerY1Gf5nrNC0TviIOD0NfdHgfxtcva5nkHHSemtiE/mCN5JcWFo8iZBmWM3J6WKbYTawSpJvZPhT8L6YN3IiIi/2/P89z1oNBxAey7DZh4ZAyDOMnz458+jQJcosuHA9EkW3NeSJ7SDC1gisrLTV3BdQblR8kXSw2lXgBWfE7It85P6/+RTkuls9+ewWW8Q== 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=IgWUnG8JvJPslZKqCjAJJLq8HoZOvVVKP2P+SquhlEI=; b=YTVc0nEprOO42Jmxgb93N4Yx5WcaldAK7sZ7ZYnbF71OSoIyFWa+Ru8x2LTcuq9EjYlNXsRil10Y3WMmxpvXVxtSeCYfseEPVRaPLBRaSZMFol/er39CHrDVNZwUGCkI/sfRnPvR0/XcoKrnZIsByBeLPAqX3TJItVlKHymyvGqyBINfIN5RWa7y4cCtzwClNHq5QUxuH6RpDoDwBPjItarALhpvqngqsfVic5DNO/aux0obxt8vP4ud7LrK6RtHBJPriSNDCxRjV/je7j2akO4oSd9+LwuKghHOK9KRpt7jRyjMtSqbGOkSPHVstmP4QQPI43YVFvOxSrckzmoWlw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IgWUnG8JvJPslZKqCjAJJLq8HoZOvVVKP2P+SquhlEI=; b=bH9vLWSMhxOopEltVEYxA4uqLK2YX8erjIwWuIOVAcVP7iT3a1e5GdQ16rxIGcdG9muRYVf78mBiIyn0UtDdJe1AXcZwdxtlcXrv5xSC2jZ5O9a8+4GloPzMjQW5WfpC3E03nh+rPLwWf6b0VFRlnXkA0ZxlQKbX3hHpg0JTYqiSsDtI+yXSop/v1YIT/NWzZGcLluJ5O/+hyfQltZtEHeIHPZzDTiXjmzpTKDQnMXLx5vJYDUkJO8SMCXg6u6aqoVSJpiLhAepZkXV9idCJekfAiOynSk2p3mqxDZnEn3laY8oF7gdQBckibWONjkjjKkvfeW16wVIia5GcIE9nTw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) by MW3PR12MB4395.namprd12.prod.outlook.com (2603:10b6:303:5c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Tue, 21 Mar 2023 13:02:15 +0000 Received: from CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::d228:dfe5:a8a8:28b3]) by CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::d228:dfe5:a8a8:28b3%5]) with mapi id 15.20.6178.037; Tue, 21 Mar 2023 13:02:15 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: dsahern@gmail.com, stephen@networkplumber.org, razor@blackwall.org, petrm@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH iproute2-next 1/7] Update kernel headers Date: Tue, 21 Mar 2023 15:01:21 +0200 Message-Id: <20230321130127.264822-2-idosch@nvidia.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20230321130127.264822-1-idosch@nvidia.com> References: <20230321130127.264822-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR0802CA0043.eurprd08.prod.outlook.com (2603:10a6:800:a9::29) To CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6179:EE_|MW3PR12MB4395:EE_ X-MS-Office365-Filtering-Correlation-Id: a777c893-d797-41f8-7469-08db2a0c7e8c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tZ5/tcOwTjoWS8yvEYFiI/dU0q5V99yP5zgPzkqpKsShXH2jEgg6CBJx5fJS10yo81MBnCUKFEClOD008KrAiWSec21hEY20ILenj17ojY3rd7975+xgFHYH/S4aEtFJlM7YRaS/PGrsNb+ZdJVWLWpT2npRLjc5nAGadLmHPgd451baZ+3yE2Z9Zi++qLcRf9n1P5NLPV6+ZLYDrP6Ck/w4VqyZst1QSi4In0Yuf8oMaN6sG3vOgd5R760aLh9R2j3Y7ypaJkfZp0NLGl8lRZvDq0sJc7iiZKCChNrECUYaGUSq+VS1wfL/QRd0+uJKLxmv+03fg2uIesrTE8I8nhocMrwsRRZJIqmaGW2wiElddfejHhqA2/fFhC+0XLpmU6qAltrHgHmmK3eK7U2vOLBVK1WuC6GBKKIaFNCE/iF2IgsWP6T9/I4+QMIoU6pnZ53fmP4MHZ016EcxwDDehGPqXErVZ3ZC1xI415fO+p3+Vikj6qUR8kHjAB0wMDgyonwLcK4eD2ozDB7WLIBUT4tEFPxFyoBxPd9sCXK5S4E0I0sXrFF/KzaRRvTPWj0jEegau5iH3ZhCG0sSIEBiK9OMKP5hvBgwN460NVB02QByXUq/t+L22fYSFWYZCkDZdlLwkn2sE2mMqqfG/iFeJw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR12MB6179.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(346002)(366004)(376002)(396003)(39860400002)(136003)(451199018)(2616005)(6486002)(478600001)(6506007)(6666004)(107886003)(316002)(66556008)(66946007)(66476007)(8676002)(6916009)(1076003)(186003)(26005)(6512007)(4326008)(4744005)(41300700001)(5660300002)(8936002)(38100700002)(2906002)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: I/OTYsb9pJyYHmUg7tHLAtoZf3ZCggsghl6h1lRMoLhDqYzEa+0BfdpUEGCwO94xNZV0hct7EoRGPFXTlmO/L7aUTyDKu9/EzVm8Rheeo6YNdam1gcSIN77tqkQ+BJIH1RKk1FVhbQTeVhrj0MTVFlWwDabXFOs4sbwwZOzFbLHVz1zQoX9JC1TacLhPLhHb4+UDt1371WmIpvKRuUhdCA2fSC8F+B8C2vnDQz0gBQumUrrtwgQSpzEMh8t5FYH+g+TVjpbD2qNoGw6P0fI9iWma0e87lQfH75eX3M2+n2HA3hqrFDUuPjYiWY53JIDbWkY6G6aKkutN/WGCyl63YifHFKVnV+SY/ESXyQzErvkkZSJUQst7OjK/+nnzI5Fz70dFIZGRrM0TPCB/EgsdyPOZA/KyYW+P8Q4pW7EY+heLCoWbcfaRrJmcYO9QY9SGog/c0TqUn3VMTGeAPft/sjgZaqJ+WToGwmlxrRE3OWJHDAawgyeceDKnlLyiBzuQIsWONiC5u+F9AKpQzrgVYRAY45Qc5HQqxlpyDwRrOJxEJbKFUnRAKt12DGTwXjvwgAf6cmkeSi4NSapdG278hk07VwpU6VCsse3xO6oJP+Y5/2dAap9GpB5W1oIK4ShGYX+lpsUi8hi4XgsOgdVawadJqn6/0bM+JKULH+cRMmztGRx+BBZr/vDFbcnyIKWA4jmAqYqR0a1c66N533XRrZUYyEr1pm46EYt18EGsPY0SnRXhiy5hsXf5nlyVsvWOSoCdCOXNuZYQdB7FoSa1LxnIrxd2wX5yFWYwdxsMoDOoiK5b/3WgKC7ReIyyoLBF76kuWDeBIpsl+0ttf77R7sqCN7bvbjj+MIn0UETh0mYg3Xj7Jg3/ymW5Q4Aeoe3+7Eaq9RctDJVZ3pYvP8L9n0lexFCr3d6Rj38nzjMi864hrd0fh58wiBztSZB/iiksQyisOZBiAL81w1XNmCxc7dsH/XoJD5kVWvDnKscTtWOBS3PJp6V1+GEMJ3DTJD3+zVGhWgnxCHsPSuOrUT6I1STzF46I3YQA3oA5X1rkQ0oYoAGTrhIev2YBj0D2O3J/El3TlrwNTuwGWL4JrgeZ6btRb6DwUDs0P2GIARI2jPNMjZUaZOGLVmjmzdlxBogAz0dCLPHCvnABOeBc68MaWpS+SfCJFyYACPlO4G3ev+kdoud83piL1F1cllrBubayfTbwo7aE6PL4F3sV2zAgBWme0WWYI5HNFJ2JIcaB4LMqv4fbkfK0UvjyqD305Y8ZqM2VFezKz2chKE0EswVG39/2n3mmnRTp1C3osmX9UJdqynU2x0LoJUvfzA6odZh3xh3StG89yG7AbNyxWvRjvmbkpYkBzkbLvXqACZIEMwInrFAbHsp5vUwq8+VDwe/9WvSi/HApL0EISvHi5N4VIoXXkceUA+IatejikHLCvljpAfSF4oS0MimV7QaJ4hQs8qA0fCX9pMFa+1bfRQd/ZW7kfMg9wogCEN5JYqmliGYC6UGROKPeLXG6yLUld+n1tLFgjrv7KaHJ2cKsvgaeRdKZuE35lAtyzjtVnqqN6mykVKMSMURiox6lxFZnJWC8 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a777c893-d797-41f8-7469-08db2a0c7e8c X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6179.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2023 13:02:15.5583 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6gJ7dfRwQs05jCnHc3+Cl/NfT3Yi6AEsH05i2+tZFS6/o9GB7MPkuiWeNRihfAAo9RFTZXfhaQyvVw0KARNy9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4395 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com Signed-off-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov --- include/uapi/linux/if_bridge.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h index 921b212d9cd0..792db9800aab 100644 --- a/include/uapi/linux/if_bridge.h +++ b/include/uapi/linux/if_bridge.h @@ -633,6 +633,11 @@ enum { MDBA_MDB_EATTR_GROUP_MODE, MDBA_MDB_EATTR_SOURCE, MDBA_MDB_EATTR_RTPROT, + MDBA_MDB_EATTR_DST, + MDBA_MDB_EATTR_DST_PORT, + MDBA_MDB_EATTR_VNI, + MDBA_MDB_EATTR_IFINDEX, + MDBA_MDB_EATTR_SRC_VNI, __MDBA_MDB_EATTR_MAX }; #define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1) @@ -728,6 +733,11 @@ enum { MDBE_ATTR_SRC_LIST, MDBE_ATTR_GROUP_MODE, MDBE_ATTR_RTPROT, + MDBE_ATTR_DST, + MDBE_ATTR_DST_PORT, + MDBE_ATTR_VNI, + MDBE_ATTR_IFINDEX, + MDBE_ATTR_SRC_VNI, __MDBE_ATTR_MAX, }; #define MDBE_ATTR_MAX (__MDBE_ATTR_MAX - 1) From patchwork Tue Mar 21 13:01:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13182712 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA3CBC6FD1D for ; Tue, 21 Mar 2023 13:02:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229826AbjCUNC3 (ORCPT ); Tue, 21 Mar 2023 09:02:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbjCUNC2 (ORCPT ); Tue, 21 Mar 2023 09:02:28 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2047.outbound.protection.outlook.com [40.107.244.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FB724D42C for ; Tue, 21 Mar 2023 06:02:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PBK8ZOZhb3QQTQRQHODcnAhY41lf/JRevm5yD1JKxuwZCZCBzxu+O91t0aH6Nnhz9aEdbGK26GgWCAWbcAsqWyOb0GZG5ExuNagkRwGkGAVIdGYgb+2VZ7TQvyJ0TfLd2ilpfI7Z9KDwg9+JjQzrfvPQc4GOKQeZdiX1C2oCxeo0DZrIkKKsJV60embSjOSeGbHjsct1Jerr8ZwkcTwwWeZdE4OKUmcyqRFC6OiYrB9SM+1n115pnoxOOTI39Nzlq1V3DsViByXebj/luRIzYiviho7doZqzCxBQbEyk7CG7s4CyaN6CDiMDGrdUc2I0xGg1GoCy8OI2B+G/RyxM/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/kICGqAsTOuEXgGzGOyPnSwmr7ktAWnnJL4WAdyNwRw=; b=elqtKZv+84xOT7Mp1JUS2tQkpmH3JR4FLuMVhMfi8ezl4u++Tk8F3mZiIT1MHFOjr7+cxmNXeYLHviyql6u8FmWpIV3aqaEUX9FcmxF93lFtBYq/mxmmlddIbbCcga3O+BAAY/SQjc1D+Oxzp7PX4swPXgEVdr9ME3wUYTitStv7c+1/andvQMamguP5VO4nA2TfvXFqOl6vxNMBLMOo/09IztFObFhlcJj1vxXBd174eq9o7RrpCPH9DS0JIXxAfmq+GkbbxCLpejyAcvz4xGLqt8de2xbNV8mFB2kR2FAYEmZL1B9L+Gt3OLGTfB/VUyBJaVcFVnl0ZwSGNeJmlg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/kICGqAsTOuEXgGzGOyPnSwmr7ktAWnnJL4WAdyNwRw=; b=os1oqf+4WZY/OYMfvginzvyrQeoDKC/ZCLgOiZXCpBJWIcGsL2QxCgLRbeUGFQxXprYuAl4M3/VNjlyBMSh3Yj6YjyXQ+hXOZQPW7QyTBiz8Nd4Lebd5pLpADQXcvPRX7Uk5iLKDuPOXUzUf6PV+JeN8zO8exMxAPMlMLNxs6ZVM02AyThS1rHVPMj/JzWee9Oc5QXdqpBQja+Dd5tpgZcjsU7dm1wjwlA8DUe6i/Du46Nioa8CwXZkZQc6PyiBxcVx9OQ9V7kCQfojNTq0H2ftm+xgaaU6VSNoEGt3JfnbsW7yHpXTVYdksORn3kzh9AfN99Gmm5Tx4JOam9K0fjw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) by MW3PR12MB4395.namprd12.prod.outlook.com (2603:10b6:303:5c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Tue, 21 Mar 2023 13:02:22 +0000 Received: from CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::d228:dfe5:a8a8:28b3]) by CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::d228:dfe5:a8a8:28b3%5]) with mapi id 15.20.6178.037; Tue, 21 Mar 2023 13:02:22 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: dsahern@gmail.com, stephen@networkplumber.org, razor@blackwall.org, petrm@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH iproute2-next 2/7] bridge: mdb: Add underlay destination IP support Date: Tue, 21 Mar 2023 15:01:22 +0200 Message-Id: <20230321130127.264822-3-idosch@nvidia.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20230321130127.264822-1-idosch@nvidia.com> References: <20230321130127.264822-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR0101CA0067.eurprd01.prod.exchangelabs.com (2603:10a6:800:1f::35) To CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6179:EE_|MW3PR12MB4395:EE_ X-MS-Office365-Filtering-Correlation-Id: fd82fe90-bedf-4205-95b7-08db2a0c828b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xABKy35vvqPA8x0lqSiT+pzX9iJ/79DJXtNylPBWx9ommhih2V5TuBBJaCo/680Hwdy/gHNwsTM4oeArdJYgSoyGfvlrAGuzL6uncs7Bf0nQgN8/FCFTpNNjLCIc4dy00oO6C7EmsZarJIj4WCpo9yc9ERa0UJ3t4s+olhcijr8IQXVPnCq2IoDW6hp42I4mGE/yJ0XVmzY33LAHrgt8VKFF9GXxesUew7zcFthRv/lYMJqv5oU5/sA0V2IPVPTpKe2sARyZuRDaqbcOJuhgaM/EYAg3iYSpYS0Wkd/CcGLtj8Ay9i0CB2z/ykZodnlWKMxWuVevofW6UvXQRoFdd/OOUmgnAnrzYccgCmS3EHDMeekl7tLsumr9Xd+uxpDh7PBBjl6Je1r2NHt9ZiXsZEPG9w2AA1OtePpGQB3bXRPr1guvE+ZqMyuu2PJKQZES/K20o+pEZpaH1UT3N4tb1yk45MrwkDGdichL+HHTwA3fp3sTQC1StpepPqmxaLiz6iRej3vKrp/t3uweUaTq+6gIiHyx7sKUCh4hmuWdV8uZ48nVirMbJV00mOuAoiuubUu1v35tPwza67znAj619ZhifMXo7mt8try03EYxQWshndI6i3xTXEK0wQC36V9nV/jgIhaTFIARqMtAptWkXw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR12MB6179.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(346002)(366004)(376002)(396003)(39860400002)(136003)(451199018)(2616005)(6486002)(478600001)(6506007)(83380400001)(66574015)(107886003)(316002)(66556008)(66946007)(66476007)(8676002)(6916009)(1076003)(186003)(26005)(6512007)(4326008)(41300700001)(5660300002)(8936002)(38100700002)(2906002)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pK5F8W+NMyXvVV6N4Fyr2Tx6/wtI7c9qtSc8GkymTNfkaxWLMgbPqL4fZMx8r/to+KY/NMNzNJn9/Ts4KrFzZlgxI3AJOu3ZIzVsKuC6Eco/MxJSXFGidMCl5K6bLiGaZVSFjCHmTdNTK7xsl9+fTjVt2q9vgisuJZSCCFAC0pBAwbWefgffsv7tHzadvL2xnX1Bz5VBwvC4vKyxt8qKj9awApyAojEQPHc/N2GPJXge/ahxDhURpf1rm9E8WsuRZ3U9kVZzZxMEYTPOr2PAuKkhjfd5a6oF6v5j9ReZJ+w5bUZ78iNZNrxfE4x2lqElmqYNnLXLwvz91OnwE2ilPMMIQ4yHZTcTJccfvz2kkniZ10oqqDybLujH+IfNhXBHpw4jzKyjKUw92Z4CSUwOpEV2LoeMv6GCt00Bzwxrk78NRzc+ej8paCCOWOU4obkwE8XERCuHelJJzWFP55kZRH82XB92g2pI7Eh5S5vv20/pYMiprzR6UfqoZkTbeMTGRNc0KH6I3dXRyeCtLBsgH/pT2XXav6PHsmBOBo6RSmKPdGFbAMnCsX92UomxLBnhGhPn4P12sK2S9q4forS8yjsySe/ZElFMYO8lHkq8uohMwex2PqKye2GsRVMjC7ZNqP75Dzz6TRklVvOmBZuazeiAiKX3g2y7ZLOvojmjaKmttPtLFu49IbdWSDUPcTCHm8tBoOrSsUjH1hskx8NzQUcuw8QqXRRDjd2k/B0BHd5CuG0Gux51a3XSSTyjPRJ8VR7qQ/1uXw53aNuIYV96DITlAy51g7jC41dAJx8zkXs8Wbe25OYyTxXDfE3LDtMtH2kSPyA7sKpxwUMWvWaI3IiAJNki99iVawiVcHqMQ4wqxPQYejXkSkgm78/UKCPS8CDTwXI3RDDH4kIHfGVgmlEJ7pI6T8UZMt/19qa4KK56lTWV9/j55muhEbJX6aBH2GeM+/OK6wBf+rXJeg8Alka2EqMNj+oBYzYUmLQySDYUFxuWmgnJYzM6aVydhmKwDDiv+q3WEXeEU2E7VshMhlPdDoMK6XkG5+b5emz2sUHq6YVUKWb1eskMp0sY2AJPRO5lNLFLMBa0E1FoeKhREmY51ctqltwHxL62c0Qe7qNZuI6bu7ZqB2XA++Ehuo7Qz5YVUvVxN05KAjvTZVfon1OTyQVJCtOt6b9lNn30ULdU3RnARYVK/tG/5CTycbti3h6n9vROvLlJvGDH28BD3SoGI53qXX5LaDZ0KfNptjVAqz7ZUm/uMbjq2PGwVft/ScX0aPNxWpjocu1/SYvo1j26k3ul8Bo4Pb/6lQwZOvDp+sY5BTMz6NABNEC6apwwY5Pv18gOAl1Lp1d/swYW8l1yoGMPY7vjBl5Y/DaasP6LTLQNmOqWZ57nkJS/04hSpaOoZXyUFqIcEsLSgi1Y7+XZuncQbIdDsDDX8XTt5k1sD86ZO2BO6TTmVgAT8gWe5P35uQMooiJA2pYvmc3Bv+Vbn38lACZfaHqtoQcsui/ZsuYdjbvEL0b5Rx/IKQ1YUZinZ1GmKFk4JNfW8jzUmK2KbQOQ6j7iSOXzMiYz20DZrp0d8kDSJ8b7ZRzOeL1V X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: fd82fe90-bedf-4205-95b7-08db2a0c828b X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6179.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2023 13:02:22.3248 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Q63FoBiujYQhdC/7PZAg/MVg3TkQsL4gDl6HX1HE+KD1dIWHfI+fn9N9R8BZxd+c2GNUt80duBpLmc0wd+cAJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4395 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com Allow user space to program and view VXLAN MDB entries. Specifically, add support for the 'MDBE_ATTR_DST' and 'MDBA_MDB_EATTR_DST' attributes in request and response messages, respectively. The attributes encode the IP address of the destination VXLAN tunnel endpoint where multicast receivers for the specified multicast flow reside. Multiple destinations can be added for each flow. Example: # bridge mdb add dev vxlan0 port vxlan0 grp 239.1.1.1 permanent dst 198.51.100.1 # bridge mdb add dev vxlan0 port vxlan0 grp 239.1.1.1 permanent dst 192.0.2.1 $ bridge -d -s mdb show dev vxlan0 port vxlan0 grp 239.1.1.1 permanent filter_mode exclude proto static dst 192.0.2.1 0.00 dev vxlan0 port vxlan0 grp 239.1.1.1 permanent filter_mode exclude proto static dst 198.51.100.1 0.00 $ bridge -d -s -j -p mdb show [ { "mdb": [ { "index": 15, "dev": "vxlan0", "port": "vxlan0", "grp": "239.1.1.1", "state": "permanent", "filter_mode": "exclude", "protocol": "static", "flags": [ ], "dst": "192.0.2.1", "timer": " 0.00" },{ "index": 15, "dev": "vxlan0", "port": "vxlan0", "grp": "239.1.1.1", "state": "permanent", "filter_mode": "exclude", "protocol": "static", "flags": [ ], "dst": "198.51.100.1", "timer": " 0.00" } ], "router": {} } ] Signed-off-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov --- bridge/mdb.c | 51 +++++++++++++++++++++++++++++++++++++++++++++-- man/man8/bridge.8 | 15 +++++++++++++- 2 files changed, 63 insertions(+), 3 deletions(-) diff --git a/bridge/mdb.c b/bridge/mdb.c index 9b5503657178..137d509ce764 100644 --- a/bridge/mdb.c +++ b/bridge/mdb.c @@ -32,7 +32,7 @@ static void usage(void) { fprintf(stderr, "Usage: bridge mdb { add | del | replace } dev DEV port PORT grp GROUP [src SOURCE] [permanent | temp] [vid VID]\n" - " [ filter_mode { include | exclude } ] [ source_list SOURCE_LIST ] [ proto PROTO ]\n" + " [ filter_mode { include | exclude } ] [ source_list SOURCE_LIST ] [ proto PROTO ] [ dst IPADDR ]\n" " bridge mdb {show} [ dev DEV ] [ vid VID ]\n"); exit(-1); } @@ -146,6 +146,21 @@ static void print_src_entry(struct rtattr *src_attr, int af, const char *sep) close_json_object(); } +static void print_dst(const struct rtattr *dst_attr) +{ + SPRINT_BUF(abuf); + int af = AF_INET; + const void *dst; + + if (RTA_PAYLOAD(dst_attr) == sizeof(struct in6_addr)) + af = AF_INET6; + + dst = (const void *)RTA_DATA(dst_attr); + print_color_string(PRINT_ANY, ifa_family_color(af), + "dst", " dst %s", + inet_ntop(af, dst, abuf, sizeof(abuf))); +} + static void print_mdb_entry(FILE *f, int ifindex, const struct br_mdb_entry *e, struct nlmsghdr *n, struct rtattr **tb) { @@ -240,6 +255,9 @@ static void print_mdb_entry(FILE *f, int ifindex, const struct br_mdb_entry *e, if (e->vid) print_uint(PRINT_ANY, "vid", " vid %u", e->vid); + if (tb[MDBA_MDB_EATTR_DST]) + print_dst(tb[MDBA_MDB_EATTR_DST]); + if (show_stats && tb && tb[MDBA_MDB_EATTR_TIMER]) { __u32 timer = rta_getattr_u32(tb[MDBA_MDB_EATTR_TIMER]); @@ -570,6 +588,25 @@ static int mdb_parse_proto(struct nlmsghdr *n, int maxlen, const char *proto) return 0; } +static int mdb_parse_dst(struct nlmsghdr *n, int maxlen, const char *dst) +{ + struct in6_addr dst_ip6; + __be32 dst_ip4; + + if (inet_pton(AF_INET, dst, &dst_ip4)) { + addattr32(n, maxlen, MDBE_ATTR_DST, dst_ip4); + return 0; + } + + if (inet_pton(AF_INET6, dst, &dst_ip6)) { + addattr_l(n, maxlen, MDBE_ATTR_DST, &dst_ip6, + sizeof(dst_ip6)); + return 0; + } + + return -1; +} + static int mdb_modify(int cmd, int flags, int argc, char **argv) { struct { @@ -583,7 +620,7 @@ static int mdb_modify(int cmd, int flags, int argc, char **argv) .bpm.family = PF_BRIDGE, }; char *d = NULL, *p = NULL, *grp = NULL, *src = NULL, *mode = NULL; - char *src_list = NULL, *proto = NULL; + char *src_list = NULL, *proto = NULL, *dst = NULL; struct br_mdb_entry entry = {}; bool set_attrs = false; short vid = 0; @@ -622,6 +659,10 @@ static int mdb_modify(int cmd, int flags, int argc, char **argv) NEXT_ARG(); proto = *argv; set_attrs = true; + } else if (strcmp(*argv, "dst") == 0) { + NEXT_ARG(); + dst = *argv; + set_attrs = true; } else { if (matches(*argv, "help") == 0) usage(); @@ -675,6 +716,12 @@ static int mdb_modify(int cmd, int flags, int argc, char **argv) return -1; } + if (dst && mdb_parse_dst(&req.n, sizeof(req), dst)) { + fprintf(stderr, "Invalid underlay destination address \"%s\"\n", + dst); + return -1; + } + addattr_nest_end(&req.n, nest); } diff --git a/man/man8/bridge.8 b/man/man8/bridge.8 index abc0417b2057..2f8500af1f02 100644 --- a/man/man8/bridge.8 +++ b/man/man8/bridge.8 @@ -145,7 +145,9 @@ bridge \- show / manipulate bridge addresses and devices .B source_list .IR SOURCE_LIST " ] [ " .B proto -.IR PROTO " ] +.IR PROTO " ] [ " +.B dst +.IR IPADDR " ] .ti -8 .BR "bridge mdb show" " [ " @@ -969,6 +971,17 @@ then .B static is assumed. +.in -8 +The next command line parameters apply only +when the specified device +.I DEV +is of type VXLAN. + +.TP +.BI dst " IPADDR" +the IP address of the destination +VXLAN tunnel endpoint where the multicast receivers reside. + .in -8 .SS bridge mdb delete - delete a multicast group database entry This command removes an existing mdb entry. From patchwork Tue Mar 21 13:01:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13182713 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01623C74A5B for ; Tue, 21 Mar 2023 13:02:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230361AbjCUNCk (ORCPT ); Tue, 21 Mar 2023 09:02:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230337AbjCUNCf (ORCPT ); Tue, 21 Mar 2023 09:02:35 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2067.outbound.protection.outlook.com [40.107.94.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 694814D42A for ; Tue, 21 Mar 2023 06:02:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JnSPRXxywg7q9BcVvP9hYxrUU3IcsEIx9PUDtTjsqfc8wovve51tFMr/j3k3+QsPVS1HZDz99XWCtTohf2XpI+1wLB4Ae1st8VG6WcnHqvJWfYCnQO59sU+0FkVgIY1Mer0Z7yUfoWWzPfAg0qygYmvFuAH00v2peeGAofix6g2r+lvH+iAlDZb1neO2IvBNWk8XRZUAiVYBJ1ITxUYDJp81ug6efZhMyqIrGqZ6Pro2EPghFOkAOG9lqdlFiEFHM0bx2U+N9E8QWG7biNSJCgc5dXO8/7nmDYweHDJqTToXZIa/wHcn0AiIsLrgWDYBISocfHl+nzNkZqVKUHhgwg== 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=7YHBc0R/PAhxeLJzCnHuoxJ+bzSBHXXLxTT/14zuwp0=; b=GKbjPyH13LJ0ZeAhEJzW78d0WML7hexA2Box9gwRZeIe+uKX3KnRbZnmmaDbawkMhGDmw2xo0Sv9grNsJ4ExLia9VRhc23FVgQAJQviCq6i1E1QbRs2I1j/88fbVbKbLHvlsmmYdSgP1d36rCnttxIxktNGbc3IS6e/OXXCNTs68ws00j67a8TT1AFT44ImalDiiZlYWJkgM7EEUs3kYHE+vTLt4rWKJbhs+8oVoKvJvWuhaRpDD6Y196Gh3LuRRPFfEZfTGi+/nOfrJ7b7aciv9aJaMHS6ciWl6fS/PGhktEu/qL4yhh7L8XfESUg60A7iZrrfq46qQo0IXTgHoSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7YHBc0R/PAhxeLJzCnHuoxJ+bzSBHXXLxTT/14zuwp0=; b=X3iazbsp2TsBXpCRzc/gI4nrdeU/S5bzB/iVZ+BiFaXSgKtXFAVIuM7SbZqY8iUWVilWBadOZkPHlERzmLIjW+/kqn1oqbPH4smvzmRkoc+YEQrFXETwbbUWdrCUEL+ul8DWVFF9SeLHgmfJ/B49h5Y4weZIavj5Nsg7fh1rzI98YAXoilWBI5YvvN6/8BJFcsARklF+606vbmS4xLS3HwhWXfsGdWA1rtXl1PoK2x/PbKy6Wt60B1VpvLFfm30WIHnJUDF6peXhI8//XErRX32P+ZEcISo5pX7fOv/EQMcxGTe5KHwBD9uDrkJCLMrKRUFTV42XtIu8A1Osj2vyTg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) by MW3PR12MB4395.namprd12.prod.outlook.com (2603:10b6:303:5c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Tue, 21 Mar 2023 13:02:29 +0000 Received: from CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::d228:dfe5:a8a8:28b3]) by CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::d228:dfe5:a8a8:28b3%5]) with mapi id 15.20.6178.037; Tue, 21 Mar 2023 13:02:29 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: dsahern@gmail.com, stephen@networkplumber.org, razor@blackwall.org, petrm@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH iproute2-next 3/7] bridge: mdb: Add UDP destination port support Date: Tue, 21 Mar 2023 15:01:23 +0200 Message-Id: <20230321130127.264822-4-idosch@nvidia.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20230321130127.264822-1-idosch@nvidia.com> References: <20230321130127.264822-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR0901CA0105.eurprd09.prod.outlook.com (2603:10a6:800:7e::31) To CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6179:EE_|MW3PR12MB4395:EE_ X-MS-Office365-Filtering-Correlation-Id: 26481924-27cf-4b25-43e6-08db2a0c86ba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4K7uIPCuHnQ/JbU0lWJrwBS/YTjPyOvYTvljoQKYkBm9Qvl5qJ33lLpQ5wikaLR3ZXpjtTlPMPGL7+ZAT9byMeSP7vuopZBH0ETFBCymevaCL4YG5J+9C2i6tDpcTpR9Tne8jsW9/ApqSxbHlSzMs4Wq6IPkE4qZ7/b+iKpu+v75y0DvqeZmbos8qdDXjtTzaIwmnn/BumQV+LrXl66YMFO+n6SuDpwAlDCAw0lTMuAIvui5kfQGqrcy48475xKOjkJqzwskfsJhdRX0ROM2kmBmowxIjkDRJbdSYEabftisQq6fKNEXX3Ce67SDzd1mY27XkJc6XJiSisaKLOFCr1s1cs+AlHbkbynV1D6XoGucNAmvpmu0vdVKPmpjuvTnqgIhItgQItX58CdKs39yxog/KgeXASHxo1wcXVnXzWgTKMaYBWWSnOrbG56WAoePI60E2/LJFEVyZFzkrZCWuKbCzl+Yu7ZriJCYIfNhb/zGIbhmTM9I/ElFBllx0OZE/elUnAPVGHOQtWnHIiYy+FUW0T1EcgAITsijj4Jh9LUUNJMD6b+/V0zSSK24vjfKDNN6OpGzSfaSRyey5WzxTbgjFJVPPplpvWlA0jOBWMROMHdsoMdQemYCwMXqGKk85f79oTMIInzoP/UJ4A1Ehw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR12MB6179.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(346002)(366004)(376002)(396003)(39860400002)(136003)(451199018)(2616005)(6486002)(478600001)(6506007)(83380400001)(66574015)(6666004)(107886003)(316002)(66556008)(66946007)(66476007)(8676002)(6916009)(1076003)(186003)(26005)(6512007)(4326008)(41300700001)(5660300002)(8936002)(38100700002)(2906002)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uespgYlKztEkfdP35NuvasX0lSV0Oorysd+ZkfdcMJvK4IHZCtcoc12zHEfZz0o4/1s61S3+S5sCzDSotMv/zBiOgduiUr6wZAE0d+mKjvxDl004VdWTEg4v8ynvxbGr7N6wO4g2X7nx4KnmtQLiT8aNfBIbwe1budgghEMF8RCN58vdpc+HvnniVucoahIwMVkgVR1y61KKWbhpapbyfaGyRdnpPIYxLiao37BjLAD8oeteAiNN7eGh56vFy4bRfIHaoGFoFuqcQpiY3zjnJ/F6kGPLzhrrcscOS4DbFP7AmnSossF1lwAFUv1ogtBzkLguFM/QQplCk0Ja/jC9GmI+bFD9L31fsnTZh1nFKgw2Y0JnJiac4/NMFgE3ufL/5C4RKRDgb6hrwAqFruEEcpPWh0sCvWkFS4vwH6+diiBueVSBiYdXjDXQ59zF66JC/CXI8rzSe1xphsTGmGVBblZVTKucoXxnj7iO5eopejraXPnas66JBAkry4utHQKudMLZgS1oN7axJ7TL2z4gIncm/Xr+5l1I7yrat1OT0TszE1BAYFWIiP00G5tnm60MaroAk43WVWwW/MKy5vkevAXXxyG+2oAoruYT1e16AEEWb+hteyx8d3F0JMDQl4fk9yB+nML5gTBQ9SJCWzJnLlOdWVP5/ghCFjEtO2Rh762aNYWi1l0RciNF0/pp0J596ZFc0dMzXkGq5YOTyrrigx3MxaDfZcsaofpV0m4LkZYJVULTGjVNGujgwn3VeOavT1VRbzrIhXF4TKcvv+3JPla2c2ByJtL24BSxSK6CKxCj0mh6NlEw/9gb6HfllmUL/k5l1qj/0wB32HxcPuIN/KhhZY63hxQ5slhVfm6a991/Pyanain4A9WcsOSJF5MCXUEHksNvvxdvQTGr4DmEwRj1fdisO1njTE55j2BBiPDw0y4YTxznW1vstV8ESgF8VTVZ1he7rR00JaTxubYfxn+0T7adHLtHvDt4wrMelmSzmjByTVsLFW09bkaCZv/BN6/mNzqR1wqCDElSakuXYZHx98s7eANyV3cCnQowa97m/F+wWQuuuYRVa5rJ/01qJzujgO6wwFdKzpwzZrUiyAPd6oCmEZEC4A8bNNy5inR84sKz9ukUPWALOmU2jxcVhaybceEvrwP/yszJTSxiMEr+KPOTmUcFDM+pABJeIxd1moRCZDKBJlSbHFJr/xy6cQqzWNHG6xwtKy80wH0n7f6YX+19Wu961B8yOFFYcUS1SomlGauFbpR3YKiMKbacMf3Hwm+CSL6H5jGAGf4P2QKOkwSi7ptQSTlUzgQpH6Z2AQ4YXn+AgZkbBOUS5t10jiznGq9YExiere2F+N4v/9nnJNuQ4UnEJsDzUgF4hhC+X1XWfRwf64bXTUqKXFYe+jeH1dCoPKAFlwzoKCpMg0rAc8KygIkQlRSF4CVlKTLDiOIB3VHL1PynneX7B7mOa3fx+epMSTuC3kIRSdzgBfi+FBOdPn4v889PUd3Bv6alSblCHugvfHlsXUzR9TJ2mlH6afI7pyC6eZbQZa8KW2Txck5OZOew6xPR6EPjlf2OaULGpy44Zt5ZCdXiPHEH X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26481924-27cf-4b25-43e6-08db2a0c86ba X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6179.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2023 13:02:29.2635 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TN3+CaXHrbER1INFO42e1WchntO4x3+9uHMIxy6kiyBQltof1i0ojFmrjVQr9j8p4MMBZF3kRi7v+2uAdYhjCg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4395 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com In a similar fashion to VXLAN FDB entries, allow user space to program and view the UDP destination port of VXLAN MDB entries. Specifically, add support for the 'MDBE_ATTR_DST_PORT' and 'MDBA_MDB_EATTR_DST_PORT' attributes in request and response messages, respectively. Use the keyword "dst_port" instead of "port" as the latter is already used to specify the net device associated with the MDB entry. Example: # bridge mdb add dev vxlan0 port vxlan0 grp 239.1.1.1 permanent dst 198.51.100.1 dst_port 1234 $ bridge -d -s mdb show dev vxlan0 port vxlan0 grp 239.1.1.1 permanent filter_mode exclude proto static dst 198.51.100.1 dst_port 1234 0.00 $ bridge -d -s -j -p mdb show [ { "mdb": [ { "index": 15, "dev": "vxlan0", "port": "vxlan0", "grp": "239.1.1.1", "state": "permanent", "filter_mode": "exclude", "protocol": "static", "flags": [ ], "dst": "198.51.100.1", "dst_port": 1234, "timer": " 0.00" } ], "router": {} } ] Signed-off-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov --- bridge/mdb.c | 40 ++++++++++++++++++++++++++++++++++++++++ man/man8/bridge.8 | 10 +++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/bridge/mdb.c b/bridge/mdb.c index 137d509ce764..893488211911 100644 --- a/bridge/mdb.c +++ b/bridge/mdb.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "libnetlink.h" #include "utils.h" @@ -33,6 +34,7 @@ static void usage(void) fprintf(stderr, "Usage: bridge mdb { add | del | replace } dev DEV port PORT grp GROUP [src SOURCE] [permanent | temp] [vid VID]\n" " [ filter_mode { include | exclude } ] [ source_list SOURCE_LIST ] [ proto PROTO ] [ dst IPADDR ]\n" + " [ dst_port DST_PORT ]\n" " bridge mdb {show} [ dev DEV ] [ vid VID ]\n"); exit(-1); } @@ -258,6 +260,10 @@ static void print_mdb_entry(FILE *f, int ifindex, const struct br_mdb_entry *e, if (tb[MDBA_MDB_EATTR_DST]) print_dst(tb[MDBA_MDB_EATTR_DST]); + if (tb[MDBA_MDB_EATTR_DST_PORT]) + print_uint(PRINT_ANY, "dst_port", " dst_port %u", + rta_getattr_u16(tb[MDBA_MDB_EATTR_DST_PORT])); + if (show_stats && tb && tb[MDBA_MDB_EATTR_TIMER]) { __u32 timer = rta_getattr_u32(tb[MDBA_MDB_EATTR_TIMER]); @@ -607,6 +613,29 @@ static int mdb_parse_dst(struct nlmsghdr *n, int maxlen, const char *dst) return -1; } +static int mdb_parse_dst_port(struct nlmsghdr *n, int maxlen, + const char *dst_port) +{ + unsigned long port; + char *endptr; + + port = strtoul(dst_port, &endptr, 0); + if (endptr && *endptr) { + struct servent *pse; + + pse = getservbyname(dst_port, "udp"); + if (!pse) + return -1; + port = ntohs(pse->s_port); + } else if (port > USHRT_MAX) { + return -1; + } + + addattr16(n, maxlen, MDBE_ATTR_DST_PORT, port); + + return 0; +} + static int mdb_modify(int cmd, int flags, int argc, char **argv) { struct { @@ -621,6 +650,7 @@ static int mdb_modify(int cmd, int flags, int argc, char **argv) }; char *d = NULL, *p = NULL, *grp = NULL, *src = NULL, *mode = NULL; char *src_list = NULL, *proto = NULL, *dst = NULL; + char *dst_port = NULL; struct br_mdb_entry entry = {}; bool set_attrs = false; short vid = 0; @@ -663,6 +693,10 @@ static int mdb_modify(int cmd, int flags, int argc, char **argv) NEXT_ARG(); dst = *argv; set_attrs = true; + } else if (strcmp(*argv, "dst_port") == 0) { + NEXT_ARG(); + dst_port = *argv; + set_attrs = true; } else { if (matches(*argv, "help") == 0) usage(); @@ -722,6 +756,12 @@ static int mdb_modify(int cmd, int flags, int argc, char **argv) return -1; } + if (dst_port && mdb_parse_dst_port(&req.n, sizeof(req), + dst_port)) { + fprintf(stderr, "Invalid destination port \"%s\"\n", dst_port); + return -1; + } + addattr_nest_end(&req.n, nest); } diff --git a/man/man8/bridge.8 b/man/man8/bridge.8 index 2f8500af1f02..9385aba0ee68 100644 --- a/man/man8/bridge.8 +++ b/man/man8/bridge.8 @@ -147,7 +147,9 @@ bridge \- show / manipulate bridge addresses and devices .B proto .IR PROTO " ] [ " .B dst -.IR IPADDR " ] +.IR IPADDR " ] [ " +.B dst_port +.IR DST_PORT " ] .ti -8 .BR "bridge mdb show" " [ " @@ -982,6 +984,12 @@ is of type VXLAN. the IP address of the destination VXLAN tunnel endpoint where the multicast receivers reside. +.TP +.BI dst_port " DST_PORT" +the UDP destination port number to use to connect to the remote VXLAN tunnel +endpoint. If omitted, the value specified at VXLAN device creation will be +used. + .in -8 .SS bridge mdb delete - delete a multicast group database entry This command removes an existing mdb entry. From patchwork Tue Mar 21 13:01:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13182714 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 856C8C6FD1D for ; Tue, 21 Mar 2023 13:02:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230349AbjCUNCr (ORCPT ); Tue, 21 Mar 2023 09:02:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229636AbjCUNCn (ORCPT ); Tue, 21 Mar 2023 09:02:43 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2045.outbound.protection.outlook.com [40.107.244.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCD024D2A4 for ; Tue, 21 Mar 2023 06:02:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eJXwnFB5G2RuC6HmZXPXAB+bIe7AKRlE2G+B8Hpjlmm4cPqKha5Pet2JEDLN4nbnScUpc8bNbWhqbxstCJznDw0WozpQt2nUWnP23eQ97JEUiwJ7B5evX5tcz/cQqvaAJwWXNVJJzHUu3NM/ZFs8SYLFm6NQU5ohD+9fnuktPXza9YxLuUFpy/Z8kX0DyvjOispnihQB4fB33L6djRD+I997Ax7JC29Z7UA01dCFuHaBHZx9C7mi92Jr4m0Aygr+vxYe1M764IPGawtpleIE1h/FelEZ+pSpIXGFyf4NUVr0x2R6DVyqM0Y+HAkIc/0yfW9C5SvJgCk0qinEXDK0uA== 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=crUqdsXYLVZ3RbQQMOFzsU8l0HBGfvR+4D6ENSHIvVg=; b=ZCWoiupXY9+pdHgR3ktnMK2Pi42Vzx0hK5ejyhgNTKQiNhnLND+e0SUaYPSodprntq1Z0tZw6XcRvCr49FyZZ5xN1RSmTy8vAxU5PuibwWU5+ozNcG2qZUvR3LT7uP5Ds9pN6XJ7MhO4Wd2SNrRivK0GgTk9mVLCghUAKm/Qzc5B5PHbVjA0R8rvKrM46FYdlP5KQkBKsU9sg7neEVvde5e6G73MVQkDB/7hsZqSq7m7gNcJTmcsqdA/OsVfM0tlRvJxXMQvC6vhqhQGvi47jPV9EjoVd0Rvrsx+fgGYzHY/MNfVl0Nrtf7QH+EFHLGD5FR0lpBA3GToCjaIXXrbIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=crUqdsXYLVZ3RbQQMOFzsU8l0HBGfvR+4D6ENSHIvVg=; b=VPRB4sX0v6jIVLOrnKrkK7BQcCkttjD2K3zd7e4fbUOqYiq9Z8j7mAt/CvasLFz4831xb0nXXuioVV9fTOMDFgB2D7WqDh4XTbhAw4BhYL+GFM2/BqnpVwwG0wCtm+/2uMr5McaY1BBWTBaU/B6QG869xc9/L6YGDilFsH3N2FO5eGhQbVwU8Oc8Vi68M6wY2WFF2ChqWYNNkWYiKLBvYXneqAhore0O1hRb6kl9a/UEaVwRfXlKjGOhM8evcH8+4ik9mB4MDiqkhcPEC5u0f/eGC9N6hE7kdrKkNDil+aYXnNfZeA8SyypaujGKrFk3LXspRVA3oVwN4qx3d/I7Lg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) by MW3PR12MB4395.namprd12.prod.outlook.com (2603:10b6:303:5c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Tue, 21 Mar 2023 13:02:35 +0000 Received: from CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::d228:dfe5:a8a8:28b3]) by CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::d228:dfe5:a8a8:28b3%5]) with mapi id 15.20.6178.037; Tue, 21 Mar 2023 13:02:35 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: dsahern@gmail.com, stephen@networkplumber.org, razor@blackwall.org, petrm@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH iproute2-next 4/7] bridge: mdb: Add destination VNI support Date: Tue, 21 Mar 2023 15:01:24 +0200 Message-Id: <20230321130127.264822-5-idosch@nvidia.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20230321130127.264822-1-idosch@nvidia.com> References: <20230321130127.264822-1-idosch@nvidia.com> X-ClientProxiedBy: FR2P281CA0068.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9a::12) To CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6179:EE_|MW3PR12MB4395:EE_ X-MS-Office365-Filtering-Correlation-Id: d1f0d162-fa51-40b3-0e10-08db2a0c8a83 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TUTacdw3SkO62lT+dwD531QpJAYtN6Kk7Ny/X3EuaaNJxhUEs1FLXGGd3xdLQLtcc9c5BOVi0xriL4JqZN/STsi5LTzWosI2JEC4v6aZk9Lg/jWz1m4rG+fyJaW+7N0UnSgvZl6ZSgaeLC59EOM/oFp3b+kNFWVeGsC4srVHOPDBttXXnEuuY5xBam80CDKrF+wNzIGNiSbUXq8vP3ryrydN7n6n/xtI96Hc2z5iYlZIFnVzjGeHHgNqw3CRvsnis2Q8P+tOMIaw2fuW+YUwaplXJDcHJB0bvITK+2xdYbmKpFbDXaTMlxF/D/h5tEKM1Eu7ih4LKh56DSMmoOxFmZbFxQTJeM76mR0dRp32/YcEkiutV71dY+StU4S7Q1IxK90HSnafUHJpMGMXLWExZEjR5KXsjXipixB0yHw/MxSNHrQ3xwfyJcBkWfQNexlKlkQJgTxN8zQAWFByXUPFcn/yw6nIse6hKHU8OwQJy7r0d6lpoEwcR+ufyMo0bwqVoJFf3JVDKsq/z4QozwkHSnuO455NagPpAG+ean5B3vr0mrkzBl3eArnOkcFIttAFGoZU8rPhekULmMS3zXAd4SBjnISEBUtyOKXymy7FysT5CeCbl7DTRnbkWK0HV1/A7Qr9iDOXDRNh/iGInX5NpWxheIrGCyNBMunchpH43hfvlKQL/xAaZibIbRKcsTu5 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR12MB6179.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(346002)(366004)(376002)(396003)(39860400002)(136003)(451199018)(2616005)(6486002)(478600001)(966005)(6506007)(83380400001)(66574015)(6666004)(107886003)(316002)(66556008)(66946007)(66476007)(8676002)(6916009)(1076003)(186003)(26005)(6512007)(4326008)(41300700001)(5660300002)(8936002)(38100700002)(2906002)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Aalq1ZIM8/j4SZ+wVF8My35/IrbM8s8qmjlNUBfHQZLN8GxbbE0U8BmqZ/KWnIQfD8yj7eR6AfRdfM4hR92W7Xsl9CNjrVDJTzue8Kp2wOBNP+0i+YBT5K2NQyT3Aci/P+M2fNJ4UDe0w6p/nltWq9W0PtZzTkQfUKAygzj8p6V+Mcvwi2kMx3NdDqpeH+U1m7CwGwnQkXS7DcZs8v3Yc2CsKuffwN2rkY1kS/GP5QpS91uAAcKKha3UwbQ9YJDePkT+XEb48G45HBaqcCXJn+A7jbzZLUQLywWJ8Y/zG+CuSeufz883uOrdNiOnAPBDHCA0WtOGplePSgqUauBiXsb7iuk7pj6IU7Jp5LTTfBqDeqHZdxkMbkL61onjcnNPXEDtXe7ql9G7rwj23Pp8cyn16QV1VL9CHUh6wh1A7taNiNmQL7xVRjn36Wkjzsx6o6iZLGjP1N3TRylSIUKILqAYhtEJBnbFsklW10H6cNG3isEwvKYQcC9hFEUXDn8gJ+XzEVkG9/BvAvXw/6CQeXllqadjPoVUgRa5vWP9/W2+iEHwOHFWGTI3ofnoQxRvd24ZIknZLnVXErNp08H17dQuRgZXpLNuyuWBTEkjyIx+YLC6CJBi7wBycsDDB9eqH7osLt/L9znQCC/L3U6/894yEufzesrO51lfEnRnPgmVv9l2oCHPJzudIl1Gyl7E8u+38FXf9wD/ozgC1Y7N6Yy8TIMUDke/wsHJp5UZzRX/g74kXUYS32eHYWxVUB0c/qBsw6p83cGG58UOJxrxfc33oEhBY/WCfJu0fN71zjPlAa6GLbaoWVHFoQ3RXWwFe0BKzNj7NyvJ4ECta88s+q9f8qNRrXsZxVek7gnDdxfM+N87spBA23BK2sDB9/BPkKwk1qd02mDoeDV9iCsorOhgHeo2Me5puJRWpIud1ozRt8KjvhBLVpADLD5ZQidPLKwd+MnTROQWmn0nVgJoL8a2FmX+Z02T5dX//DZ5gQLhNk0LQxlsZvCzdh4NDn9N+BlEv0wfVmChEg9oFm3qJZ0YvCss4dMIvzU0r3auqJgsxn07Rz1VPYVS2Jm7R7zNBPrzgDs9fZftX9lJtoxxn56kZEJO+vKnWscvpqpaDMHsi7thXNmvy6DRjgjMPzGeLeVsXcTQHfTcf5WBkva7Ns+qPMe+rMllitBn+3L02sxjC5OAyICckQ72scACfA+Nje1e6akLgOLkoVTT7LfcxGLmMFTCqs0CO2iHRKjTVL1nARXpTceDbBd2lXrNVp+a6F4ddXRhnPr1ho+Efjcp2/oeILOLWvVgGX/6aeCOAwc7qGEnmPcKxq2G3knjDLbTMj84VbJCANkjBLSRMO9NxEJhtbT9EhxWYw8XQCnWEq1OVWS6FkbwjZHD9AQWyMUuDlD5sVSUpp3cWm2NP3VqeAUSlCp1HJPHNgu2/A+QeU6VkrjjuJ4OIk/HasxvZBPiWV/Jb/JDH9QyrQS3udklqKQKOkYY4FjZPfU74xD99ZRRyxw7mUzvKE93W0b76oToD3eSzyjopEBTf7BARaTjhdCtvTooCy55ftG5eW39YolW8DuGVO4HjvjeYp8ijVS1 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1f0d162-fa51-40b3-0e10-08db2a0c8a83 X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6179.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2023 13:02:35.6125 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9pdZ8geybe0tH6esFes/SyNBOC5/A/RBJ4pyCfFJpbU0V/7RHKlHHjgS24JjDXtlGbb7ReZnklZ1ZkqslFFB6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4395 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com In a similar fashion to VXLAN FDB entries, allow user space to program and view the destination VNI of VXLAN MDB entries. Specifically, add support for the 'MDBE_ATTR_VNI' and 'MDBA_MDB_EATTR_VNI' attributes in request and response messages, respectively. This is useful when ingress replication (IR) is used and the destination VXLAN tunnel endpoint (VTEP) is not a member of the source broadcast domain (BD). In this case, the ingress VTEP should transmit the packet using the VNI of the Supplementary Broadcast Domain (SBD) in which all the VTEPs are member of [1]. Example: # bridge mdb add dev vxlan0 port vxlan0 grp 239.1.1.1 permanent dst 198.51.100.1 vni 1111 $ bridge -d -s mdb show dev vxlan0 port vxlan0 grp 239.1.1.1 permanent filter_mode exclude proto static dst 198.51.100.1 vni 1111 0.00 $ bridge -d -s -j -p mdb show [ { "mdb": [ { "index": 15, "dev": "vxlan0", "port": "vxlan0", "grp": "239.1.1.1", "state": "permanent", "filter_mode": "exclude", "protocol": "static", "flags": [ ], "dst": "198.51.100.1", "vni": 1111, "timer": " 0.00" } ], "router": {} } ] [1] https://datatracker.ietf.org/doc/html/draft-ietf-bess-evpn-irb-mcast#section-3.2.2 Signed-off-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov --- bridge/mdb.c | 34 ++++++++++++++++++++++++++++++++-- man/man8/bridge.8 | 10 +++++++++- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/bridge/mdb.c b/bridge/mdb.c index 893488211911..2174eeb6e933 100644 --- a/bridge/mdb.c +++ b/bridge/mdb.c @@ -34,7 +34,7 @@ static void usage(void) fprintf(stderr, "Usage: bridge mdb { add | del | replace } dev DEV port PORT grp GROUP [src SOURCE] [permanent | temp] [vid VID]\n" " [ filter_mode { include | exclude } ] [ source_list SOURCE_LIST ] [ proto PROTO ] [ dst IPADDR ]\n" - " [ dst_port DST_PORT ]\n" + " [ dst_port DST_PORT ] [ vni VNI ]\n" " bridge mdb {show} [ dev DEV ] [ vid VID ]\n"); exit(-1); } @@ -264,6 +264,10 @@ static void print_mdb_entry(FILE *f, int ifindex, const struct br_mdb_entry *e, print_uint(PRINT_ANY, "dst_port", " dst_port %u", rta_getattr_u16(tb[MDBA_MDB_EATTR_DST_PORT])); + if (tb[MDBA_MDB_EATTR_VNI]) + print_uint(PRINT_ANY, "vni", " vni %u", + rta_getattr_u32(tb[MDBA_MDB_EATTR_VNI])); + if (show_stats && tb && tb[MDBA_MDB_EATTR_TIMER]) { __u32 timer = rta_getattr_u32(tb[MDBA_MDB_EATTR_TIMER]); @@ -636,6 +640,21 @@ static int mdb_parse_dst_port(struct nlmsghdr *n, int maxlen, return 0; } +static int mdb_parse_vni(struct nlmsghdr *n, int maxlen, const char *vni, + int attr_type) +{ + unsigned long vni_num; + char *endptr; + + vni_num = strtoul(vni, &endptr, 0); + if ((endptr && *endptr) || vni_num == ULONG_MAX) + return -1; + + addattr32(n, maxlen, attr_type, vni_num); + + return 0; +} + static int mdb_modify(int cmd, int flags, int argc, char **argv) { struct { @@ -650,7 +669,7 @@ static int mdb_modify(int cmd, int flags, int argc, char **argv) }; char *d = NULL, *p = NULL, *grp = NULL, *src = NULL, *mode = NULL; char *src_list = NULL, *proto = NULL, *dst = NULL; - char *dst_port = NULL; + char *dst_port = NULL, *vni = NULL; struct br_mdb_entry entry = {}; bool set_attrs = false; short vid = 0; @@ -697,6 +716,10 @@ static int mdb_modify(int cmd, int flags, int argc, char **argv) NEXT_ARG(); dst_port = *argv; set_attrs = true; + } else if (strcmp(*argv, "vni") == 0) { + NEXT_ARG(); + vni = *argv; + set_attrs = true; } else { if (matches(*argv, "help") == 0) usage(); @@ -762,6 +785,13 @@ static int mdb_modify(int cmd, int flags, int argc, char **argv) return -1; } + if (vni && mdb_parse_vni(&req.n, sizeof(req), vni, + MDBE_ATTR_VNI)) { + fprintf(stderr, "Invalid destination VNI \"%s\"\n", + vni); + return -1; + } + addattr_nest_end(&req.n, nest); } diff --git a/man/man8/bridge.8 b/man/man8/bridge.8 index 9385aba0ee68..f39d434fa20a 100644 --- a/man/man8/bridge.8 +++ b/man/man8/bridge.8 @@ -149,7 +149,9 @@ bridge \- show / manipulate bridge addresses and devices .B dst .IR IPADDR " ] [ " .B dst_port -.IR DST_PORT " ] +.IR DST_PORT " ] [ " +.B vni +.IR VNI " ] .ti -8 .BR "bridge mdb show" " [ " @@ -990,6 +992,12 @@ the UDP destination port number to use to connect to the remote VXLAN tunnel endpoint. If omitted, the value specified at VXLAN device creation will be used. +.TP +.BI vni " VNI" +the VXLAN VNI Network Identifier to use to connect to the remote VXLAN tunnel +endpoint. If omitted, the value specified at VXLAN device creation will be used +or the source VNI when the VXLAN device is in external mode. + .in -8 .SS bridge mdb delete - delete a multicast group database entry This command removes an existing mdb entry. From patchwork Tue Mar 21 13:01:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13182715 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87FE0C6FD1D for ; Tue, 21 Mar 2023 13:02:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229744AbjCUNC6 (ORCPT ); Tue, 21 Mar 2023 09:02:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbjCUNC5 (ORCPT ); Tue, 21 Mar 2023 09:02:57 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2044.outbound.protection.outlook.com [40.107.212.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94BA94D40A for ; Tue, 21 Mar 2023 06:02:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nXta949xKUw4JCZxyZYlofMJRf/s/uPnXYeQ/DmWaPHExZplGUYGo6L3n1s+0Wxm1ZySCHWgNmLlk59FrkYg0T0nEtycY9fMF7bNUOdGLlSUz3WDDNknWrhHcdHdvbdXKt3PJK2Or0g3SWHERXdxzh5CVTzETBsFvHzVaYt2k3//UeVe2FDgMw0OOvsoO+3ZX12pJr6ULkQtisdZ+25nX77A2msZr9LlIn9N/dUzUA8OlRlIjn7qEz7tic7E+iHUXQAPCnNagb+n9mOeziDp6gCGlUoVHFSO5my3jsBJrt907IhxDCw24+iDC8FuQouWMxDiheIDu8GTgRsMut7ssg== 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=KqbuMXuJlOvdq+e6zJZGt3O1B5Eaf0G9zr1YDqiYkug=; b=aTiz0LwbSgG6rr95JDPEn/L86uboKEHsEN0ASuTm3s1tO3KM99xeja/DaAcnmZzweF4m6DEnSFxac7aByQNe1lzDLrd+ks7pYN0cGDwNsvVrzJ4MSxb8dYKDzW+0oQOPLRjRhiJ1wcBBUZaO1/xjTjOTn0IOcDf8mp8RW68+U/voLl24ncD2Xl5vHIQnvxvCwSF3xehmogQGhKiua4rRhqvluTELGbSsdSRpDqDYlLqaQbh0mERH60LWO99U6X9Pl2aMGsQirpQl5Eu7VLHSdM0UqgoZWMQOuKBYNxFsGX/KvkJ4nyLv8aioBC3P2tclETlWQr73hAxo+06cF7ot9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KqbuMXuJlOvdq+e6zJZGt3O1B5Eaf0G9zr1YDqiYkug=; b=gLAS2etI/q7GCuD7m93SQJrNukSc4AobVo6tFukH6Omo9L+7+qUiPSok2TtN4H/LsMnrPlSosS0/9PDb1M04JupLiCNi+mtUBVyni0A5wnCAindhoC3U9lTikTbqPn27QM5EW6ZqFkHLYPg6x7/zj+UoApwMethxLrFeTiKS9PRCxER4fEiqZBqqCgS9YSRHoE0CfZclL17K0KoU7NFx/1YKU0FlDb0fZEVBFxdx7scRkMkiyUtUVCCX/pkVR9Nkaq/9o0eB0ruZMIYsCVpTbHBfzsoTu30C1XIT0MkBNaRZaNZnrtevKb0vwJ6J0z/071qkoHnUynWOXiWlubNYug== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) by DM8PR12MB5478.namprd12.prod.outlook.com (2603:10b6:8:29::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Tue, 21 Mar 2023 13:02:43 +0000 Received: from CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::d228:dfe5:a8a8:28b3]) by CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::d228:dfe5:a8a8:28b3%5]) with mapi id 15.20.6178.037; Tue, 21 Mar 2023 13:02:43 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: dsahern@gmail.com, stephen@networkplumber.org, razor@blackwall.org, petrm@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH iproute2-next 5/7] bridge: mdb: Add source VNI support Date: Tue, 21 Mar 2023 15:01:25 +0200 Message-Id: <20230321130127.264822-6-idosch@nvidia.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20230321130127.264822-1-idosch@nvidia.com> References: <20230321130127.264822-1-idosch@nvidia.com> X-ClientProxiedBy: FR2P281CA0001.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::11) To CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6179:EE_|DM8PR12MB5478:EE_ X-MS-Office365-Filtering-Correlation-Id: 96bd647d-4cea-44e0-9f01-08db2a0c8f26 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 829dC3VIAT/hLwqIGIpkLGSlVJhFduGSSXof/YUSmCLkmwo15fsOocip6JAvtVBRyCpCsVd+ki5bDtp6sN0DY7Iug+5m1oZ/ej6mpZ6eCmCcAqtn19GVqsH6Ugto05uaX9f4sDwGTxgwqL3vpBo4yPf2QQ3jM+ZkFZZXjCSpymhOoWY6NAf7Vlv3NwttMtiYl8mLaR6Lf/q045Lz10LB59IiUzgQfN9+ZmcuT+MpYru94h9MDft3PBepSJBl27+VPX+zm98DZhZ8PrLQ3dyvhhZ0JK9+HYIoKeBGSVhMTwekcG9HM3WDm0l5bCP7Xe3iZt7j4m3ZT2sYB46FZwVgYxHCOq0tqj9O6m2qF3+cqlR8WfH8467K7ORJPLzUwIBD3D/apOt4iYYoiX/PiqsFm7mjxr6oimfX6eO18HBHNIyR6/tRMM8f4G/+9nFUb0AT0BZhn1wyt7SeU9ske38/ODU19SmEgkx7Jfty3gPHxK7ghj1fvXtY66PBu3EHkBQBtUKfHbQBM1okeXtZBO3bEH8A+lxk0aCrQFLMujKxGTCidgGQC6CuXmrZauKUT4n/f/P38NUTBE/FHWmBhDx+z4wyKsIzEzSMzitp6p8294ibHWc7/YdPU85HWcHMkg7D1HunEprpof6bYghovICuJQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR12MB6179.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(376002)(346002)(366004)(39860400002)(396003)(136003)(451199018)(8936002)(41300700001)(5660300002)(36756003)(86362001)(38100700002)(4326008)(2906002)(83380400001)(6506007)(1076003)(6512007)(478600001)(107886003)(66574015)(6666004)(186003)(6486002)(26005)(8676002)(66476007)(66556008)(66946007)(6916009)(2616005)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6H+U+dnN4537pF3DMMUf0fmC8hZHDGeERrwoY14mIN43tzZWbENQJhm5UKdxSmf9phZViKKDLnydFqp4g1yuqTtszesYCT5wIArbVIYJsCTjvO3acohA1RQy3Yxhi+BwwXDWwo50Op3NBkDgYMQQGZyc31JaIbVlwdPlROcWkU4njMf+78LC6DyfVFyasu7BHVc+ef4iJcVxPDhmQ9laJLoTLnTbiL6xH/2zoi0BjCZHvhU1NkBXQ8srqP6dNNBioMrkPE7ghkOsXeVUFn6vr/cAv+3M8OeuM79X68ff8gsWnL/xyxR2tCUorXWC1QZYtCTxgYfX0JllCIp3I7UzDYxJWLRPpfuh3JMo7DnL2+wB1Xbw6SSHUMdTSvV3Y0qliQfUhuY0T2t0RkWb82oZDlF3a5Jj8B8b+JIJxHtPpy51E3hKsQd87VcZm05Nih5kyRI8XdjeJHcc1PfMb/ANbJP9SsbW74C/rySbyU7RebYwMfD/I0tK2fM76Kn9d1FZzGoVGubguCCZPlLishivFAtT7bXAO36ZMw34WSJHhZ+K3k9DEyJrjSEHerzSeSqoPjYVXhMh3KtJ7EWEzeqtRAcQRPd1VHZ5CKyTVXqvvDaTpO4MGz4kX2KNddzPlvspGuidrsi61tUUEMZVWy79d26HIrTbCQphtaaMjyivT9rJyWZa57rXxvLdk8xaTzWjVuDbOTJrLh0IwD19jItmDBQDfNQYOj2CEvCn+95yKrdEdavmIo9Qj56qF3pd+vLFizJEFCg58qfvj5UdnuwMdLiWidgvfyxX0lXEVKqycJGEcq2FmLSTG15+kBBDfXxTztj/WCqfbZC8UsQWvGgIwIAREPPB36ZPYzqeSQzqkh3jYfuZXtBxPSD7E2EAdJACvFF3AiGtj+5vMIqPbfkGp1ToxfV8d1Qxm35Q4uiZEYkCKxzE9yVhWjr6vSMcXsGfhu4IpwpiXCsVak6kPvnbI0WwX6xVahiDUep1ueV23pGnBf8+/Pkq+05oVJ0M6J54px5m/Ui6H/8Y+SZPxYatN/4PwVw2/BphNeJkA1OtQ9aE5lk0ad/64G0OhM5T17voO4TrjbGtFxARuOcDqk2UxwWPgX1zeJtVayOdGMVCzG8aDh//F1rtqzvgBqQdMhAhe7J7f46gjKXcF/ulRMEwS3V/KuXcDlKLCRyZ4ZQJwTgM2LvlA1oAAuYVk1iTIptkJS3afCR6wOWAzjq9QeHCAtNbBg+dsHZ/2ilueE79ATzWnX7UjtHnPmgjfP/Vyg2GR5JyQBa1dnPVuYOynQUylqInmP69mGxJ52dfZQXubvOjv3mFDW4UGsAQb4GA/8xKus6nFaKFLZtrCTfcyKWd8slqI1GC8S1ot3s63vRN3v0zGSHrPQGWGDhS3arXONTCbVJiKTAleaK2Ry5KfBtLhY3t7adZKdy1IlXhKEbYI/Z6wP8t/as8qazr+WDOI5HBqSoJiVeWBaRBpaj3S+vGf1mLPB8Pw99iALWvQ6sB51kO1UDRDyzRT44L6C5v8eWTqEXMRRSxzTiPRtTIbBKJtYKQDe/6NtVPWXGFNIa+X3hjB+iUkrq9z4SnmV8Aakj6 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96bd647d-4cea-44e0-9f01-08db2a0c8f26 X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6179.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2023 13:02:43.3953 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ITcobl5tkN33dvDzvmQJAcsrI1xy51MOV5g8+1nwWsr3xcyff8Y41fnQUQpOS2vL5/GDMewOnCt7QtdQ2Ff8Zg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5478 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com In a similar fashion to VXLAN FDB entries, allow user space to program and view the source VNI of VXLAN MDB entries. Specifically, add support for the 'MDBE_ATTR_SRC_VNI' and 'MDBA_MDB_EATTR_SRC_VNI' attributes in request and response messages, respectively. The source VNI is only relevant when the VXLAN device is in external mode, where multiple VNIs can be multiplexed over a single VXLAN device. Example: # bridge mdb add dev vxlan0 port vxlan0 grp 239.1.1.1 permanent dst 198.51.100.1 src_vni 2222 $ bridge -d -s mdb show dev vxlan0 port vxlan0 grp 239.1.1.1 permanent filter_mode exclude proto static dst 198.51.100.1 src_vni 2222 0.00 $ bridge -d -s -j -p mdb show [ { "mdb": [ { "index": 16, "dev": "vxlan0", "port": "vxlan0", "grp": "239.1.1.1", "state": "permanent", "filter_mode": "exclude", "protocol": "static", "flags": [ ], "dst": "198.51.100.1", "src_vni": 2222, "timer": " 0.00" } ], "router": {} } ] Signed-off-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov --- bridge/mdb.c | 18 ++++++++++++++++-- man/man8/bridge.8 | 10 +++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/bridge/mdb.c b/bridge/mdb.c index 2174eeb6e933..ee83aa38bced 100644 --- a/bridge/mdb.c +++ b/bridge/mdb.c @@ -34,7 +34,7 @@ static void usage(void) fprintf(stderr, "Usage: bridge mdb { add | del | replace } dev DEV port PORT grp GROUP [src SOURCE] [permanent | temp] [vid VID]\n" " [ filter_mode { include | exclude } ] [ source_list SOURCE_LIST ] [ proto PROTO ] [ dst IPADDR ]\n" - " [ dst_port DST_PORT ] [ vni VNI ]\n" + " [ dst_port DST_PORT ] [ vni VNI ] [ src_vni SRC_VNI ]\n" " bridge mdb {show} [ dev DEV ] [ vid VID ]\n"); exit(-1); } @@ -268,6 +268,10 @@ static void print_mdb_entry(FILE *f, int ifindex, const struct br_mdb_entry *e, print_uint(PRINT_ANY, "vni", " vni %u", rta_getattr_u32(tb[MDBA_MDB_EATTR_VNI])); + if (tb[MDBA_MDB_EATTR_SRC_VNI]) + print_uint(PRINT_ANY, "src_vni", " src_vni %u", + rta_getattr_u32(tb[MDBA_MDB_EATTR_SRC_VNI])); + if (show_stats && tb && tb[MDBA_MDB_EATTR_TIMER]) { __u32 timer = rta_getattr_u32(tb[MDBA_MDB_EATTR_TIMER]); @@ -668,8 +672,8 @@ static int mdb_modify(int cmd, int flags, int argc, char **argv) .bpm.family = PF_BRIDGE, }; char *d = NULL, *p = NULL, *grp = NULL, *src = NULL, *mode = NULL; + char *dst_port = NULL, *vni = NULL, *src_vni = NULL; char *src_list = NULL, *proto = NULL, *dst = NULL; - char *dst_port = NULL, *vni = NULL; struct br_mdb_entry entry = {}; bool set_attrs = false; short vid = 0; @@ -720,6 +724,10 @@ static int mdb_modify(int cmd, int flags, int argc, char **argv) NEXT_ARG(); vni = *argv; set_attrs = true; + } else if (strcmp(*argv, "src_vni") == 0) { + NEXT_ARG(); + src_vni = *argv; + set_attrs = true; } else { if (matches(*argv, "help") == 0) usage(); @@ -792,6 +800,12 @@ static int mdb_modify(int cmd, int flags, int argc, char **argv) return -1; } + if (src_vni && mdb_parse_vni(&req.n, sizeof(req), src_vni, + MDBE_ATTR_SRC_VNI)) { + fprintf(stderr, "Invalid source VNI \"%s\"\n", src_vni); + return -1; + } + addattr_nest_end(&req.n, nest); } diff --git a/man/man8/bridge.8 b/man/man8/bridge.8 index f39d434fa20a..88046dc1a2b4 100644 --- a/man/man8/bridge.8 +++ b/man/man8/bridge.8 @@ -151,7 +151,9 @@ bridge \- show / manipulate bridge addresses and devices .B dst_port .IR DST_PORT " ] [ " .B vni -.IR VNI " ] +.IR VNI " ] [ " +.B src_vni +.IR SRC_VNI " ] .ti -8 .BR "bridge mdb show" " [ " @@ -998,6 +1000,12 @@ the VXLAN VNI Network Identifier to use to connect to the remote VXLAN tunnel endpoint. If omitted, the value specified at VXLAN device creation will be used or the source VNI when the VXLAN device is in external mode. +.TP +.BI src_vni " SRC_VNI" +the source VNI Network Identifier this entry belongs to. Used only when the +VXLAN device is in external mode. If omitted, the value specified at VXLAN +device creation will be used. + .in -8 .SS bridge mdb delete - delete a multicast group database entry This command removes an existing mdb entry. From patchwork Tue Mar 21 13:01:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13182716 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C63E3C6FD1D for ; Tue, 21 Mar 2023 13:03:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230090AbjCUNDR (ORCPT ); Tue, 21 Mar 2023 09:03:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbjCUNDP (ORCPT ); Tue, 21 Mar 2023 09:03:15 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2044.outbound.protection.outlook.com [40.107.212.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A8F74D601 for ; Tue, 21 Mar 2023 06:02:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jVjsPuR8qVwWevfxzhtFvkGLU6rEe4WOExJn6axiaR434aqerjVU3qm1PyEG090lsgBW+O5Db8iopK5EBOU+EQP3ulKvQQsgS/NA+j1pk26FA7FrS+gUISyyJW8BZMnefbNBW6H2jXu8VlQziNLL2c8a1/aYmGe/ITlZ8rJDcG42UUdWk0jjMwepZ0AIq1pXPRLSroKnm6A3hlLLdQvgoHPSzyO6pjEyNrMzC288sIQmE0c7d6I73SYmV2u3tBPoYkbB+kZQxtAdD5qOXsWxwDuhGBDkKmFq45l7iQqs/lfxidyhfwWSq9Y8rOYAKNR0MGlM3h9j0VJENRI7nJCVyw== 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=LMObLNYt7KIqPTQ9BJGNyHvBs5hcvycavJraSfHa/l0=; b=ht9W1RKDC0Kx+SRc/wDjbW8sHHwARZkH67DHkP/1/VVvBeqm2RL2OhPPVN+rMxrngmVqUvIONXa0VEBsc9zViKfefeiNzl+UKV9+3GbKYn4ElLe8n8y3nCs9mpd3ldiWBx8hbafFeEOhUAuqQIsiR8nSTl6VrC3nenJE3U8OTLaZOWl4hlAGVzHZkNx7U51Fe9STpFq/rHbYfmNvfcNQOcNpFKlJeug7HzET9gG29sJNCVtqLkL/9FK1AKybMny+OJKZYzf+92dX0+g8GrWLnSRdDXXpKb0fkeu5poNRvfkmJmDE6YWryuOAoo4+yrDq3P6QLH4yhAZJqwZ6p6SAVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LMObLNYt7KIqPTQ9BJGNyHvBs5hcvycavJraSfHa/l0=; b=qugBhSBgOsob+m7/FD4KiwBeYw9WQZIPe89Ga7LRZ9KWLcnnP089u2IJb6YRnsSfOeak44UQrFqoJIpSAGP24BUHnsuAyQLOVlE2xwnXeKnST0eW1zz2bKSP7c0xT1IG5VNGo3YPAUwfK/D6buiTLce4zIDUpireDo6fEbDiBAkP2NyyTnn01zIjFUerH/jRTQfKLOg79M1EnFmK7or1zl/9cyNtZB3o6LTh5AZK8XUD/mI/hys6TKbhPx2oZR6TOa5HChjevgEQPW1Ee+1CV411jCV3MJZKZb6fcOvmzVHjpjjUft0MG+MXW5a17nIuQdOaG12grge5V47O8QuyKA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) by DM8PR12MB5478.namprd12.prod.outlook.com (2603:10b6:8:29::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Tue, 21 Mar 2023 13:02:50 +0000 Received: from CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::d228:dfe5:a8a8:28b3]) by CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::d228:dfe5:a8a8:28b3%5]) with mapi id 15.20.6178.037; Tue, 21 Mar 2023 13:02:50 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: dsahern@gmail.com, stephen@networkplumber.org, razor@blackwall.org, petrm@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH iproute2-next 6/7] bridge: mdb: Add outgoing interface support Date: Tue, 21 Mar 2023 15:01:26 +0200 Message-Id: <20230321130127.264822-7-idosch@nvidia.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20230321130127.264822-1-idosch@nvidia.com> References: <20230321130127.264822-1-idosch@nvidia.com> X-ClientProxiedBy: VI1P190CA0014.EURP190.PROD.OUTLOOK.COM (2603:10a6:802:2b::27) To CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6179:EE_|DM8PR12MB5478:EE_ X-MS-Office365-Filtering-Correlation-Id: 55706225-d4b2-4100-ce84-08db2a0c9382 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uhr4iguzN8CHn9WTj2ZpxvlX8RzixG30ACZb7h/e/K0AT8rejVxgxykdKMRErOMoE1mSvO4sFIBKsHpHgVe8nBtFpCeMpmzUV6KwjUX9JqhNGEU18exEOkLZ9WeH7RnSDXk7Li5LljPYWhk2f2ZR0vyliNRQ8fY8N0ALpJKWvfMnRZKg1Hy8w7cvKcwwpwtX2AHNIt93RPH3/j226PwGPZ4Y2DCSV18rz82/GeYO+cKx9bsjsF04/MitXCK0rZDRpaW1+wrvxNoSIyX65FIhzQvrtzQAQGwbgA6DSo1IoWWmIkI3ir0/2TGTIszAFOK+7iD+oY4ulkA3kTUFvbh0lBcg6cTWmXEweNzZ7ttfkKvSTblnKJC28Em6NNrcvnBZTfLnk/M27YAqnyNeyX5E/ilCUfgY9OlimkHNTaWwgNJ9lY6uBftzxrI0bhv+ufB8vDa8Im1h4sFhAfqwPU4waqLgVZdYXWwVqqlwk+RrTlvIQV8I29cjURaKoRC3MsHAQCpkuigDSjaoyxD/J9FhYfnR5yl/z3Jo6WWpeEHeK7BQjFb1wRwH/Suy+BqjZ5epI4/LNCgFM8qIiPNWQTZGB+fgxpe4wp7ZqgsvQuJTAqiO1RhxRYsutYrGG0ASmVq4bPa6ViahNTXU+G1pVacRmQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR12MB6179.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(376002)(346002)(366004)(39860400002)(396003)(136003)(451199018)(8936002)(41300700001)(5660300002)(36756003)(86362001)(38100700002)(4326008)(2906002)(83380400001)(6506007)(1076003)(6512007)(478600001)(107886003)(66574015)(6666004)(186003)(6486002)(26005)(8676002)(66476007)(66556008)(66946007)(6916009)(2616005)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xpK74nQ5fC2CuRNHa5CCwe8LTOk6I05JdGrGbK9VUkshpb6qOQBuApfiQ2ZYrqFE/GBJFVrLVpgUtmE6qJ4m+zoMDF8DY1Ymdb7OjguNMVB27vSB+mdqGBP6zfEeLbMq2vGVVoPic1uqoVfXMmPo73oNu1A4uiHYDY3bG2MP5v1CqLeqT/rSJ6m0G1v/98CjVKQyQjFKG+5qKz4zIsB2qBd3c7lliVokCoxGZiFj7LHiDc9sEh0s0b86BXvQPQStGo/CwVsSu0cd1vPQInpsCuzXFq8VZwXMKc9eLdGt4b0rSaRqp9i8At8sb9SIpfNiXdOKDmai54sM9+0samy5rFeY8FTybVGuxO2O2IQphePUUR9z/bVP/DRfztVjwqCIhaRBmRQIawZsPh84DSoVv9pReC7SnIqvH+1eUBDzO37oxdK53X07+0SKLUHXQiBA5zyxPpMKDW9gEPLKevKsgocnivp9TTCAX2nGwXYm1QjNH5Rf6d8KwEx+Qq5KpyaPoVgqUt3FILxr4TFPIP3BXrOgtEzX5IHh143KBNP8f9+ot3sKps7CgEFp9skVkt1//L/QaPyvTF0dBQQ4zoaYZ9S0ek7HAXTUFVeaacunI13N908qJL0q1WYTJ10gzlUH93ykLgqeTYojZSJZ0aKOwQXXZtvzzzgcPpdUD3TsoAK9w5xPzfPVIndTtjYLj11Mn32pUi3PxDXwaQaWLgnQrWjtZk9jTLHPe+SORVTRHsDtVhrTsErPkdreM1y8Xq5k+I6pQoa6h0tX95QXlKDkuuGjo2/Q1fVnT5LwO7rjqp6LhJCB+sXksEtpk2+D2MF3VJjrGdYV6ZheoHdBCyPCKjlEQ3IX6EnWc9j/VkrOXA4T6SWbeHZ8YI+bqYNOiwUcQ3UtraStM6ktmHI5ifk7rivTHIoouo8FjPne3HIuMkCoH2BpIAhuuB0XlCj/1uQTGlw0GwbLAq+9+P0S5YCyjQay7BLYoR6TRkPhiIi+Vv2/2dBNOUxVGRs6tGJgJ3EnMw4A+/muTZcFQ8kKhmPEM3qWW04gpLi0kNha14Z5nh1fysbFjLUKQoDZUiEYBIo8FSNde+zRx0W2C+x0kG3MKl8qcqk8F7/XCCbvIBynha6uS9uH5PcaDRKIc+H5OSWuyWyMS6QJlN2f2d3mmASacUpFCV4NAZj07EMmdxw6Dn7v4RS7L8dwTJSOEEM0vdzLae5mhVLB685wz/cKs4IZjs66Yd7sn3euUa9tjzNWT46KXmtINPfxsVA6LE/XxeakAEbIvjZ1yjUuTo4TRJmAshVVdVdbvwuKx+WbMOc6QTOtnpXJ6hbcaHITeqVVi/dL86ckz0DgIx1xHOqGlAZicle6ZT2K3kuzx60uuAwNWdomjb4VWmh+A2WAxFa3N30bnFp9djwl4w4xcY4ImrIBXI8GmjzY4DmmMH8tvEm6jEAL76dYcMcLIup3zhihso8lkpaZyPE6UVFMCPsZO2wnRZVJkxQxot1mqOVjMRkdYLdDXzWcNzda7B8itAh1B9SmfKTRB4fkPAJDcQSxBKzBxvNmGG8bJtkPruJXOlfWucRYKi09DQEioznXOZ8eyICm X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55706225-d4b2-4100-ce84-08db2a0c9382 X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6179.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2023 13:02:50.7104 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Fg4gznF+0vqzIHUHTnlaMDwd+aWKft+UpN1wms8wkUfWI9eYgyIkwGTtYtNKoWIsrOffqsjkYMgOQrdVrNvrFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5478 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com In a similar fashion to VXLAN FDB entries, allow user space to program and view the outgoing interface of VXLAN MDB entries. Specifically, add support for the 'MDBE_ATTR_IFINDEX' and 'MDBA_MDB_EATTR_IFINDEX' attributes in request and response messages, respectively. The outgoing interface will be forced during the underlay route lookup and is required when the underlay destination IP is multicast, as the multicast routing tables are not consulted. Example: # bridge mdb add dev vxlan0 port vxlan0 grp 239.1.1.1 permanent dst 198.51.100.1 via dummy10 $ bridge -d -s mdb show dev vxlan0 port vxlan0 grp 239.1.1.1 permanent filter_mode exclude proto static dst 198.51.100.1 via dummy10 0.00 $ bridge -d -s -j -p mdb show [ { "mdb": [ { "index": 10, "dev": "vxlan0", "port": "vxlan0", "grp": "239.1.1.1", "state": "permanent", "filter_mode": "exclude", "protocol": "static", "flags": [ ], "dst": "198.51.100.1", "via": "dummy10", "timer": " 0.00" } ], "router": {} } ] Signed-off-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov --- bridge/mdb.c | 32 ++++++++++++++++++++++++++++++-- man/man8/bridge.8 | 9 ++++++++- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/bridge/mdb.c b/bridge/mdb.c index ee83aa38bced..dcc082353514 100644 --- a/bridge/mdb.c +++ b/bridge/mdb.c @@ -34,7 +34,7 @@ static void usage(void) fprintf(stderr, "Usage: bridge mdb { add | del | replace } dev DEV port PORT grp GROUP [src SOURCE] [permanent | temp] [vid VID]\n" " [ filter_mode { include | exclude } ] [ source_list SOURCE_LIST ] [ proto PROTO ] [ dst IPADDR ]\n" - " [ dst_port DST_PORT ] [ vni VNI ] [ src_vni SRC_VNI ]\n" + " [ dst_port DST_PORT ] [ vni VNI ] [ src_vni SRC_VNI ] [ via DEV ]\n" " bridge mdb {show} [ dev DEV ] [ vid VID ]\n"); exit(-1); } @@ -272,6 +272,14 @@ static void print_mdb_entry(FILE *f, int ifindex, const struct br_mdb_entry *e, print_uint(PRINT_ANY, "src_vni", " src_vni %u", rta_getattr_u32(tb[MDBA_MDB_EATTR_SRC_VNI])); + if (tb[MDBA_MDB_EATTR_IFINDEX]) { + unsigned int ifindex; + + ifindex = rta_getattr_u32(tb[MDBA_MDB_EATTR_IFINDEX]); + print_string(PRINT_ANY, "via", " via %s", + ll_index_to_name(ifindex)); + } + if (show_stats && tb && tb[MDBA_MDB_EATTR_TIMER]) { __u32 timer = rta_getattr_u32(tb[MDBA_MDB_EATTR_TIMER]); @@ -659,6 +667,19 @@ static int mdb_parse_vni(struct nlmsghdr *n, int maxlen, const char *vni, return 0; } +static int mdb_parse_dev(struct nlmsghdr *n, int maxlen, const char *dev) +{ + unsigned int ifindex; + + ifindex = ll_name_to_index(dev); + if (!ifindex) + return -1; + + addattr32(n, maxlen, MDBE_ATTR_IFINDEX, ifindex); + + return 0; +} + static int mdb_modify(int cmd, int flags, int argc, char **argv) { struct { @@ -672,7 +693,7 @@ static int mdb_modify(int cmd, int flags, int argc, char **argv) .bpm.family = PF_BRIDGE, }; char *d = NULL, *p = NULL, *grp = NULL, *src = NULL, *mode = NULL; - char *dst_port = NULL, *vni = NULL, *src_vni = NULL; + char *dst_port = NULL, *vni = NULL, *src_vni = NULL, *via = NULL; char *src_list = NULL, *proto = NULL, *dst = NULL; struct br_mdb_entry entry = {}; bool set_attrs = false; @@ -728,6 +749,10 @@ static int mdb_modify(int cmd, int flags, int argc, char **argv) NEXT_ARG(); src_vni = *argv; set_attrs = true; + } else if (strcmp(*argv, "via") == 0) { + NEXT_ARG(); + via = *argv; + set_attrs = true; } else { if (matches(*argv, "help") == 0) usage(); @@ -806,6 +831,9 @@ static int mdb_modify(int cmd, int flags, int argc, char **argv) return -1; } + if (via && mdb_parse_dev(&req.n, sizeof(req), via)) + return nodev(via); + addattr_nest_end(&req.n, nest); } diff --git a/man/man8/bridge.8 b/man/man8/bridge.8 index 88046dc1a2b4..9753ce9e92b4 100644 --- a/man/man8/bridge.8 +++ b/man/man8/bridge.8 @@ -153,7 +153,9 @@ bridge \- show / manipulate bridge addresses and devices .B vni .IR VNI " ] [ " .B src_vni -.IR SRC_VNI " ] +.IR SRC_VNI " ] [ " +.B via +.IR DEV " ] .ti -8 .BR "bridge mdb show" " [ " @@ -1006,6 +1008,11 @@ the source VNI Network Identifier this entry belongs to. Used only when the VXLAN device is in external mode. If omitted, the value specified at VXLAN device creation will be used. +.TP +.BI via " DEV" +device name of the outgoing interface for the VXLAN device to reach the remote +VXLAN tunnel endpoint. + .in -8 .SS bridge mdb delete - delete a multicast group database entry This command removes an existing mdb entry. From patchwork Tue Mar 21 13:01:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13182717 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADC42C6FD1D for ; Tue, 21 Mar 2023 13:03:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229821AbjCUNDl (ORCPT ); Tue, 21 Mar 2023 09:03:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229778AbjCUNDk (ORCPT ); Tue, 21 Mar 2023 09:03:40 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2044.outbound.protection.outlook.com [40.107.212.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D83A4D607 for ; Tue, 21 Mar 2023 06:03:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fL1xXVt09Psp8ZlTh9f1MYWdbS8syNPAEsaftFxlrxOFxo8Xmq2AFgKJuVhy1QhvsWMnItEv666jmtuf8InWm/KUWqyMcDEXmNAX4UaFfi/m3IkfBj2JcyA4wcMtR8cEiPl4VwydxhnW6abeSyYPighBq3bVZoYriep2G1wPdVqGzxu1V1Uz+xHx2nwnY7v43w/R2t56HRbwYbIkF4qdZVh0Z9JgmK7GWuBtM93Wyr4aCrTAdTCgVs02+SDdP64qGcawKryMSiU5JylEl9q8SA18QcH/k5WEnbDZEBGU6otgxhfrurpEKctpEiuGFmQQlh605qMV/S1sQsiq2H4IRA== 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=7Z+Qv+tMrx5vgPNjFWzabUosmZXDsDz0BGr6CmtpHu4=; b=DsNSZFD/ULkYxTsUTErk5sDyIrWZT8WDgJNZRuQoKrvGo448jmuiLF4QC9VpotD3Xzb9Hc8X8yaIo0YxpqOVs61z2bZfgTXpF0EkKr5ZCGQQ327lazcONIKrgbn1QnOe3XJ4XdGidfg0hXmRQCxj9HqRsKpH5eJjx3T08qPkFmgac/QCuhm9gB8gWr+8qp1jBq/E3C/Pc31Rss75Uelb9dhC9zwJDPNZhEdD6Urn/OrJKBb3jP3ZcIvOg1f7gRGiLlUA9HSFuN0MAzKTLOzvHd7YJ1vkri5ktTlxP9Rz/eTWAby/HDsi2uwITJlHRvAbkON6hcJTa/6bJQXm3ypgKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7Z+Qv+tMrx5vgPNjFWzabUosmZXDsDz0BGr6CmtpHu4=; b=pQJgNV8JV/Zj0cS5R9SnqnIF3nntxZYAHegWsLa8HRUWNH+q2XgvJ0/gbCoBuT7Mnbzr5R8J1mUAAHQBqGYb1Z0PfIIKwnMwlDTG1+Cm36uF/yxg3Y3fLp0WabVtL4Ws7sTlEOwrZ9k/Wi9mC73vnGw+qbxMcZjLgicTENJIHBxjPsi9t/lsLd1nmuC2Yam8Jd+JymC7r+d6sOGgijmgslap/ad9FLA9EdpZOtLIpS086gMS02Cd8qX5Zyl1JGDmZbb70zm7Jpyo7L5J5R/2D9NZv94VpJTcPi6S67KYi34plgmAWMYP5iKaV5whYzaKm3JXIEWK/I4BSBe4TkO0pg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) by DM8PR12MB5478.namprd12.prod.outlook.com (2603:10b6:8:29::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Tue, 21 Mar 2023 13:02:58 +0000 Received: from CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::d228:dfe5:a8a8:28b3]) by CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::d228:dfe5:a8a8:28b3%5]) with mapi id 15.20.6178.037; Tue, 21 Mar 2023 13:02:58 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: dsahern@gmail.com, stephen@networkplumber.org, razor@blackwall.org, petrm@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH iproute2-next 7/7] bridge: mdb: Document the catchall MDB entries Date: Tue, 21 Mar 2023 15:01:27 +0200 Message-Id: <20230321130127.264822-8-idosch@nvidia.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20230321130127.264822-1-idosch@nvidia.com> References: <20230321130127.264822-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR0202CA0028.eurprd02.prod.outlook.com (2603:10a6:803:14::41) To CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6179:EE_|DM8PR12MB5478:EE_ X-MS-Office365-Filtering-Correlation-Id: da05d515-8f20-4074-8858-08db2a0c9814 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qFkfDIn3hRZzlG7mutIMv4EsLFvMIYRLmpkAIaru+RHmOn4TXhAcmMXGd+7jPKf2wgPBY6Y8OL+RZFjJle61sig5rJteNjDAC3OgBmXT80JQGDuB6NrId4oj+HC4uYYtMl3lgBimtty5gsEQoRGSY7glVtDgB8x78SZfgBcrKgF5P7hoF1t78pHaz/Moiwz3H1NJHjEAVcloD7Ax525ns2LI0OJYn3HSsI+oclF/2N6racxlQRoLt/D5s0Swg2Upc0a8/Gi1QTJZxSTw5X7oqJ7MWCUO0P/NkWTLz7QzIrMhZ/34KdmM9awi+S8AMlWFdzRtpe+v5SDs//HsUnJtK4ETMXl0qHiEUGOyI2IPaTzpZzTP1fswuiWQp7w6ZlBd98d8Fd4WnCvZCyAR0+oxO/OJPGQa0rP2zElcHi8/un6FvSjOABnWP4/n0zGQKH8GxgJwaD+TENVZCw9k2037s9Av7H2GHEbBaLlYqE6mCLzf4e8ZTylU6T4bSFLxRtew4DxalGHwNSXVpwE29Uv+Ha51KmmRXo3xvQbT0RdQ4okU7w+YGfkvlO802CtIzvZH3SBP03MexF9Pga6PfDVty+qmZFASfu+LHG+LmTyHJhnpBUxgrN+jleF1qwt+voWEuJhY57DGV2lwsMOa8kJDchTD2ROQtaMuXebE+qnukRhAnQu74oALVviihj/4nrb0 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR12MB6179.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(376002)(346002)(366004)(39860400002)(396003)(136003)(451199018)(8936002)(41300700001)(5660300002)(36756003)(86362001)(38100700002)(4326008)(2906002)(83380400001)(6506007)(1076003)(6512007)(478600001)(107886003)(6666004)(186003)(6486002)(26005)(966005)(8676002)(66476007)(66556008)(66946007)(6916009)(2616005)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /Jzk3n7W9/5z3Ghb3KAJE8JVPaQjyGqw0y8kpu1N0fLY0raqGuO/12fzDa4M635ETJse/9GcvNXLS5sqfjPxuayJhFj0CbogMxlBcHyD2x2u5tsXOOFffgUVY9A2ovSWREA69D4kDWXgBLUYcZ+tPaQ6Ow0uNV9kvc6mkHtPd+siluteOBNOVxeOW6wz0O53K5D5ozrLzjd7tWMYyYg+9hJ+Qx+bD3Xy8f84xi/kKrZoSQ62baVOsGrGAAxxA/mOd597TyXQkripdnvUjRokOzrxiGiCClN1EI0qgUMIXWGu4SR4CSVBK1SKb3FQ/Oh+L/OdVl1TnHfrytk3ehX025oUntb5njJIWfeg3y2uIhF8pyJyogkmWYyxZshNIV3eirQLrmjWealJvO3vtljahwucnb57qMByGlJ4SBX9qOIfYdX/90NymxyRcbINDGMFlQ4eoSMErUdofAtD76hw5I/O02m8DRo1TM4MkpbBgEmK+yxH9y8CvfzEnLzQhuA1FYZjS3fp34Ld0Rmx10ZHZ47tDQwWb/ZNO7u2kOSpVngPBn7H2UjrD4jxPbkUhztYOMdpXdFi9btVzexxsivTNNRrt2vDSUQ62ZcJwKB3i6/p2irDKWjZL/+uQtU6rposRNwuMfAuDxZ5Z0do5v3hltYT6euII9s5ewwjGyi9Q0dyML4eX8YPEUNuVLg8+1nUi+7uC2ssZaciNvCFqs1R94jm4Wr40aOQb3MQ0iIpqfm+3+/VAXZrsV/boX9YyY6RH2NFyTcI+bMkqV0KsS9pk5MGmGAInHHFI+HYyw8LvUWsJQLwm1V4Yv/Y6F6rOrOPzI6EzhxmvjcqPU8sPpx3qe3FRqsgoBY9zAYJzid0S/TxGVBQYOpdzlg8MxyNiABcAJ6va09vFC7K8uwOqXYXBWwtVqWlImkr22nDoon+lpmQKTvMrYyKMkjVO45QOSR54UmvbOVFUb31nJ8NXIolgp8nRc0srwZy1GSb9DLDLmJ3yuLIefriAYJ3+e5rEm2NOWF548nMpwnCEDvGjaedOfuTv0BiD+GhhmAouX6jKw+3T+/35ULzyS57RKaPLkoaI8ma1wJaqkXIfnS1Sf5RHIIXgLtjR5CsDzYoeH/EqFJ0b7MtMY3cQjdb9QFz54gfguDH47bIVwd7ePDn77qQu/SECXZ8wviCNV2HsI5I9Oi9NjRxVj3wSjjjtptG5mYx8p19IjdhsxzaiRLadDM4qlY6a+ZwMBizpG9lNuILGY2g0uVc9ZFyV+H+ZFtvsrprw7Gw2JCUBjeMQI42E9dS4+Z0y4NqoGDjWnYnVhJyCdYAKjnFqPM62qrejIBHTbMqoaSKp0sV2oo0UIfkIpUpNV1GEHVa0Wf7chtLD1irbTnRlAPMVhSBjNz3B5guFeQCmCScpEru0vrva+7SzmJssg4A4DmwBpsCYjwr87weNR78h/KQ00+U16csorhoW+JCA5b7BFcCeA7V2XtPf3MqsSmpEgdtQDxAbg0QqabFOtSPHDp6ZPR9LDWlLW6l5LaZzohdV7RD9oSBhQ55gogxuPxBxr/mOgkz/6XNbhCMYDu3dP0Mrhtmft9l4/FD6sp4 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: da05d515-8f20-4074-8858-08db2a0c9814 X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6179.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2023 13:02:58.7669 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3uqG5a60qbAdxhErbO4tGjfR+g9bHSu4kz2yCpwGccEvue/xS91Iob578YSXEKJUR2m/ZBGEJqUavebalEOAHA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5478 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com Document the catchall MDB entries used to transmit IPv4 and IPv6 unregistered multicast packets. In deployments where inter-subnet multicast forwarding is used, not all the VTEPs in a tenant domain are members in all the broadcast domains. It is therefore advantageous to transmit BULL (broadcast, unknown unicast and link-local multicast) and unregistered IP multicast traffic on different tunnels. If the same tunnel was used, a VTEP only interested in IP multicast traffic would also pull all the BULL traffic and drop it as it is not a member in the originating broadcast domain [1]. [1] https://datatracker.ietf.org/doc/html/draft-ietf-bess-evpn-irb-mcast#section-2.6 Signed-off-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov --- man/man8/bridge.8 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/man/man8/bridge.8 b/man/man8/bridge.8 index 9753ce9e92b4..4006ad23ea74 100644 --- a/man/man8/bridge.8 +++ b/man/man8/bridge.8 @@ -1013,6 +1013,12 @@ device creation will be used. device name of the outgoing interface for the VXLAN device to reach the remote VXLAN tunnel endpoint. +.in -8 +The 0.0.0.0 and :: MDB entries are special catchall entries used to flood IPv4 +and IPv6 unregistered multicast packets, respectively. Therefore, when these +entries are programmed, the catchall 00:00:00:00:00:00 FDB entry will only +flood broadcast, unknown unicast and link-local multicast. + .in -8 .SS bridge mdb delete - delete a multicast group database entry This command removes an existing mdb entry.