From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 770F8171C6 for ; Thu, 27 Jul 2023 15:24:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8DA8C433C7; Thu, 27 Jul 2023 15:24:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690471463; bh=x0oeQt5XG7CgnXWpG7MTxiW85iG8DcAAU/cdmq71YJQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=gizN+sYMt5OlHesp7dPp5/iFIdUM55zNQPlkmYjH0DH2L1GNZM4/grOLDg/QT5pwb WhWJNPxcfWy0VI9ZanvolSOp6fA6SAmOsQUhFoHoS1igmdJVzuQFOH8iPjTYzR11TF ANDdr5IUUVo9D85ATBk+hQS3xlOJfvQnViJy7Gu7r/vF6M282rROMKXrCIf3eHh6i3 //HjjPZ8lFuEEtWbNvHTOmtIOl80c5BTs0/EvyfDbJo7bqV+grdqMBy5VUEbLP861Y HEaB5I4XfxR1I3wAKwl9CAIahIcHQIxL+mHVPseojq2S5oOETjvFxCkG0sXCdULqPX KxbmMIeL67b/Q== Message-ID: Date: Thu, 27 Jul 2023 09:24:23 -0600 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [net-next v2] net: change accept_ra_min_rtr_lft to affect all RA lifetimes Content-Language: en-US To: Patrick Rohr , "David S . Miller" Cc: Linux Network Development Mailing List , =?UTF-8?Q?Maciej_=c5=bbenczykowski?= , Lorenzo Colitti References: <20230726230701.919212-1-prohr@google.com> From: David Ahern In-Reply-To: <20230726230701.919212-1-prohr@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 7/26/23 5:07 PM, Patrick Rohr wrote: > accept_ra_min_rtr_lft only considered the lifetime of the default route > and discarded entire RAs accordingly. > > This change renames accept_ra_min_rtr_lft to accept_ra_min_lft, and > applies the value to individual RA sections; in particular, router > lifetime, PIO preferred lifetime, and RIO lifetime. If any of those > lifetimes are lower than the configured value, the specific RA section > is ignored. > > In order for the sysctl to be useful to Android, it should really apply > to all lifetimes in the RA, since that is what determines the minimum > frequency at which RAs must be processed by the kernel. Android uses > hardware offloads to drop RAs for a fraction of the minimum of all > lifetimes present in the RA (some networks have very frequent RAs (5s) > with high lifetimes (2h)). Despite this, we have encountered networks > that set the router lifetime to 30s which results in very frequent CPU > wakeups. Instead of disabling IPv6 (and dropping IPv6 ethertype in the > WiFi firmware) entirely on such networks, it seems better to ignore the > misconfigured routers while still processing RAs from other IPv6 routers > on the same network (i.e. to support IoT applications). > > The previous implementation dropped the entire RA based on router > lifetime. This turned out to be hard to expand to the other lifetimes > present in the RA in a consistent manner; dropping the entire RA based > on RIO/PIO lifetimes would essentially require parsing the whole thing > twice. > > Fixes: 1671bcfd76fd ("net: add sysctl accept_ra_min_rtr_lft") > Cc: Maciej Żenczykowski > Cc: Lorenzo Colitti > Cc: David Ahern > Signed-off-by: Patrick Rohr > --- > Documentation/networking/ip-sysctl.rst | 8 ++++---- > include/linux/ipv6.h | 2 +- > include/uapi/linux/ipv6.h | 2 +- > net/ipv6/addrconf.c | 14 ++++++++----- > net/ipv6/ndisc.c | 27 +++++++++++--------------- > 5 files changed, 26 insertions(+), 27 deletions(-) > Reviewed-by: David Ahern