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 1969FC6FD18 for ; Wed, 19 Apr 2023 08:59:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232788AbjDSI7Q (ORCPT ); Wed, 19 Apr 2023 04:59:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232787AbjDSI7L (ORCPT ); Wed, 19 Apr 2023 04:59:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CCEC1026E for ; Wed, 19 Apr 2023 01:59:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A718A630AF for ; Wed, 19 Apr 2023 08:59:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90718C4339B; Wed, 19 Apr 2023 08:59:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681894749; bh=bPUspiHGV/cQHYqjuDQgmKqH62SgWxZuQwh73JM2jjk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ntrcwJwe36MwGpjRUBHS824gYAEuQTlevH6WIBGMs6AIikoaH42bfMZvm1w+AwEfg JNGSNTSt5HVxWunytraXUte7XSaP9qSaY7a7V14M92+gtpSsZJxZaJu04HS66n/Eij ep2LxyABXlx/wNKaEusTNb3z25fV2ojZn/+WUAToLAJAHF28TRI8fGZWkTWhgtJKMc mFqHK5RSCQbxg4hASHoqPFDM46I5mAxv7+Zs9szsx7DyfNk0/adxWyDWnaduznxsBJ QY7hWUoa5hszSrCPCBJPLBM9t0PJYAewkWLSKaKQCAzJJpORWzjm67YujUB9AShnn9 laFdug2h+lQXA== Date: Wed, 19 Apr 2023 11:59:05 +0300 From: Leon Romanovsky To: Eric Dumazet Cc: David Ahern , kernel test robot , Wangyang Guo , Jakub Kicinski , oe-lkp@lists.linux.dev, lkp@intel.com, Linux Memory Management List , Arjan van de Ven , Thomas Gleixner , netdev@vger.kernel.org, steffen.klassert@secunet.com Subject: Re: [linux-next:master] [net] d288a162dd: canonical_address#:#[##] Message-ID: <20230419085905.GE44666@unreal> References: <202304162125.18b7bcdd-oliver.sang@intel.com> <20230418164133.GA44666@unreal> <509b08bd-d2bf-eaa8-6c49-c0860d1adbe0@kernel.org> <20230419055916.GB44666@unreal> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Apr 19, 2023 at 10:41:00AM +0200, Eric Dumazet wrote: > On Wed, Apr 19, 2023 at 7:59 AM Leon Romanovsky wrote: > > > > On Tue, Apr 18, 2023 at 02:43:02PM -0600, David Ahern wrote: > > > On 4/18/23 10:41 AM, Leon Romanovsky wrote: > > > > Hi, > > > > > > > > I came to the following diff which eliminates the kernel panics, > > > > unfortunately I can explain only second hunk, but first is required > > > > too. > > > > > > > > diff --git a/net/core/dst.c b/net/core/dst.c > > > > index 3247e84045ca..750c8edfe29a 100644 > > > > --- a/net/core/dst.c > > > > +++ b/net/core/dst.c > > > > @@ -72,6 +72,8 @@ void dst_init(struct dst_entry *dst, struct dst_ops *ops, > > > > dst->flags = flags; > > > > if (!(flags & DST_NOCOUNT)) > > > > dst_entries_add(ops, 1); > > > > + > > > > + INIT_LIST_HEAD(&dst->rt_uncached); > > > > > > d288a162dd1c73507da582966f17dd226e34a0c0 moved rt_uncached from rt6_info > > > and rtable to dst_entry. Only ipv4 and ipv6 usages initialize it. Since > > > it is now in dst_entry, dst_init is the better place so it can be > > > removed from rt_dst_alloc and rt6_info_init. > > > > This is why I placed it there, but the rt_uncached list is initialized > > in xfrm6 right before first call to rt6_uncached_list_add(). > > > > 70 static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev, > > 71 const struct flowi *fl) > > 72 { > > ... > > 92 INIT_LIST_HEAD(&xdst->u.rt6.dst.rt_uncached); > > 93 rt6_uncached_list_add(&xdst->u.rt6); > > > > My silly explanation is that xfrm6_dst_destroy() can be called before xfrm6_fill_dst(). > > > > Thanks > > > > > > > Please take a look at the fix that was sent yesterday : > > https://patchwork.kernel.org/project/netdevbpf/patch/20230418165426.1869051-1-mbizon@freebox.fr/ Thanks, I replied there with my comments. > > Thanks.