From patchwork Thu Aug 31 08:03:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram Yagnaraman X-Patchwork-Id: 13371064 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF8537481 for ; Thu, 31 Aug 2023 08:03:57 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2133.outbound.protection.outlook.com [40.107.22.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB69BE42; Thu, 31 Aug 2023 01:03:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nGdhP7Wpv5oa9f+mfgkr4k8cCmopjyIiy8Hk0EMzivo15eM/IYkyYinH7Luqs/Z+GiTcapGgqndSW3rGNQIAL9/mEHnPMwssFhd0aK4+CIRbo3PK0N5sk/4fSfVEwGEFc+vC3ionp+67aUFeTNSgfay1TrN1yRQBPhQuIqtb3ZTlc1JRSTn60YhjwUGBi2sknPAgLUkRWYGxMaOvl79Uk6DsO+rRvZPtCeD/DyyQLQVi4f8SGI0khTsCxb0dL3Rh1/dhqI1lYOvT4rG5uDnVTGX3ab1TOl/8PGT6FS5lAzrQPS/lQ9X1iRHpF2Pq+UpmVmIb10Za/Tpq130zcChwuQ== 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=3fL4EOwO86H1EP4PmvHyNW6IT3Che41u35CFBg7cURI=; b=m9izACG+834J2iGkgtDJ7Xspl5Z2CNuLLTN4rJ9eIoIveuKSMF4SCygfYr1IDs3AuHwy+tJT19IOVK/djq40+MADPVssFxtfFKjnWx8F4GS8qJIDgWJJLw83iXpvRbCg7WNc+WlekaYEVIOhupexNkxGcHc3CseKyImuK5U5v523gnCEVTFvfnLiL5CY7zBrXb9x9iYUYLgoGe5Ish25dWbKECAxJPFww1fUPdAIjvYKeEf0lBhhXz9if4mkg0oEKm+upwSjX2KfjcsSC/b2a5z2bRRJDYMCG0b22g1bv6gvzosg/ADTGIh2AjNW7id6x3Va5Y2/Wrr+hpCypPCvtg== 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=3fL4EOwO86H1EP4PmvHyNW6IT3Che41u35CFBg7cURI=; b=QMErEGSJsk7t+b8RuT4KPK+trXD9drA4nb+MwtamV7itxslnyaL3H4hxWED46QZWuP8yA0xA030BrwrtkPL3Y5AqGLums9w2ORxVf5Okmur7UPELUdbEjplLiziKH9nyseL8iilViy9qSYDRGDfy0qRgjSh+2UtXP3Fc297JyFs= 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 DB9P189MB1929.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:33a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.20; Thu, 31 Aug 2023 08:03:41 +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.6745.021; Thu, 31 Aug 2023 08:03:41 +0000 From: Sriram Yagnaraman To: 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 v5 2/3] ipv6: ignore dst hint for multipath routes Date: Thu, 31 Aug 2023 10:03:31 +0200 Message-Id: <20230831080332.2495-3-sriram.yagnaraman@est.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230831080332.2495-1-sriram.yagnaraman@est.tech> References: <20230831080332.2495-1-sriram.yagnaraman@est.tech> X-ClientProxiedBy: GVYP280CA0024.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:fa::12) To DBBP189MB1433.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:1e7::15) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBP189MB1433:EE_|DB9P189MB1929:EE_ X-MS-Office365-Filtering-Correlation-Id: 8e85f0c4-fdac-4a4e-5a2f-08dba9f8c9fc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dAsNHq9wOpZjJbhNjBUB4RvQazRtNkpD7mU6XWdVJTadtbYfPIJE3n+EUdBWdtdo4BcOiJb3/8NtJP1tc9fKPYBJwS+r6diMcGcSzj2KJgV2d4fU9LBUAf0+JhyGPCN3y60eU7FqYMzeBZ9TBWnOHNvNrstTM0weWOrUI1IM3Fe6y06YESevUMbXjKWdiH+TZwIxWKAdnVoH1sdG0R1aZ0DKrFhBkNNqoc3zZImwSpXP1FTvs8usFbYC4ZbP7/r/iiLJ0o3yTkRdIT/4B7yJeAQ/Rtjcg4yNOD0Uc9Jgxjv0pKKdaaUoREPOkmtu4oiPdYKyGJ/igg0jzbIxIrxGcHbFWS+nJfamvxIwdHWSHIG+VmOuq5KfpzJW5OwKdTcWuUNj9o9rzZYkVuDjGoKYU+TbsXR0YgZP4U8r39GjsEvzUEgfO0yjA1sCKLRabXXLUiEgSvAECqZ5CSiYum4N0lRmme5C3qgB/8/ehvhtI5FOU5J0XD9YqkcqUw4c7AsJfKZq010ccMmp0vkNVhP1x53aKpvOW8Fh04pUrWrWC2VB23dIk2fTqJWLufUtSJRnu3z/OCUd9hc3HEYtwnKhIlKS3Y8qR5VW0/XcDs26id7/5CuolqnEa20PDC4+xIT7fH8UU4ylcuif1RlKShYOow== 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)(136003)(39840400004)(376002)(396003)(109986022)(1800799009)(451199024)(186009)(36756003)(7416002)(83380400001)(8676002)(86362001)(44832011)(41300700001)(8936002)(4326008)(5660300002)(6666004)(1076003)(26005)(2616005)(6486002)(6506007)(6512007)(478600001)(2906002)(38100700002)(54906003)(66556008)(66476007)(70586007)(66946007)(316002)(266003)(37730700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MA15rMU2iRixoq8gjSxkNsr0UBqLpf6i4uJT+Zd8htXwOJ14c/BAmceqXTYKWRU9guNsVG510cBZTbhWE+zGxzbUfAaYlQb7Rro1UEOgNtAPrmqE4roRQJPDd4bv9IcG7eCGvFKhtmHkm7tvX6Hg0ivYlzFfAkTl/+9gDZdy8EIebjbY8cqEOur0Znn/QSzRmgV3N1MzT7j+reX1h2dY8OTPEPQr/d6bxbf2bM5ch2sdGUAmc3EAsB8j8QHFMSdxALQM1BYWL04oIT1ilQswZAUqjEX2LXJ3PpLd0CmEU3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q7Yg2vxpX/prCMm49826dp0p+Nrq2APiWlkdHDlZro610Wdz2Slkb++IVySzupPRLu1zJrrdfky0o5rn4rPL8YO1vvq/mtAlj1rpslulo2W8SCYfiNG+V7DNnLnPE3yXTw8shy1oxef8/+I7VW1x9ngd3HhvYw4UnUgFBGtLJ0vH5xyn0KGc3BHDFerulANGmjhOPLXrG0MEz7WUG2Fdi9ECIV9uh62WDMSdMSinnYNcJvHYoqSQ530g== X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-Network-Message-Id: 8e85f0c4-fdac-4a4e-5a2f-08dba9f8c9fc X-MS-Exchange-CrossTenant-AuthSource: DBBP189MB1433.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2023 08:03:41.0484 (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: biCXmuUdRc9tVoQYThAiDigDny64MdY6zLJFy5lQDP6C4xsMEcDWi5EvoNalO8eMTmlYdogv+mLUG5KoLGYt7Ju5Qrblbyt2p1MtvuKgQcI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9P189MB1929 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@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 5883551b1ee8..af8a771a053c 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -147,6 +147,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 846aec8e0093..01d6d352850a 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -423,6 +423,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. */