From patchwork Mon Dec 30 08:58:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13923102 X-Patchwork-Delegate: dsahern@gmail.com Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2079.outbound.protection.outlook.com [40.107.223.79]) (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 9742C19F461 for ; Mon, 30 Dec 2024 08:59:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735549179; cv=fail; b=GxgY/J4LaoHqvpNcYfLldh3j/ZrnMjKDGPw6w17EmpdAwjyqDodoZAZTfp2cRlwh9zwNmMPsadxK5EmnUzvYZEmK9soNHnALkmDmMkVgZ/fQLwNbzeJvMKvUSBjqEUf7mT2x9L6LPd3tV+8bfWC1sbRIAgbhQKCA8S2jfVJF3P0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735549179; c=relaxed/simple; bh=3X2V+32zx10YRDsS90NGrBRc1DFNFl1PgV6P+v2Ho5w=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=txWUfdA3bcv61x9p7ffEBTj7ZH0JYg0lQl4KfkM9PshnXiEwtSkrrfg+5CoaMAX92LNRtNqZDeyhGGX4R5vwCiRkIGIQbt6vtC7z3xcXz6cw/rxI+y1E1dIZnpZS7xrUIzhQ3wQZEKhktUVX918TJK3OMb49Uvn+1aScOIMrjMg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=dzSGplCZ; arc=fail smtp.client-ip=40.107.223.79 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="dzSGplCZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OuBbloIYBhj42y0oPp5cULoGN5qwu1anHTOYc21MBU/Dtwphfllm2h6v7MqJf0M5Ib2FxRYlYgan1YPZJHnEbTJdGvSC5U6Qi028IzKLVYqVM4TXA8rWPz8T/5P8zbeP7EDJERgAGZdbIqqVLMXzivGOx8Kno5q4AaIzggGTbAw9GtuWMRFA0dUsxYAYRKFI2iYPM3QebivqbDxQqvN8+yoA/ANz3BmfAkEBQzcuJWhCZYSL+GRCKpf5tdCANm83FpQU8kb4m3tgdoRXYHM6GH9K71TBKxmVxBAaV9Xkb8S9oXrIt/siHEHMqe1rEhF3Ctq9CSiraMNZF1t/BwD7pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=HzPGfWnRgGhDQ9qDSuZpmk1bsrxb15VMDbqVCgFluJo=; b=HrcWfVxXtCG/YJLRdi/KbPqYcEudm4XTVlE1zrCRSY58ws3FeUhmtMjfiSWWrU0efXtMk5KmRcsevyK/Am/XOII/Yn1/+T5GOEndHA0jzzbgfuepKo6gIHWshk0qaefKx9rbM0J845gJRjhNUGiwDLWkvFdLB3FmhKILM1poUjyPt65YpYvLAEvSormSJ6BhoZHf5fXfsWxo7pgc6D3Nj1b/KkJWLtS3z0AVq560WP/AudS89J9q8cj8i8iIDm24F+EASiM+Km4cyUKA8o72PL8B0cSpglzxP6QP7Dozd0PmKLWZB6QNMXotFHGdSxHLSMsxgJyZVzEl/l9FuarWQw== 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 (0) 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=HzPGfWnRgGhDQ9qDSuZpmk1bsrxb15VMDbqVCgFluJo=; b=dzSGplCZMCsDdVQt9yt0aE+ZFFakkS22qqd1JCjrenru3YpMD/HHZ8iUKw2HgAk/Ctwkm8QZBelRZyCs7IGLOZD1aULmLUYG4CSoTal9CpmRZ4nHeSWspxk02GBCV4BGx58B79OwSho+J4Jws0lD8oSjDGhtDxhLV7D/47oaCgL2xgc8Oiqavy6JEJsPuWtA3UnUXOkIj0PfbnKxWH2trOOc9qsKty7XcqAx7/RXn95EezD4HsQI5saQuOO4hTeaHGbMgtCBjAdEemCBdLiRVqSpKzXepnypwvP/AlEYarRTyG/Ca0WlFjUEddxpFaBra7nvTgKESqzV9cwWtFzavw== Received: from BLAPR03CA0083.namprd03.prod.outlook.com (2603:10b6:208:329::28) by SJ0PR12MB6712.namprd12.prod.outlook.com (2603:10b6:a03:44e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.18; Mon, 30 Dec 2024 08:59:30 +0000 Received: from BL6PEPF00020E63.namprd04.prod.outlook.com (2603:10b6:208:329:cafe::25) by BLAPR03CA0083.outlook.office365.com (2603:10b6:208:329::28) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8293.19 via Frontend Transport; Mon, 30 Dec 2024 08:59:30 +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 BL6PEPF00020E63.mail.protection.outlook.com (10.167.249.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.12 via Frontend Transport; Mon, 30 Dec 2024 08:59:30 +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.1544.4; Mon, 30 Dec 2024 00:59:12 -0800 Received: from shredder.nvidia.com (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.1544.4; Mon, 30 Dec 2024 00:59:10 -0800 From: Ido Schimmel To: CC: , , , , Ido Schimmel Subject: [PATCH iproute2-next v2 1/3] Sync uAPI headers Date: Mon, 30 Dec 2024 10:58:08 +0200 Message-ID: <20241230085810.87766-2-idosch@nvidia.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241230085810.87766-1-idosch@nvidia.com> References: <20241230085810.87766-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: BL6PEPF00020E63:EE_|SJ0PR12MB6712:EE_ X-MS-Office365-Filtering-Correlation-Id: b214064e-c978-4652-0ec1-08dd28b04597 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: 798/0rArzi05Dt3j3Si4IelNTf35taJ3CrjHLlzb0CNXg/FyMjsfEYOvFo8IOlZ3uuaALnPiHwpbMNmKPGDAkd5jF7B3W4EGQS55W7YjFBkvhstrmrkwSiGQHlGAPdVpRUlsGHD8lfR392ewN3SK2pue1Ye5FMSuXNMrVojRlaCM95ZQHeGjBiOI1jDDMNGRdZKg+akoREWiMumriTQsJI8H7cr/hO/65FMa2SDlIKibq9/QSFUXsmhivbZdZokCVz1H5nTfauLbczmRzkJ/sulJTmt+emCbjMtIV9RXGQYOitIeVcKSGofE72QbYDMZB248faNmPImzjSnaM67hMOaSSlU658RXDeR2RVmSoaSLzSIggNY9r0P83vh1hHMBu5yVlMASkurRNUKhnpKof6JaMpVvW20DwbOgYB8Bj1y7J0l9ExGatwYdnJ6ZHUnavMahJ+NyhanZ6VzLHiDXTjio/z0xRkysUeT8YtE6sqvGhF4RsYlBB+mSBtteG64dhz3vnITjFB4cSdmNVzXthmxb0Xo6/UkAxGBEM5aaKfki6jQ8+bkuDbaeBsDL/1uX1dwywseowGliyTdHc/ZTX8tJG2bF6luizPgVtsvObMjVMB3fQJcruDnf+4aGd0+DyvFgXE06BBUp45kBkbnZ8aLoou14FkcQqkJHS/uPYH7PBNqe72J4BBpAY3QZh/MikxqXl7V2HhAm982uZSkzjbWyP6Ukar5IT22kL6ZPcCLx2ix4et3klTYFgP2KFWXaXPBhiXAQhrXPn51XVwQ1RsdT5EHvLgmrge47F9bPKFn2UkOp7jRE8WXESMlPUxBpj4DW+bgWKnIWp468TnJavriG8BC+ZhV8wA8AdNRzwgmD0OAhBqUeEQMoQTQiAwT1MBCYvSm/B+fR22TIX/A+ekLiU21M/WtMM/YN4MgNkzKEPlSr4tly0aWI/2DJYdf3C89ZNEBGSueEOsa44Oo4d1z5YGYHUdlWtYeSc4EEgq+zrgsdKLJKVj14zjho5W7s4OEWCulqeMrKWNmgsa0XARSvPzbnK8xe6ko2d8eheOkcSfBE1ohgYQRySG6JjY3nur1x20PiaSc6KKoaWvhAAmHp3L0RxoX9sq9Gk56IUCTdzw7IQVItIQJgkr8jFUbTDsGYUbVga3Iezh0NOzHF7Wz540H7UEGxGEZN9W4FJj7/WDciboQE31DnPjtH3dVou1UA0L+i0WNvT1F6G36id7C1LLRjO2OK7P5G0ODnyc9pB8CkmbjAiom1a5kQx5/4f2qaqpMu8EeR9yGBy5b0P8EaOGRZim85AAwcEipFpcEQjkGN40MAC+ycc4rKllTZNIgMRIKRfiuMZmZzxPwqsthr+gKB3S9qH1JWiXXkGGluehbj/86fyoPuP2xdptIschDX+wYYgMWcKnW9VULg86m98W2MALjjIeQotcIJe8H01BKnrWRuQlBOP4WIZCzUaDOBCrzh/fWOR6N1gd7hHhd4qKAFCibhtzwN3n3oMKs= 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:(13230040)(1800799024)(376014)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Dec 2024 08:59:30.1486 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b214064e-c978-4652-0ec1-08dd28b04597 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: BL6PEPF00020E63.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6712 X-Patchwork-Delegate: dsahern@gmail.com Signed-off-by: Ido Schimmel --- include/uapi/linux/fib_rules.h | 2 ++ include/uapi/linux/rtnetlink.h | 1 + 2 files changed, 3 insertions(+) diff --git a/include/uapi/linux/fib_rules.h b/include/uapi/linux/fib_rules.h index a6924dd3aff1..00e9890ca3c0 100644 --- a/include/uapi/linux/fib_rules.h +++ b/include/uapi/linux/fib_rules.h @@ -68,6 +68,8 @@ enum { FRA_SPORT_RANGE, /* sport */ FRA_DPORT_RANGE, /* dport */ FRA_DSCP, /* dscp */ + FRA_FLOWLABEL, /* flowlabel */ + FRA_FLOWLABEL_MASK, /* flowlabel mask */ __FRA_MAX }; diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h index 458e5670ce67..478c9d836a7b 100644 --- a/include/uapi/linux/rtnetlink.h +++ b/include/uapi/linux/rtnetlink.h @@ -393,6 +393,7 @@ enum rtattr_type_t { RTA_SPORT, RTA_DPORT, RTA_NH_ID, + RTA_FLOWLABEL, __RTA_MAX }; From patchwork Mon Dec 30 08:58:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13923103 X-Patchwork-Delegate: dsahern@gmail.com Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2081.outbound.protection.outlook.com [40.107.94.81]) (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 A2C711A2397 for ; Mon, 30 Dec 2024 08:59:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.81 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735549181; cv=fail; b=TzWRkN9v7mIRwQnH8QEfzbszyjo8UaVbN606s8KUBFpxOL++cNVciWRNEPgXNhfaAOwnUPyEbBN5ostuM8djy5LSinRSK4JE9fTF+07ylinDhuiJZxnG3i3MG4W3AoyRsTB8kJXc8Gj87ggNx+NSTLniPit+cUEg+60KCpO1hDE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735549181; c=relaxed/simple; bh=LTzqzUXAcQ0eO4e6h4fbZjRhBdqCaOlyTSSUxKUDunE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sLk9XwP7xH0mvuAheQIVIbeMf1OcRBzZ4jXdVywD4MQqLZ1vGKh9C3fI3I6QGKqJ1eKMMYcjodXq4fdISR+lZvkC+1Zw5xuS8nOs5NhEWbq4GnDOzcBkZOP6QJKr9NuHYkWdQLqb1lWMDE6IdoZ7VQ462pp2jR+h5q9ohgMLI/4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=Oxx+Dzr6; arc=fail smtp.client-ip=40.107.94.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="Oxx+Dzr6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QXnmR6fB7bEfj4fURWeOT6QTmaw1jjYQ88WNLwgnxtEPaxNFSg07z3QA7fOgvCZbgLPrHRJxjxp7Bl7JvY+UNBcHtxCm9Q3afN6Xhw0CDT7hydOVNYlXfiyWYvv9mc9dDm41LqpqNNaoKAnpcQWr3t8HKdUBhVmkkj0wEOcT23uqzgr6ZA26RZngs+eVypKuCPaUUYUxMimcwEox/7gWYWHS1oh0wgU9TcP+h/sZkKBYQrwZ2namFmSsuTawTtFvEdz/peDTEE8836CXL9UzRa6RzWpiWNXyXG09qfJiFpakPcSlst9kPBgccCJluu57BlZ3nY32YzgV0UDn9kKGyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=5381jDYk5P2h5SS4wPh6xE4nVN6bX43m7+OG9j9Kzhs=; b=bJMNM1KqDPK2dxs9giZ5d33yPU/uGLSIALCNYoo1yh3xMenO6hZv43UHaBBPyhjUgphyvQqzX/Pa/rbYPYOjGC74MNKwzLrpKPvB3SXFypQyoy4FoQDKFkaY94A8+Jn7jjh5LQVEwiKMolCOvYp2pAACkhs8boIeREh54Fetlp3etvY5rG804x8cmM7s1S7TvbvfgPbPLpCi7aCW7bIUP32GGJMQjVMOoSHy1JHQKeBWUAk8I0QeSLKz6HjnD5jcvuBbYuZCYLr8p2nlJNdMN/tNUTEiOoA60Vyuhq0L6i3RkyXkzRGSsbDbF2b90awggdFaGjDVvTky6b67G0Ep3g== 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 (0) 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=5381jDYk5P2h5SS4wPh6xE4nVN6bX43m7+OG9j9Kzhs=; b=Oxx+Dzr6NfkJLuAKV6Ft08Jnm6PZQQWIBbnH69qExx6zwf8PO/1rD5BO6LRoJQ9HTonYsNMpXryINA/zUXI5MZiE84m8s48l8X1O6TBqsKzJ6tD83fE6zwL0Q7cxMGnpqwjQBCg83Y2xfp3PgKKibQW9ViKAjqQbO8Sj9kv/yG2dHHgTXew8Q3z6tyt8eWQKxc5BS2hE6KSvwp4vFtoSpSPRaq4QF2TVEc41Qwapx4nIWkE7JPW0Rh7m+SD45SsXXnuQfD7ZlziLyZN4bzKKXWFJ2jKG5RYa9Rd1ChVBlnIad32/ubjVexKQLw0lU7jcl4H8WGsktFHnA8ldOc9rZw== Received: from BN0PR02CA0014.namprd02.prod.outlook.com (2603:10b6:408:e4::19) by PH0PR12MB8824.namprd12.prod.outlook.com (2603:10b6:510:26f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.14; Mon, 30 Dec 2024 08:59:32 +0000 Received: from BL6PEPF00020E62.namprd04.prod.outlook.com (2603:10b6:408:e4:cafe::dd) by BN0PR02CA0014.outlook.office365.com (2603:10b6:408:e4::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8293.19 via Frontend Transport; Mon, 30 Dec 2024 08:59:31 +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 BL6PEPF00020E62.mail.protection.outlook.com (10.167.249.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.11 via Frontend Transport; Mon, 30 Dec 2024 08:59:31 +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.1544.4; Mon, 30 Dec 2024 00:59:14 -0800 Received: from shredder.nvidia.com (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.1544.4; Mon, 30 Dec 2024 00:59:12 -0800 From: Ido Schimmel To: CC: , , , , Ido Schimmel Subject: [PATCH iproute2-next v2 2/3] ip: route: Add IPv6 flow label support Date: Mon, 30 Dec 2024 10:58:09 +0200 Message-ID: <20241230085810.87766-3-idosch@nvidia.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241230085810.87766-1-idosch@nvidia.com> References: <20241230085810.87766-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: BL6PEPF00020E62:EE_|PH0PR12MB8824:EE_ X-MS-Office365-Filtering-Correlation-Id: 4daa88a0-ad25-44d0-3007-08dd28b04670 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: vOyFKY91kIqpJyxB95qaQUYfgVD+nsDuOKc8C5sEzTQtVqPJJ6GkCMXp3FB8JlF5fkr03nJxA9WKeqsfyfgkFl62Si3vF8gT1ZCpXQWBW4oy0ax2G5EwUS3rC695uLymXFa6aGKI57IyZbfOSNqAnLVj67tSxBzzvdgRyE2qSjkLp002teONrvdMSHob5RRPxM/GUCSfIxh063mKQ07OXMNPsM7OczTjpV0bB286FnwDc4/SNC5Xan44F5PQ7ihPobD0g1ub21aA/oodrRW8jGiVqsQ5McReBgRFGKdKsu92k/4cStP4sTOlIMG7sselDHOrG7ZStRbOCK9SfogB2hieoJYCI2+VljnYN6am66cEexyzmuhqiietA72P8Tj46qe6Zf+sPJghic3svW29lNenU7uw5a4Ll9LKEIvi7hmnStWrIPDglDC/QUBVfd8i15Z/VNbPjpoGPkC6UlDEdfMTmXtXTp1DKYt+o96UACLJsg2Ti6QPz2agSJy9/zeQF3e7pGg/vi7YQExXVfDy3xqxGe2To9OXp9RpnQZhHEM7DEJ66IWmabbjN4vSbP+TSQXl65nhHrz0RMquTx5epR6gOUUdezWAdJdOQBYhSFI44RYZkP8bDZi1/r7nrJhTYAG8Cn99zGynLsPIBBuvGAxmIXXBK4vxl+8SR3IqulExEXAPTEXR1F0VQidkCApYiZzejrwglA8Q8s2QVmZKtDaQkThd3eEC6pVF24sNlU9E/27AZDyQZ+MyRlndD7KJ71R1hw5XEeIgWjvgy87dJ427qRUwOm5VODMWX6EV7NuuOW3nuPBlC4qjGNLFmUv3Jfqpnmzd+whrZJEze9y/6BNylfRX6SNdFFJ2RQMTFdLQELF8rJVRYJVTazu6xnIZYsW2t486Syy9fvSXalATxAt1F8uRI2MKYZlHC3tR8BUDsGd6qcFGupNPEgNtL1BXKhqF3A8X539BqB7xf0McUESjxWG4yUd5bjTQok/xbVJee1H/hDnfdKmxpXsSZp60U1oWKhT3hGiqxZ583LJPwZrpj1NfcAbzBY4SUgBkUjorc0qneAog7dIbBNT19oK46TP5+o0XgmBeD/ilWff9Q4A0GD+MBrRzYgsAsxrx+o8Txdrb2JW4au3yyI7MHMwrAWO5hWveCIi6hHvx3/1v1e8HNz3nQUCVyqam5+Uw7xHS5DfeafiUU0H0OlVd3aPy8CI8xr+3hiflipk7jiUnYjzZATYUYkOy3MQ+CYg1LsjrCGpoelO3F+dWp84ovrosNVFo/6Smt7fm3DpQPL1XmwIAYZsMHbenC2tFrafsPkUjoP6Ue939DClQBEMOILPDELRVmkUVWmbB8mwPa3h0quUNkWv0urXCWUDQkMwvu9lpOiDJK6Rar+9Eq36m6P6xpRS0qTlHz5PakEvQJR/bmG/imeBAkGYcvXP3FUCAxIPP90YcYmeISVHO91x6SW4+zg0g1IDWmBc91kD7RWjiswds3m4Zpg+25UhQ9TYQ4kQ= 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:(13230040)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Dec 2024 08:59:31.5559 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4daa88a0-ad25-44d0-3007-08dd28b04670 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: BL6PEPF00020E62.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8824 X-Patchwork-Delegate: dsahern@gmail.com Allow specifying an IPv6 flow label when performing a route lookup. Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- ip/iproute.c | 10 +++++++++- man/man8/ip-route.8.in | 8 +++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ip/iproute.c b/ip/iproute.c index 9520729e58eb..e1fe26ce05d0 100644 --- a/ip/iproute.c +++ b/ip/iproute.c @@ -67,7 +67,7 @@ static void usage(void) " [ mark NUMBER ] [ vrf NAME ]\n" " [ uid NUMBER ] [ ipproto PROTOCOL ]\n" " [ sport NUMBER ] [ dport NUMBER ]\n" - " [ as ADDRESS ]\n" + " [ as ADDRESS ] [ flowlabel FLOWLABEL ]\n" " ip route { add | del | change | append | replace } ROUTE\n" "SELECTOR := [ root PREFIX ] [ match PREFIX ] [ exact PREFIX ]\n" " [ table TABLE_ID ] [ vrf NAME ] [ proto RTPROTO ]\n" @@ -2129,6 +2129,14 @@ static int iproute_get(int argc, char **argv) invarg("Invalid \"ipproto\" value\n", *argv); addattr8(&req.n, sizeof(req), RTA_IP_PROTO, ipproto); + } else if (strcmp(*argv, "flowlabel") == 0) { + __be32 flowlabel; + + NEXT_ARG(); + if (get_be32(&flowlabel, *argv, 0)) + invarg("invalid flowlabel", *argv); + addattr32(&req.n, sizeof(req), RTA_FLOWLABEL, + flowlabel); } else { inet_prefix addr; diff --git a/man/man8/ip-route.8.in b/man/man8/ip-route.8.in index 676f289a6d26..69d445ef8b5c 100644 --- a/man/man8/ip-route.8.in +++ b/man/man8/ip-route.8.in @@ -47,7 +47,9 @@ ip-route \- routing table management .B dport .IR NUMBER " ] [" .B as -.IR ADDRESS " ]" +.IR ADDRESS " ] [" +.B flowlabel +.IR FLOWLABEL " ] .ti -8 .BR "ip route" " { " add " | " del " | " change " | " append " | "\ @@ -1316,6 +1318,10 @@ was given, relookup the route with the source set to the preferred address received from the first lookup. If policy routing is used, it may be a different route. +.TP +.BI flowlabel " FLOWLABEL" +ipv6 flow label as seen by the route lookup + .P Note that this operation is not equivalent to .BR "ip route show" . From patchwork Mon Dec 30 08:58:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13923104 X-Patchwork-Delegate: dsahern@gmail.com Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2079.outbound.protection.outlook.com [40.107.244.79]) (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 C600B1A239E for ; Mon, 30 Dec 2024 08:59:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735549182; cv=fail; b=KSAtCwYBVQAUMMaV4xFJ4erHj7C2JzaDhQg9WtU6cc/DrzSNJn2zaM1PZl1y0BJHs2BrYGsWTY8qxErDrK8fNP1OmGFHbzflJcZoTh7+EGq56epDNm26P8Zyuuk9wYj15sNX+odDKGN60WDew23u+qarbAkgE6dczuAENYYUyI0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735549182; c=relaxed/simple; bh=cFzJbgkEeg2c9r21Ub61Xbr3XWVZmzxzJbLCgd5PXmU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ey8dw3j4LCcKuy2J6oEH8kYP5/WQdCyjTodAZx0COt6kQ41yC5ltZpAdYJRs4X5v/QNe1/rzBsOdaE0MxHYmwhaLlFcYnMShaavBRlahC33qx4XpSTlu2eXRaHxstV636MM/AKCtJ5Nr5e1m+PNZDnqMBe5uYhHeul6SfwQCK/8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=CZdtrAoY; arc=fail smtp.client-ip=40.107.244.79 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="CZdtrAoY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SLr4ecxBbMWcaqxWP+TWmuJ2s7LIiL9I58YnYpZSWb1dSs4TfuVAkO1fYFZaznzwe5F19nGvfzSnHdpOuvfDqwbzsp6AowtP8K049Ccw02ONUWhhcg7chKMOX4jTCoPrptU/aqrdnNxW0Pgz0OaK5JNjBp12Ptr3BhxTI3cfzB5sOYt8lVOR3NnqlmDE7lyrw062eOgFACun2gSevEFCWJutZlWnjtRtICpqOWlRx/tYgD1H2RuhfCfRRLgI20WtvF/DsIUVb4GZuE5PxYNRCXk9tUfinoBf4avwU9Z/1fMlFmrV66hF4/+iYD7Za8n/uNQfuDes70Besd+1IMUFbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=+lEyPvPXUhOzictXE4A+CSqPmZUcmArk8LelsmVHiXY=; b=gzesNDM2i2G3PEYqyLFwcxdq8GNRZIC+uASYCz0NLgbMPlmrquGENVHBz9D6b4wP7WR/e9gjSh6c0wK4pERQ5ON9XOfYNaMnuUmqtbvRelK+GKx15uldoeHVyhFnFMA2q33vgzXT5I72AkU4zBYFJpUTIo8praWEKkBum+N8gLLZLTgNsACrUbTkDfTN0GucOYhMnEavGS6seD/HlNPJ1h6Ql0M0qnfKpDBvk5hy3q/Kw+PmOexTjZm68ARGsV4Tpcn4sqxbNmVgDLnXtChy/fSJYBfEpJ//GBOLHTp4Nxki3J4aFPFd4nzoiAjzhsZ/lZcgTFAebsGtj/S+LOHGXg== 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 (0) 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=+lEyPvPXUhOzictXE4A+CSqPmZUcmArk8LelsmVHiXY=; b=CZdtrAoYzuyVu+m06O5p7cfNetuvFVZb16Mg1q8FC+tgUhFotcnbdK7uS56bquycNrxUFLQztEapTZUK+Wbj7rm/lgj08GtQo0Ml6MRMB7qCbJlTE0ltuTYqy+nxYxecbLLQx+oh1Uow6FbQtHdn8LaLPhrdfqAweREYf9vBDlVFUrgwcGR5pszVh30HDFita0QJUcaXOuhj/R7YdIBnMNd66lq+kn61KpmgIvlJcFtcxkQtRQWUi4imgjyobpYEU8d+iTHhE12ndvV6uuWkSI5JIEw67+UlzUptTPcdy2RM9P2uNHLYq5hcfs3o+NyYThALrXYXDHsG8/p+A+rNjA== Received: from BN0PR02CA0014.namprd02.prod.outlook.com (2603:10b6:408:e4::19) by MN0PR12MB6002.namprd12.prod.outlook.com (2603:10b6:208:37e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.19; Mon, 30 Dec 2024 08:59:33 +0000 Received: from BL6PEPF00020E62.namprd04.prod.outlook.com (2603:10b6:408:e4:cafe::e8) by BN0PR02CA0014.outlook.office365.com (2603:10b6:408:e4::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8293.19 via Frontend Transport; Mon, 30 Dec 2024 08:59:32 +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 BL6PEPF00020E62.mail.protection.outlook.com (10.167.249.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.11 via Frontend Transport; Mon, 30 Dec 2024 08:59:32 +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.1544.4; Mon, 30 Dec 2024 00:59:17 -0800 Received: from shredder.nvidia.com (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.1544.4; Mon, 30 Dec 2024 00:59:14 -0800 From: Ido Schimmel To: CC: , , , , Ido Schimmel Subject: [PATCH iproute2-next v2 3/3] iprule: Add flow label support Date: Mon, 30 Dec 2024 10:58:10 +0200 Message-ID: <20241230085810.87766-4-idosch@nvidia.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241230085810.87766-1-idosch@nvidia.com> References: <20241230085810.87766-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: BL6PEPF00020E62:EE_|MN0PR12MB6002:EE_ X-MS-Office365-Filtering-Correlation-Id: faefd1db-6425-4bd4-6282-08dd28b04725 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: aa/C2Gab+96ljRJQU3AkojBv8ePHDGNefMoMOpghPnUCFAVWAC3BGgSFVSC83iM8iCKd9QDw1eTuUx5w9wKlMr0y0zsdTvxifYqPk/eJoBmNMobsyvm/+heouuzrR1pXLlseQE0R3USMASyTEmDv9bt6fIecI0ypWobKOD/vXimKhvETImJeo8che2K9SL7l4H4CUrJiMjf8rY86xbpX1GzRG3+YfmO8t9hvOD8317bvvtj0N/eHbFI4Z3X6b133tfjT/tIrCV/ewUOHHYZZOpGwDrVUFC6C7+X9OaDyjQsjNxazogwkiBiNOsC8nj4q1F31tChLWHrNJ71CpbVp8X232b5iEDTLOqdji/yydOPQEuzx0ir+biynPtmLIdW7L6SJSRqz7fq8ruxiA5jJy93GZ/ys1RckTcCAMLFv1p4l1H7JzQkxP/ISPPLsblpJyKp7xuB2TqBS2B1+BcCA4Sh53R/efBMGBHJyIqg5Ik/Qd9gZT9mTOd/jgCH7znFG5LG4O00YFzRN+Xo2XqUu/WldCpZnKntvi8Q+5lNlO44qrOf6ZaKVamt/CE6RI5OO8nKuze+vDe2nKh9oKAEru0zIlbvT3crfDvbswD56rTE5qqzO7BH2C2B+8gwiTFgnSp1GCzCSiF40Xl1ZecUdkSiKTviEo5OL56972cnysNGkCHrbqkDwxe2wMcxWkdD3m9D405VcBUbL7JqeYdA4bW5xaXG2DgCGBoipwBAk8DlV6tIS1Q9csbYLFLWABjju43HAlQip3XAJ/lA4x31+bG1jgARKaaS0p+zdcRTpbRNaRcV9s7lfWoPBw49VwRoq0wkKg4/WRnDU+WMUsgm2YQah4XQF73bNwy6KgDE7nqhxgxRAI1XM1RF/9nHMyf+JxyvpRYqqwlKJgjmvrB6rjUwyrofG214sGRtpsD3xJPxhtaAimqE7dedc5VcD2j3BiR46K2A5+KOirlDfL3k6pL5ILbDwBHVyvhq7WhSuyPQyW5cgdSSU2o0bJ8ceDF5SnblDWNOO3k2PnoCGCX+4Rmd3RuTwYs4BIQktAGuV0uAAaK/PJF7zwCSM9rL9sXCx3NGQtIcfOqkMkKOFKjKuAmfKPbKMDgSCw4RigV9xePxvgY0dXq4Bgk9rojcq/oH0cSaALUJta/pElcXgzp9oSG+f0VXYU8w5izOFUwP7qhfHu760HY4+oNjKCGj3mdrtLQYgHH22Dijy5rya6VWmZCKOSZRZeHpsSz2AabGO354UGuAbIGsezWFy5NZsKKE0vstr7WkJYF19Tc7O+vzP+q8f1sDUlk28PA71oEYvKhJigTHsczKzqykGddbHLN/fJHgAyy1G2ZmW2wzTsEG7DTdRPJECuXmhy7gDDb6uQoE0vWLlG8AoeqNOMuMKvrE351YvThD7YDZOx1o8asBu/Jr3kMYMevZSKSOMjD6E3YmuIQqS9dQsi0SlwfHNymuu5k6KxfhM6TQzZKp5qEMJfCW/EdfHVrs53/bz60IWBmk= 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:(13230040)(82310400026)(376014)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Dec 2024 08:59:32.7434 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: faefd1db-6425-4bd4-6282-08dd28b04725 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: BL6PEPF00020E62.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6002 X-Patchwork-Delegate: dsahern@gmail.com Add support for 'flowlabel' selector in ip-rule. Rules can be added with or without a mask in which case exact match is used: # ip -6 rule add flowlabel 0x12345 table 100 # ip -6 rule add flowlabel 0x11/0xff table 200 # ip -6 rule add flowlabel 0x54321 table 300 # ip -6 rule del flowlabel 0x54321 table 300 Dump output: $ ip -6 rule show 0: from all lookup local 32764: from all lookup 200 flowlabel 0x11/0xff 32765: from all lookup 100 flowlabel 0x12345 32766: from all lookup main Dump can be filtered by flow label value and mask: $ ip -6 rule show flowlabel 0x12345 32765: from all lookup 100 flowlabel 0x12345 $ ip -6 rule show flowlabel 0x11/0xff 32764: from all lookup 200 flowlabel 0x11/0xff JSON output: $ ip -6 -j -p rule show flowlabel 0x12345 [ { "priority": 32765, "src": "all", "table": "100", "flowlabel": "0x12345", "flowlabel_mask": "0xfffff" } ] $ ip -6 -j -p rule show flowlabel 0x11/0xff [ { "priority": 32764, "src": "all", "table": "200", "flowlabel": "0x11", "flowlabel_mask": "0xff" } ] Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault --- ip/iprule.c | 66 ++++++++++++++++++++++++++++++++++++++++++- man/man8/ip-rule.8.in | 8 +++++- 2 files changed, 72 insertions(+), 2 deletions(-) diff --git a/ip/iprule.c b/ip/iprule.c index ae067c72a66d..ea30d418712c 100644 --- a/ip/iprule.c +++ b/ip/iprule.c @@ -46,7 +46,7 @@ static void usage(void) " [ ipproto PROTOCOL ]\n" " [ sport [ NUMBER | NUMBER-NUMBER ]\n" " [ dport [ NUMBER | NUMBER-NUMBER ] ]\n" - " [ dscp DSCP ]\n" + " [ dscp DSCP ] [ flowlabel FLOWLABEL[/MASK] ]\n" "ACTION := [ table TABLE_ID ]\n" " [ protocol PROTO ]\n" " [ nat ADDRESS ]\n" @@ -69,6 +69,7 @@ static struct unsigned int pref, prefmask; unsigned int fwmark, fwmask; unsigned int dscp, dscpmask; + __u32 flowlabel, flowlabel_mask; uint64_t tun_id; char iif[IFNAMSIZ]; char oif[IFNAMSIZ]; @@ -232,6 +233,19 @@ static bool filter_nlmsg(struct nlmsghdr *n, struct rtattr **tb, int host_len) } } + if (filter.flowlabel_mask) { + __u32 flowlabel, flowlabel_mask; + + if (!tb[FRA_FLOWLABEL] || !tb[FRA_FLOWLABEL_MASK]) + return false; + flowlabel = rta_getattr_be32(tb[FRA_FLOWLABEL]); + flowlabel_mask = rta_getattr_be32(tb[FRA_FLOWLABEL_MASK]); + + if (filter.flowlabel != flowlabel || + filter.flowlabel_mask != flowlabel_mask) + return false; + } + table = frh_get_table(frh, tb); if (filter.tb > 0 && filter.tb ^ table) return false; @@ -489,6 +503,23 @@ int print_rule(struct nlmsghdr *n, void *arg) rtnl_dscp_n2a(dscp, b1, sizeof(b1))); } + /* The kernel will either provide both attributes, or none */ + if (tb[FRA_FLOWLABEL] && tb[FRA_FLOWLABEL_MASK]) { + __u32 flowlabel, flowlabel_mask; + + flowlabel = rta_getattr_be32(tb[FRA_FLOWLABEL]); + flowlabel_mask = rta_getattr_be32(tb[FRA_FLOWLABEL_MASK]); + + print_0xhex(PRINT_ANY, "flowlabel", " flowlabel %#llx", + flowlabel); + if (flowlabel_mask == LABEL_MAX_MASK) + print_0xhex(PRINT_JSON, "flowlabel_mask", NULL, + flowlabel_mask); + else + print_0xhex(PRINT_ANY, "flowlabel_mask", "/%#llx", + flowlabel_mask); + } + print_string(PRINT_FP, NULL, "\n", ""); close_json_object(); fflush(fp); @@ -569,6 +600,24 @@ static int flush_rule(struct nlmsghdr *n, void *arg) return 0; } +static void iprule_flowlabel_parse(char *arg, __u32 *flowlabel, + __u32 *flowlabel_mask) +{ + char *slash; + + slash = strchr(arg, '/'); + if (slash != NULL) + *slash = '\0'; + if (get_u32(flowlabel, arg, 0)) + invarg("invalid flowlabel", arg); + if (slash) { + if (get_u32(flowlabel_mask, slash + 1, 0)) + invarg("invalid flowlabel mask", slash + 1); + } else { + *flowlabel_mask = LABEL_MAX_MASK; + } +} + static int iprule_list_flush_or_save(int argc, char **argv, int action) { rtnl_filter_t filter_fn; @@ -726,6 +775,11 @@ static int iprule_list_flush_or_save(int argc, char **argv, int action) invarg("invalid dscp\n", *argv); filter.dscp = dscp; filter.dscpmask = 1; + } else if (strcmp(*argv, "flowlabel") == 0) { + NEXT_ARG(); + + iprule_flowlabel_parse(*argv, &filter.flowlabel, + &filter.flowlabel_mask); } else { if (matches(*argv, "dst") == 0 || matches(*argv, "to") == 0) { @@ -1011,6 +1065,16 @@ static int iprule_modify(int cmd, int argc, char **argv) if (rtnl_dscp_a2n(&dscp, *argv)) invarg("invalid dscp\n", *argv); addattr8(&req.n, sizeof(req), FRA_DSCP, dscp); + } else if (strcmp(*argv, "flowlabel") == 0) { + __u32 flowlabel, flowlabel_mask; + + NEXT_ARG(); + iprule_flowlabel_parse(*argv, &flowlabel, + &flowlabel_mask); + addattr32(&req.n, sizeof(req), FRA_FLOWLABEL, + htonl(flowlabel)); + addattr32(&req.n, sizeof(req), FRA_FLOWLABEL_MASK, + htonl(flowlabel_mask)); } else { int type; diff --git a/man/man8/ip-rule.8.in b/man/man8/ip-rule.8.in index 51f3050ae8f8..6fc741d4f470 100644 --- a/man/man8/ip-rule.8.in +++ b/man/man8/ip-rule.8.in @@ -58,7 +58,9 @@ ip-rule \- routing policy database management .IR NUMBER " | " .IR NUMBER "-" NUMBER " ] ] [ " .B tun_id -.IR TUN_ID " ]" +.IR TUN_ID " ] [ " +.B flowlabel +.IR FLOWLABEL\fR[\fB/\fIMASK "] ]" .BR @@ -322,6 +324,10 @@ In the last case the router does not translate the packets, but masquerades them to this address. Using map-to instead of nat means the same thing. +.TP +.BI flowlabel " FLOWLABEL\fR[\fB/\fIMASK\fR]" +select the IPv6 flow label to match with an optional mask. + .B Warning: Changes to the RPDB made with these commands do not become active immediately. It is assumed that after a script finishes a batch of