Message ID | 20230719-nh_select-v2-0-04383e89f868@nvidia.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2473126vqt; Wed, 19 Jul 2023 07:19:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlHNT3+YxVDpf59q2N2jCqe0dlvQNqQJWk6O/0L01kNXQPTvdjffV05Fc+Ffe1Z74ULGVpY8 X-Received: by 2002:a05:6a00:b50:b0:668:7b5b:c1aa with SMTP id p16-20020a056a000b5000b006687b5bc1aamr24866329pfo.20.1689776384243; Wed, 19 Jul 2023 07:19:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689776384; cv=pass; d=google.com; s=arc-20160816; b=jVj34gI3Gpk3uQPJor2GcZ94r+DFDei56iWbl4+w2KDQ/qYcsxAee+h89qCQrkspkL Z+VcmpZliUexB1kRq286mHzDvXfAyUtQpHNwPRS+UDJHdgbQ/zHLXRcjNyy5C/8RdYiE 0XC4hx2EjeTceE4fy87w8P5J7jMrOfoUSilpOACU6woWCybEW1K4KDZwy7nr6axtjzce Kwb95KmA6MtskoXMu89fvHQIZwTjPdZCEbL3A8Tdi+nbtQD3FStYwHXFUxq3oX994Ro2 2hHwOODJNgm9ewGzgjQ7Ktb+wr7vQ2eoe/9d4orCvalmXQ34rcQXu312AVbTxxv33wgb 3uSQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=F8qym46ezgNLckAquWwjj52z0sAT/TNeBm2ZDzAWXwA=; fh=P+OoruTqX4rYb5vOClp3S2Ec+4Lwbb7mgHr70Gx7J+k=; b=u0UhLhZ7InuCwHNFXmu5ijpr/j72agqYj7rCkWb6ZulJ5Q+WjlZmcKnSoLGYaRKlJr QB6XFIMjz0K2LFUCnZKtLOt9FpeL+Adw6jOmDYwXe67qCRLHW4H+JVs6vDFsnZCwj0xS j4OI5vgvBRDfxjitaMwkJt9tDX1L2BppOY2ULQcVBQvsLg+z7LqUZXIFA6LUGlCP4MaD 0PpYyjkUSOnwh3MAcvt8pQNamoKKOWSw/CcXctgMjdv6cq7TjvjTCNjX30x+G4vfxgE5 7MmGSPN10fXdrdYA+TcEJ0Xdo5t8FJYzt53l9jq/Zz4uO/83bM41BXx00HqAxBtzIz0S MC1A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=AEFDbI2l; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cm14-20020a056a00338e00b006686d07f4b6si3406321pfb.327.2023.07.19.07.19.31; Wed, 19 Jul 2023 07:19:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=AEFDbI2l; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230260AbjGSN5N (ORCPT <rfc822;assdfgzxcv4@gmail.com> + 99 others); Wed, 19 Jul 2023 09:57:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229782AbjGSN5K (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 19 Jul 2023 09:57:10 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2057.outbound.protection.outlook.com [40.107.92.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AB4C1A6; Wed, 19 Jul 2023 06:57:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gnUlXwuxVS0BfATw9o2pvUNbmYczuWaBVCVnN1A5DGqxep/go+xyLREf7tbVAYgI/liYEuwcgEx5Mi4xbYjT0EN4YjOe8W3Qh4MHuuLX2OGumVAeM11ULHTlXu8T55glNGFOae8ylsDp7jCNDR0E9kaAXjLmyqz/T3iCszfLEWa0TZBaNnxbcXaa1xWc80PY7GKADk5oThKnwhGLzm7wsr+AgLzXqk6D8QVK2Z4YGa6H4erxTKPOZhc+8mzyGTQpCwM0EvsscdgPNai7v3CtUoC1iqol8QPvoLOPrZgzFbHS9ldNVokxq2f+CTgoLVqGKv7CiUvPSnO2Z5Vmid7Exw== 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=F8qym46ezgNLckAquWwjj52z0sAT/TNeBm2ZDzAWXwA=; b=QkxXmsSD4Jh59QEOPdBg5oEXxx3nmyO9IRWNw77XKwvXzmJFMFSC6eLiy9t/PDE/QPoxLgihhc7dWQzN4LC8u3eCoxPyPDBzRMK2YHhI+rhprRAhWjEaYs4lZ6NIQNcyT/xvbKYadMHPLFoggTLvb2pUkC0fR3wBGr5juoSAP6F4Pgw3fxdW9R7K/jUnnizqyr82FGOzZiCJURsXBB9v0ql3WG38PsphPxt/GQ0xCnZYnVfhZ2+27ivnfzDCjG8DDLB/2sikmwGWX9zdKaUUxKmv01ZIopF5Ae7XUiJqJgaYJiKPAsfW6EtjGAnMOhzkGnp6fePxm4GkHiE08MfNqQ== 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=F8qym46ezgNLckAquWwjj52z0sAT/TNeBm2ZDzAWXwA=; b=AEFDbI2lVGto4iHG+vNu0qGvTf/Dzfy1j15yq1oQj/KR3vM8sFJTc48S2WBe+HurS1mvkl8jhFNAKM9nMHABpsjhJa6BIeTC0UCx5FnEDqabh4+ts2uNo3LthA3D4OB4psnBxlHWcL7UPq23K1vYSxqTZQnGZ0YfcKy04pJRRJLlJsO6tig2u/cku9J27GdO3by7fX2tG+8uXC1J2B0NnJjCn1gKnz8H9YnBofj0SmGymMa8avcjqkHjMu8nY/7ZBQUmXBRL8AR2o9+14JpNU6TqY4qED3VCrzzLjWpMQS+7GTmCdakpfa1zaFVzWTdOirfkagk0a0988eq/RLpPkA== Received: from MN2PR12MB4373.namprd12.prod.outlook.com (2603:10b6:208:261::8) by SA1PR12MB6994.namprd12.prod.outlook.com (2603:10b6:806:24d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.23; Wed, 19 Jul 2023 13:57:06 +0000 Received: from MN2PR12MB4373.namprd12.prod.outlook.com ([fe80::982f:232b:f4af:29ec]) by MN2PR12MB4373.namprd12.prod.outlook.com ([fe80::982f:232b:f4af:29ec%5]) with mapi id 15.20.6609.022; Wed, 19 Jul 2023 13:57:06 +0000 From: Benjamin Poirier <bpoirier@nvidia.com> To: David Ahern <dsahern@kernel.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org> CC: "netdev@vger.kernel.org" <netdev@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linux-kselftest@vger.kernel.org" <linux-kselftest@vger.kernel.org>, Ido Schimmel <idosch@nvidia.com> Subject: [PATCH net-next v2 0/4] nexthop: Refactor and fix nexthop selection for multipath routes Thread-Topic: [PATCH net-next v2 0/4] nexthop: Refactor and fix nexthop selection for multipath routes Thread-Index: Adm6SOcQ1ibIthrqHEOswUMI1khpHA== Date: Wed, 19 Jul 2023 13:57:06 +0000 Message-ID: <20230719-nh_select-v2-0-04383e89f868@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: YQBPR01CA0115.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:1::15) To MN2PR12MB4373.namprd12.prod.outlook.com (2603:10b6:208:261::8) x-mailer: b4 0.12.2 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB4373:EE_|SA1PR12MB6994:EE_ x-ms-office365-filtering-correlation-id: 1fea5227-692a-40d9-0004-08db88600989 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sKAJbf0fUoZVHbqO2hk3a/IN/I3RhpJI210Ms06RumzMZf+tNaHWkocQrCLz2VzcdpJuMT2DYCEzf9A/ZAvUd4eRk5ydLCBbPXjUXu8UxbJRZum+HNv1vJfn2D1+/1bVAKny4LH2/bq33RTjCjjE8hPCbhAAhVWXRNAO8zbExRf3BI+1lXpQXhJARSvj6amdrUf2dmPrz6Au32NPhe+1Vivevo/h97PdSU0SX/TVJ3vPfO7TJ/8KLLgNWe9XWG86ldB4pxEcHMqhfzosfSir17879oYKnu90IodogOyfqyj2wuybMHwSocW6HaFNnHR9jdef0FbB52DM1HW3LMnQPAgLxg40/U8Nt+kt3bi/irb6ZDpVbCcezL9MbQO1VQOcUTwHc4qjYDZy/D99ZMUsXeeQdUsucm2NYFr1R9U7D8kPfFxmlgt+R8XlPp+NrVS+kGx1A2is1pqCCLD05/zIrR/xAQ2WhTqVr0tfXe7kcDWI8BkrF+QDUDpFUAnrq4bwLGdtz3y9qQIT+AQc4P11ZVymHPtY1u6WxYYdqlyCz031MOqwbmzIhGiR193g1JhivDeWhB8iwYR6EWAP09ouJdhvL8+zKRxqjv5jckDb9kE= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB4373.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(366004)(136003)(39860400002)(376002)(396003)(451199021)(316002)(41300700001)(66476007)(64756008)(4326008)(66946007)(66446008)(66556008)(5660300002)(8676002)(8936002)(2616005)(83380400001)(86362001)(38100700002)(122000001)(186003)(26005)(966005)(6486002)(36756003)(6512007)(6506007)(107886003)(110136005)(54906003)(478600001)(71200400001)(2906002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?NWOIMxk76PX65VF40rlfDtScbItL?= =?utf-8?q?92JZ+H/8Ph1dA4A0rXuyA9b8Lpl/DDyPtXpEG8dHlasKN7EB400SxXOtgJ0zw6vh/?= =?utf-8?q?FZg3sS6R3nvTNf4uG7jFHzNECYLln4TNT356N1WbpP7bdKXOrt2cgvue0TAwAaySL?= =?utf-8?q?ZkQfe7HaKjlLETxTko6wnnXHn4vz8cepH9VRhbaCFV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5a4K7SMBi6sl83PHH2pVB?= =?utf-8?q?yxRMkRhzjoSsCFrBvgICFZRAOk5zOdywCp4LHXtmmteQXsu0V2d9aGOytK87yAHIh?= =?utf-8?q?SzX/IVX59caYQB4V/XDX6XfPqnclnLOFxlkzAdnRgFQcEqI99eS0bjxDCGWrdc3BB?= =?utf-8?q?pA0v/SHJV/ixG/awIXM7y0+1X5jLj+Ux7dOK6bU/smNwIY0SUnUPfbO7LbRbUmZUy?= =?utf-8?q?gcUo45We5a6KyK7UOm/QFsoJyIbuZmVKngR9IKyyL9/EpUbD5cZkzfAUtv5Rzo2D5?= =?utf-8?q?q1V3c3IsbmgcAq9+mw7jEsN4N5nH82GychaMvAgaBnwRWYj/u+JvCk6Jg4Rrucrc9?= =?utf-8?q?DnLAWqGMc/a/How7KAOyk8IMQyux6rcAC50MEQz7LvLjcJ8kPniZvcSfmt3oCUhtA?= =?utf-8?q?3vvuYrn+OBbVjSCzH9OPgigeTML8t4ohUcYC+o2o29PnjwSG4wSkNrZ/ZhLCEKHZ/?= =?utf-8?q?AfQccR/4bv6a?= Content-Type: text/plain; charset="utf-8" Content-ID: <8E9D4BB7EE706245B6BA73BAA5750378@namprd12.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1fea5227-692a-40d9-0004-08db88600989 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jul 2023 13:57:06.1225 (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: 2fEl6yldKqbnGaKyqmAHdj+K3iDJ4gSGsfr7EdlhgaL1mF1dJro4S+qnmZ4FtScMND6DB8c7dxtND9dNGK6yLg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6994 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771858961755228098 X-GMAIL-MSGID: 1771858961755228098 |
Series |
nexthop: Refactor and fix nexthop selection for multipath routes
|
|
Message
Benjamin Poirier
July 19, 2023, 1:57 p.m. UTC
In order to select a nexthop for multipath routes, fib_select_multipath() is used with legacy nexthops and nexthop_select_path_hthr() is used with nexthop objects. Those two functions perform a validity test on the neighbor related to each nexthop but their logic is structured differently. This causes a divergence in behavior and nexthop_select_path_hthr() may return a nexthop that failed the neighbor validity test even if there was one that passed. Refactor nexthop_select_path_hthr() to make it more similar to fib_select_multipath() and fix the problem mentioned above. v2: Removed unnecessary "first" variable in "nexthop: Do not return invalid nexthop object during multipath selection". v1: https://lore.kernel.org/netdev/20230529201914.69828-1-bpoirier@nvidia.com/ --- Benjamin Poirier (4): nexthop: Factor out hash threshold fdb nexthop selection nexthop: Factor out neighbor validity check nexthop: Do not return invalid nexthop object during multipath selection selftests: net: Add test cases for nexthop groups with invalid neighbors net/ipv4/nexthop.c | 61 +++++++++---- tools/testing/selftests/net/fib_nexthops.sh | 129 ++++++++++++++++++++++++++++ 2 files changed, 171 insertions(+), 19 deletions(-) --- base-commit: 36395b2efe905650cd179d67411ffee3b770268b change-id: 20230719-nh_select-0303d55a1fb0 Best regards, -- Benjamin Poirier <bpoirier@nvidia.com>
Comments
Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Wed, 19 Jul 2023 13:57:06 +0000 you wrote: > In order to select a nexthop for multipath routes, fib_select_multipath() > is used with legacy nexthops and nexthop_select_path_hthr() is used with > nexthop objects. Those two functions perform a validity test on the > neighbor related to each nexthop but their logic is structured differently. > This causes a divergence in behavior and nexthop_select_path_hthr() may > return a nexthop that failed the neighbor validity test even if there was > one that passed. > > [...] Here is the summary with links: - [net-next,v2,1/4] nexthop: Factor out hash threshold fdb nexthop selection https://git.kernel.org/netdev/net-next/c/eedd47a6ec9f - [net-next,v2,2/4] nexthop: Factor out neighbor validity check https://git.kernel.org/netdev/net-next/c/4bb5239b4334 - [net-next,v2,3/4] nexthop: Do not return invalid nexthop object during multipath selection https://git.kernel.org/netdev/net-next/c/75f5f04c7bd2 - [net-next,v2,4/4] selftests: net: Add test cases for nexthop groups with invalid neighbors https://git.kernel.org/netdev/net-next/c/c7e95bbda822 You are awesome, thank you!