From patchwork Mon Aug 28 11:32:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram Yagnaraman X-Patchwork-Id: 13367916 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 E5601C83F16 for ; Mon, 28 Aug 2023 12:29:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231386AbjH1M3S (ORCPT ); Mon, 28 Aug 2023 08:29:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232662AbjH1M3B (ORCPT ); Mon, 28 Aug 2023 08:29:01 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2104.outbound.protection.outlook.com [40.107.20.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 851BC198; Mon, 28 Aug 2023 05:28:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bUy5bQ/iDd8p00KyQWKVAnSI5VcoKMROGuLmLaMQZ5eBzicwhMY/84JBripQoU6BMi9O+i8TgLzt4THcRcVoL+FZY3+/ei3mSzZG/JYbr7tk5v9Rdlp29bYDchSJsND6+vzyp5fj/D8Ll5ys9iw9X+LkI4tVlRC8LcSFlb9gGbT+yl77uzqnbMF1zgyxLfYtMVUknCFTJCFAeyzvjeP8E21K/VpDuzf0d80q/A7FJpzoWeNeXw7wHpj4XxtigaO6ogGgEwvhsDN34DUEb3EeY3qlYUC/gD0YAHc3b1DSjgLu+LcxiXjm/fpyV20dARfMuJiLKTWuqqio6HuTnCEEQQ== 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=XCE4pKlxfpEHlaaymtwqhceY03ZRJGtavqbhBRwkLUk=; b=O9AbBEmbWmoDvHOAN1eQtjwly0CJuChrl/x/rvr7PI/dkhDzV3bM9yhOyir2bq0PIvoRZen/vm6oikgYsJKlFwCtyv4mR6pwItoPHAkn1SIwz4brDHeAzBCrCHmmtX7Z5rb4hYEZ+FZdOOkesHsk7x1AUrBR29BGk0kBmw0NRYcfwbypUPmj5woso4aEoeYIfWAmvvFyjUAVO2xqTYID8B2RAzJlNEaKmkKQSYAekljULl9bo+POG2gZhGvPajrr4MsPMP6Fdv3Piv+jmEyXh5GVKZMpvBvuAKkNcma4rq4+1cyibcke1Uq1byvfl81CKs3yvOf21EmxYg2Pfch6vA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=est.tech; dmarc=pass action=none header.from=est.tech; dkim=pass header.d=est.tech; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=estab.onmicrosoft.com; s=selector2-estab-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XCE4pKlxfpEHlaaymtwqhceY03ZRJGtavqbhBRwkLUk=; b=EygHwJ1qk3B4vOKlTNuwxHgDhx9nPW/60V6D8KGIezgyYlTwH77uJ/eljL/gKy/whS+ApHnk0Yi+PeKYMWt4TjiP0fnGLOe9N0Cyp3qmuy+CtuTEnF86dW0v0foxlfI9W1aAFGKPNGBH1bUnMOJtMrqTkS1hiAPDoky/yqsnS8s= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=est.tech; Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) by AM0P189MB0817.EURP189.PROD.OUTLOOK.COM (2603:10a6:208:195::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.29; Mon, 28 Aug 2023 12:28:31 +0000 Received: from DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::759b:94eb:c2e8:c670]) by DBBP189MB1433.EURP189.PROD.OUTLOOK.COM ([fe80::759b:94eb:c2e8:c670%6]) with mapi id 15.20.6699.034; Mon, 28 Aug 2023 12:28:31 +0000 From: Sriram Yagnaraman Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Ahern , Ido Schimmel , Shuah Khan , Petr Machata , Sriram Yagnaraman Subject: [PATCH net v3 2/3] ipv6: ignore dst hint for multipath routes Date: Mon, 28 Aug 2023 13:32:20 +0200 Message-Id: <20230828113221.20123-3-sriram.yagnaraman@est.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230828113221.20123-1-sriram.yagnaraman@est.tech> References: <20230828113221.20123-1-sriram.yagnaraman@est.tech> X-ClientProxiedBy: GV3P280CA0015.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:b::13) To DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBP189MB1433:EE_|AM0P189MB0817:EE_ X-MS-Office365-Filtering-Correlation-Id: 54189382-a968-4e20-6769-08dba7c24a6b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: on+fdWGmaGkveMkE+6dhNIi7ACdjkhnb/vLdGjRtgmiUD9OpuunmJPWZy8Ew55q7p+pHBzzdT0rcLiTxBXM6cZueNklQ5MY/zGCZ3lPNzHT/5yR7Yd+3pYM+JJaq3oCE0RQ67saRBFEZFcd3TLonIYn9Nwzvbz+RF2aMZhi+5qv4gJ7JN9S5Io1uLDSsph+yk/DgI9LMy8ID5hx8GFsE95l1wGZuW7OFFYSPmWU0Ytfjq1Uq8roDuRNQwTAASwxRw5iny7/rWGoyjVdLiOYNPK8CdnAYvIcvmv0kS4Cdfr397Ci5fbTWnmwhJT6ZtRmGxJXglYCoBa35q8bJgz5EZbrjOtPEQtq7wOrYVL6mWaiC4NnG2hN74RLOdStoSd1avi3Zm3QFA3GzXxOyhhw3/uOD6ib0apmIiuXdq7OktKsGYd9+Za/P98YwRV1kWpIUiexXcI/UnmiXZpe3M5Wy79+zJYC29iLF8Nh6YHoBotTHPcOtuBiK1FBGa726gJdYoEnoxNX0+SCgmq66g3CmogUa7fFI/eZpG9oMY9B01r8xFJodqUKOoz3eoYUxYNjq8z3uIkIuHE0BIM3Uy9cc/5kjVZqDaADqqsiTn3lpK3+4BKHscw4sllM9VJOkY3d3SCOEbEYmh/bSPss3eCo2AQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBBP189MB1433.EURP189.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(346002)(396003)(39830400003)(376002)(136003)(1800799009)(451199024)(186009)(109986022)(1076003)(44832011)(83380400001)(6512007)(478600001)(26005)(7416002)(2616005)(5660300002)(2906002)(8676002)(8936002)(4326008)(70586007)(6486002)(38100700002)(66946007)(66476007)(86362001)(66556008)(54906003)(41300700001)(36756003)(316002)(6666004)(6506007)(266003)(37730700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: A0r2WbnPsslOehp9jNThfrdlUbfIH+oXVxFBKguVYfP5H3O9MsFenVLHG3EEqdwDrI1pONWYIJvQyXFwRt33qZH3tgmhJiy+sXeXTYfOLbmiQIGicFFVyebAzWnDuKxniqIwT/Q3TgR/ZBsyPUixWPCd05N74fOEPklWzt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QWqtUiHxdl6FPa7/ZlnEwNLT9Eyut6kHhm7N2c81s7dDs3lKFylMzHeXksY13vjCapw8C/WhwfqBClBNqKf+/FIDXvBAvD4/vJcBNJ9gy652Ym6WDfMdKdMYGWzAvwP+Cwagnu6SG1Kzb6wmq+QZtEUrDM90IaLkMyTKalSZltPJAX4DqYHcfuqX8Ez1fZgGeczRl4AYvlekb9mDrNiB6XIXc5c9XIenmIFQljJFWnRjfJLaF3jWyXXoPjl0sggeLss87wcmtozswYvjqsCvh0ThD7AgAL8uYe1deM4ZEMgadVQlLBAWOas2vWd9Zt+l+gZag+V/ECm8wp5AwRvc6NeSQG4InIHbS3MnjrCD37ZWn6467w== X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-Network-Message-Id: 54189382-a968-4e20-6769-08dba7c24a6b X-MS-Exchange-CrossTenant-AuthSource: DBBP189MB1433.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2023 12:28:31.8233 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d2585e63-66b9-44b6-a76e-4f4b217d97fd X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mApcCxbGhFC4P+DwHemdRKtgxSQ4E65PZS8uUWWNLVZcWQvYye5bZVFFqlbOHmhyYO7cYfnM50sa2jvEXq23RM/rkybxUS8ODn35FV5C5/c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0P189MB0817 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Route hints when the nexthop is part of a multipath group causes packets in the same receive batch to be sent to the same nexthop irrespective of the multipath hash of the packet. So, do not extract route hint for packets whose destination is part of a multipath group. A new SKB flag IP6SKB_MULTIPATH is introduced for this purpose, set the flag when route is looked up in fib6_select_path() and use it in ip6_can_use_hint() to check for the existence of the flag. Fixes: 197dbf24e360 ("ipv6: introduce and uses route look hints for list input.") Signed-off-by: Sriram Yagnaraman Reviewed-by: Ido Schimmel Reviewed-by: David Ahern --- include/linux/ipv6.h | 1 + net/ipv6/ip6_input.c | 3 ++- net/ipv6/route.c | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 839247a4f48e..fe3492a67b35 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -146,6 +146,7 @@ struct inet6_skb_parm { #define IP6SKB_JUMBOGRAM 128 #define IP6SKB_SEG6 256 #define IP6SKB_FAKEJUMBO 512 +#define IP6SKB_MULTIPATH 1024 }; #if defined(CONFIG_NET_L3_MASTER_DEV) diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c index d94041bb4287..b8378814532c 100644 --- a/net/ipv6/ip6_input.c +++ b/net/ipv6/ip6_input.c @@ -99,7 +99,8 @@ static bool ip6_can_use_hint(const struct sk_buff *skb, static struct sk_buff *ip6_extract_route_hint(const struct net *net, struct sk_buff *skb) { - if (fib6_routes_require_src(net) || fib6_has_custom_rules(net)) + if (fib6_routes_require_src(net) || fib6_has_custom_rules(net) || + IP6CB(skb)->flags & IP6SKB_MULTIPATH) return NULL; return skb; diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 56a55585eb79..a02328c93a53 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -424,6 +424,9 @@ void fib6_select_path(const struct net *net, struct fib6_result *res, if (match->nh && have_oif_match && res->nh) return; + if (skb) + IP6CB(skb)->flags |= IP6SKB_MULTIPATH; + /* We might have already computed the hash for ICMPv6 errors. In such * case it will always be non-zero. Otherwise now is the time to do it. */