From patchwork Fri Jun 21 00:36:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Wang X-Patchwork-Id: 1119895 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AKVAXKUz"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45VKWl29hMz9s4V for ; Fri, 21 Jun 2019 10:37:07 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726200AbfFUAhF (ORCPT ); Thu, 20 Jun 2019 20:37:05 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:40631 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726155AbfFUAhE (ORCPT ); Thu, 20 Jun 2019 20:37:04 -0400 Received: by mail-pg1-f195.google.com with SMTP id w10so2444006pgj.7 for ; Thu, 20 Jun 2019 17:37:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZBRiDHj2Qi4Q8hZbrg7ij7OVMKRMOh5DuaaYEMelFvk=; b=AKVAXKUz6aU7iCHDWbaTt8ZiAvLAp81zE1Sjmob5+mTbxfsd8NoE+iQSaFeT3tuhdv 6MY02xLnxrcVitHQRD/8tIpJ7SOKbNWB+HqP2wbSwKghBeocLicZxaBhTpwMX0CUaqb5 SvcT5xXQtGA6314RRnNNtl+GUx8WB2o8ZHKBXehrbCrcDwvgYW5YJ2+1liZvk9SH2WxA rb6Fd4Ovl9UzfBUz/UyiT/Rf3Zw9Hg7fhp0VLfDfVUr1+CknAUd/v+j6NkChC68A7yWk kOQKZtO902W1WUQobLmkuUG5d7XVRD3At7TJzDHMdCXz+SCgz2LrU+eFZQOJONHmfex5 0UHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZBRiDHj2Qi4Q8hZbrg7ij7OVMKRMOh5DuaaYEMelFvk=; b=sqjxEhRqtuemQUAguPqRL4fktqJB2XGJviSKZkj1mcOgzBmemM1y6X4XwwGHp0WjuV ySA/Lo14CxxUciG2bEARQg2DAYspqSTJTv3A7MrRhkMxfEx85oIe+HGGOFk9G3DwNuhn Jen6xlvN1diSaObOKUkHnhWbNJKZYUOPDiCd+urbJXgD+LmOItxAPbnez/WlHT6yzJkT nOyS+HpYXGs+TyNu/nKoPr141/+j0SKLb5x1djfJqRcLZF4hbLp2BPQUOank1M73mJYp 74kFgghp5E1ViYXwn2LlhYLi+NaxTUFEOyb+tNIVAwGiPJZETsOS0gBmepi34KM8rRkk ZGPg== X-Gm-Message-State: APjAAAVcTx/nYCrUqhcQIkNa428o6sUQmV15SZBGVjarxxDD+gDJRAns UuGExsfNOVaQgNamVyFakhA= X-Google-Smtp-Source: APXvYqznW8jiRtmj7t29rpZ/rXAwqfIlfLRG4Fg46+azTfuvwz8oihkA9LpT5ictH/PXziCZ+o5uMQ== X-Received: by 2002:a63:474a:: with SMTP id w10mr14748858pgk.352.1561077423575; Thu, 20 Jun 2019 17:37:03 -0700 (PDT) Received: from weiwan0.svl.corp.google.com ([2620:15c:2c4:201:9310:64cb:677b:dcba]) by smtp.gmail.com with ESMTPSA id 2sm588206pff.174.2019.06.20.17.37.02 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 17:37:02 -0700 (PDT) From: Wei Wang To: David Miller , netdev@vger.kernel.org Cc: Eric Dumazet , Martin KaFai Lau , David Ahern , Mahesh Bandewar , Wei Wang Subject: [PATCH v3 net-next 2/5] ipv6: initialize rt6->rt6i_uncached in all pre-allocated dst entries Date: Thu, 20 Jun 2019 17:36:38 -0700 Message-Id: <20190621003641.168591-3-tracywwnj@gmail.com> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog In-Reply-To: <20190621003641.168591-1-tracywwnj@gmail.com> References: <20190621003641.168591-1-tracywwnj@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Wei Wang Initialize rt6->rt6i_uncached on the following pre-allocated dsts: net->ipv6.ip6_null_entry net->ipv6.ip6_prohibit_entry net->ipv6.ip6_blk_hole_entry This is a preparation patch for later commits to be able to distinguish dst entries in uncached list by doing: !list_empty(rt6->rt6i_uncached) Signed-off-by: Wei Wang Acked-by: Eric Dumazet Acked-by: Mahesh Bandewar --- net/ipv6/route.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 9dcbc56e4151..33dc8af9a4bf 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -6010,6 +6010,7 @@ static int __net_init ip6_route_net_init(struct net *net) net->ipv6.ip6_null_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_null_entry->dst, ip6_template_metrics, true); + INIT_LIST_HEAD(&net->ipv6.ip6_null_entry->rt6i_uncached); #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.fib6_has_custom_rules = false; @@ -6021,6 +6022,7 @@ static int __net_init ip6_route_net_init(struct net *net) net->ipv6.ip6_prohibit_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_prohibit_entry->dst, ip6_template_metrics, true); + INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->rt6i_uncached); net->ipv6.ip6_blk_hole_entry = kmemdup(&ip6_blk_hole_entry_template, sizeof(*net->ipv6.ip6_blk_hole_entry), @@ -6030,6 +6032,7 @@ static int __net_init ip6_route_net_init(struct net *net) net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); + INIT_LIST_HEAD(&net->ipv6.ip6_blk_hole_entry->rt6i_uncached); #endif net->ipv6.sysctl.flush_delay = 0;