From mboxrd@z Thu Jan 1 00:00:00 1970 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 EC28DC4332F for ; Tue, 20 Dec 2022 12:36:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233431AbiLTMgN (ORCPT ); Tue, 20 Dec 2022 07:36:13 -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-Google-Smtp-Source: AA0mqf7i5nIaolVKaHr0wu9mLwWaBDKfWp+bmCIrSLSxQzdn4BnSmRjgi8rNZW6TJIL6+9Qy9/Zbsw== 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 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