From patchwork Fri Oct 26 13:01:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li RongQing X-Patchwork-Id: 194468 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 05D322C009A for ; Sat, 27 Oct 2012 00:02:11 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753368Ab2JZNCI (ORCPT ); Fri, 26 Oct 2012 09:02:08 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:35932 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751280Ab2JZNCG (ORCPT ); Fri, 26 Oct 2012 09:02:06 -0400 Received: by mail-pa0-f46.google.com with SMTP id hz1so1916461pad.19 for ; Fri, 26 Oct 2012 06:02:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer; bh=8/n4L8gwRDf8EdYHKf3r7v9ZQb4c6UHEBCXj1JHdOC4=; b=qkUqcn5/LJtnNWFFObGpWYek6oEhl1VvQiqxzUHyXxX3zBNsJQD08pyjPff/f5rHaI O148kdgcHNyQWyDvozK9MDhyC2Q6W88QawcszNLDhmEM1mSusy1gpo+js03mdSfql+GS qnzLQm9Bq6rp9XqOKe7ZP2xdlj7rAOeoaLt2Cu9+PajB5Fo+sgPzqNjV2Dyowphxwpth 0zngumJ6uTuEgMEUqBzP7qtl0Rxt6EAGz+fBfoazUAz3YNpqvtafckog6W3gIvOe8Wum h826nO53jtTOyAMG26Y4A+FdmbeOGgjfXvdj0kGpv0S3wFdAZeN9+aBQXbut7b1K2wE5 s5cg== Received: by 10.68.232.163 with SMTP id tp3mr69730635pbc.44.1351256525679; Fri, 26 Oct 2012 06:02:05 -0700 (PDT) Received: from localhost ([61.148.56.138]) by mx.google.com with ESMTPS id k4sm991987pax.7.2012.10.26.06.02.01 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 26 Oct 2012 06:02:05 -0700 (PDT) From: roy.qing.li@gmail.com To: netdev@vger.kernel.org Subject: [RFC PATCH net-next] ipv6: remove rt6i_peer_genid from rt6_info and its handler Date: Fri, 26 Oct 2012 21:01:59 +0800 Message-Id: <1351256519-7704-1-git-send-email-roy.qing.li@gmail.com> X-Mailer: git-send-email 1.7.4.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Li RongQing 6431cbc25f(Create a mechanism for upward inetpeer propagation into routes) introduces these codes, but this mechanism is never enabled since rt6i_peer_genid always is zero whether it is not assigned or assigned by rt6_peer_genid(). After 5943634fc5 (ipv4: Maintain redirect and PMTU info in struct rtable again), the ipv4 related codes of this mechanism have been removed, I think we maybe able to remove them now. Signed-off-by: Li RongQing --- include/net/ip6_fib.h | 1 - net/ipv6/route.c | 16 ++-------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 20210d7..26210cf 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h @@ -117,7 +117,6 @@ struct rt6_info { struct rt6key rt6i_src; struct rt6key rt6i_prefsrc; u32 rt6i_metric; - u32 rt6i_peer_genid; struct inet6_dev *rt6i_idev; unsigned long _rt6i_peer; diff --git a/net/ipv6/route.c b/net/ipv6/route.c index c42650c..6ceee24 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -321,13 +321,6 @@ static void ip6_dst_destroy(struct dst_entry *dst) } } -static atomic_t __rt6_peer_genid = ATOMIC_INIT(0); - -static u32 rt6_peer_genid(void) -{ - return atomic_read(&__rt6_peer_genid); -} - void rt6_bind_peer(struct rt6_info *rt, int create) { struct inet_peer_base *base; @@ -341,8 +334,6 @@ void rt6_bind_peer(struct rt6_info *rt, int create) if (peer) { if (!rt6_set_peer(rt, peer)) inet_putpeer(peer); - else - rt->rt6i_peer_genid = rt6_peer_genid(); } } @@ -1100,11 +1091,8 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie) return NULL; if (rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie)) { - if (rt->rt6i_peer_genid != rt6_peer_genid()) { - if (!rt6_has_peer(rt)) - rt6_bind_peer(rt, 0); - rt->rt6i_peer_genid = rt6_peer_genid(); - } + if (!rt6_has_peer(rt)) + rt6_bind_peer(rt, 0); return dst; } return NULL;