Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp3991764rwj; Tue, 20 Dec 2022 04:52:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXvhrKA+hsec69jXxf8NvO5uJJxs2+OxQM1ItzNZgeqMO8cnLGj47Mbhz5xOW8mvrGN4fpYu X-Received: by 2002:a05:6402:4b:b0:479:dc9c:1144 with SMTP id f11-20020a056402004b00b00479dc9c1144mr7499897edu.24.1671540745620; Tue, 20 Dec 2022 04:52:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671540745; cv=none; d=google.com; s=arc-20160816; b=D0mnwFzktIY/91samYMHD1RALNSsqwVFfYD1bti0+9MFxxPuFozY9gwB80aInY/SwR cmlCTxhsK9+iOveHQelGTnJ8WdxJqOnndETEizxQiTMda5MEfe89Caa1HPlJyHvvGHbG deE7AKg/leDai1SATeE3AhV4e/B2p/W1gI9y4ifG3Z0jXXdN/FABvDFDT1ZF9p1lOmOG rskTX6kFYKRNEqGwzmHivi1gUKngxa0vtkyG3ZStjsNCeTkvXyl0PxYjcSFiPUfLPClS CrerCW4Zin3sPx7FTc0pRxJ3EGO/oixUAITQ/AecJTZK7tPlop195itws0NlrwiJFr6i q5lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=NXeVxc3rVhMfVXUF0r47fjYxAxtcLJDnYTEiZwRT4dc=; b=R1Z8KbyJiPxvNwSLxFstDFBNZqlcAs+ZoxEw0XszFQjRHEI6fCEhIos0AJY1VjbwbG /EuSiXoMR2z4/SpvVpM62LjXU7hw+zPLAkEzOWTJ3rPgAa99uTNOb4n+TQ/qb7Bo3S9q XpxhCTNdpB/cDTJyTJRspIVP6dpcMxaSEu99RM4uPWa473MvWzaf7mublB/Tpy/5Ej1t ogExTwgDGyRsBT4kN4AIPqChUBpLMRqIFZdmjehlMzGBx6VSThj5QWTeA/z31r3tmi52 XT6Szb8Nxsi/PFoN7t4HOl/k833T9B1pc4Ds8MLAFG3L32qBV2R2N3NzgfV6hFzfWRFi ef+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JZap14iq; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v2-20020aa7d642000000b004754696ec2asi976079edr.348.2022.12.20.04.52.08; Tue, 20 Dec 2022 04:52:25 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=JZap14iq; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233319AbiLTMgM (ORCPT + 70 others); Tue, 20 Dec 2022 07:36:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbiLTMgK (ORCPT ); Tue, 20 Dec 2022 07:36:10 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC6AF64F5 for ; Tue, 20 Dec 2022 04:35:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671539727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NXeVxc3rVhMfVXUF0r47fjYxAxtcLJDnYTEiZwRT4dc=; b=JZap14iqNpSzzPAYGgkyr3tbM4SqjnfzLI5uiUiAV0EezVf17sXcwrPUlM1OOqLo9P00zZ bp8EEgXp+TOXnwwoJH/0+ZsS2ZCPvzYjhFL55g2p+yfXeNqzfjg2Ylnv0pylbcm3hyVMxa ndQakBnZ8J3tZEu0uXEBeHA6gd+qw5Y= Received: from mail-yw1-f197.google.com (mail-yw1-f197.google.com [209.85.128.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-516-6a3NbHkFOtGTVQ-8lMTJUw-1; Tue, 20 Dec 2022 07:35:25 -0500 X-MC-Unique: 6a3NbHkFOtGTVQ-8lMTJUw-1 Received: by mail-yw1-f197.google.com with SMTP id 00721157ae682-45c1b233dd7so4285097b3.20 for ; Tue, 20 Dec 2022 04:35:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=NXeVxc3rVhMfVXUF0r47fjYxAxtcLJDnYTEiZwRT4dc=; b=CbmYBlt9CIjEdYmdvHqi+dd5Z/t7EE4JRWuc04ntDH8l1UBl5cDVuaAjI4SBtIsjLO xnS3wjyIPj/Rqbz5Aco68DH1qrAwWo8m1DhVNSflLTM/rTx1oTjN8BhUQU8pwunpFB77 Mx7OmU3vUDMbmG+vMGrvU5bs1Rw95qJCvf8GS77XaOsdzBKdymyX6LYWXUGPKFWEA41E LvVLH/X0IaNhKr6Be6EUFG4S5m6Q5Dv2jgUV0GpeK06hteA3FvR/Y4daVfS4V+K7CFTW W3FBiFGmmgXXABBQjCBUcDTf1dJXJZiW5gGBV/vla5TlHWWfewoJNgF22NCZpwVWHS7I 1c1g== X-Gm-Message-State: ANoB5pkY2+V5U7duqiiamq2fSbZflrjac4E9zz8HCiNP2Zw/qweF2o+2 wLjffOsCw3tLCQpCfGaZHOCDlz8gh8BCBQonBr+nUhB57kcouWgSxShzRgkxz97G5pTXOBxQDYJ JLaEX7+OmEMB3dnTZGPFdVRug X-Received: by 2002:a05:690c:d8f:b0:3b1:4224:bbeb with SMTP id da15-20020a05690c0d8f00b003b14224bbebmr57324895ywb.39.1671539725343; Tue, 20 Dec 2022 04:35:25 -0800 (PST) X-Received: by 2002:a05:690c:d8f:b0:3b1:4224:bbeb with SMTP id da15-20020a05690c0d8f00b003b14224bbebmr57324869ywb.39.1671539725034; Tue, 20 Dec 2022 04:35:25 -0800 (PST) Received: from gerbillo.redhat.com (146-241-101-173.dyn.eolo.it. [146.241.101.173]) by smtp.gmail.com with ESMTPSA id l10-20020a37f90a000000b006fcab4da037sm8718367qkj.39.2022.12.20.04.35.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 04:35:24 -0800 (PST) Message-ID: <9f145202ca6a59b48d4430ed26a7ab0fe4c5dfaf.camel@redhat.com> Subject: Re: [net-next] ipv6: fix routing cache overflow for raw sockets From: Paolo Abeni To: Jon Maxwell , davem@davemloft.net Cc: edumazet@google.com, kuba@kernel.org, yoshfuji@linux-ipv6.org, dsahern@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 20 Dec 2022 13:35:21 +0100 In-Reply-To: <20221218234801.579114-1-jmaxwell37@gmail.com> References: <20221218234801.579114-1-jmaxwell37@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2022-12-19 at 10:48 +1100, Jon Maxwell wrote: > Sending Ipv6 packets in a loop via a raw socket triggers an issue where a > route is cloned by ip6_rt_cache_alloc() for each packet sent. This quickly > consumes the Ipv6 max_size threshold which defaults to 4096 resulting in > these warnings: > > [1] 99.187805] dst_alloc: 7728 callbacks suppressed > [2] Route cache is full: consider increasing sysctl net.ipv6.route.max_size. > . > . > [300] Route cache is full: consider increasing sysctl net.ipv6.route.max_size. If I read correctly, the maximum number of dst that the raw socket can use this way is limited by the number of packets it allows via the sndbuf limit, right? Are other FLOWI_FLAG_KNOWN_NH users affected, too? e.g. nf_dup_ipv6, ipvs, seg6? @DavidA: why do we need to create RTF_CACHE clones for KNOWN_NH flows? Thanks, Paolo