public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Duyck <alexander.h.duyck@redhat.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net
Subject: [net-next PATCH v2 01/10] fib_trie: Minor cleanups to fib_table_flush_external
Date: Fri, 06 Mar 2015 09:53:56 -0800	[thread overview]
Message-ID: <20150306175356.2452.11301.stgit@ahduyck-vm-fedora20> (raw)
In-Reply-To: <20150306174814.2452.18308.stgit@ahduyck-vm-fedora20>

This change just does a couple of minor cleanups on
fib_table_flush_external.  Specifically it addresses the fact that resize
was being called even though nothing was being removed from the table, and
it drops an unecessary indent since we could just call continue on the
inverse of the fi && flag check.

Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
---
 net/ipv4/fib_trie.c |   20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 0131f36..488cebc 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1586,13 +1586,8 @@ backtrace:
 			while (!(cindex--)) {
 				t_key pkey = pn->key;
 
-				n = pn;
-				pn = node_parent(n);
-
-				/* resize completed node */
-				resize(t, n);
-
 				/* if we got the root we are done */
+				pn = node_parent(pn);
 				if (!pn)
 					return;
 
@@ -1607,12 +1602,13 @@ backtrace:
 	hlist_for_each_entry(fa, &n->leaf, fa_list) {
 		struct fib_info *fi = fa->fa_info;
 
-		if (fi && (fi->fib_flags & RTNH_F_EXTERNAL)) {
-			netdev_switch_fib_ipv4_del(n->key,
-						   KEYLENGTH - fa->fa_slen,
-						   fi, fa->fa_tos,
-						   fa->fa_type, tb->tb_id);
-		}
+		if (!fi || !(fi->fib_flags & RTNH_F_EXTERNAL))
+			continue;
+
+		netdev_switch_fib_ipv4_del(n->key,
+					   KEYLENGTH - fa->fa_slen,
+					   fi, fa->fa_tos,
+					   fa->fa_type, tb->tb_id);
 	}
 
 	/* if trie is leaf only loop is completed */

  reply	other threads:[~2015-03-06 17:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-06 17:53 [net-next PATCH v2 00/10] The rest of the FIB patches (add key_vector to fib_table) Alexander Duyck
2015-03-06 17:53 ` Alexander Duyck [this message]
2015-03-06 17:54 ` [net-next PATCH v2 02/10] fib_trie: Return pointer to tnode pointer in resize/inflate/halve Alexander Duyck
2015-03-06 17:54 ` [net-next PATCH v2 03/10] fib_trie: Rename tnode to key_vector Alexander Duyck
2015-03-06 17:54 ` [net-next PATCH v2 04/10] fib_trie: replace tnode_get_child functions with get_child macros Alexander Duyck
2015-03-06 17:54 ` [net-next PATCH v2 05/10] fib_trie: Rename tnode_child_length to child_length Alexander Duyck
2015-03-06 17:54 ` [net-next PATCH v2 06/10] fib_trie: Add tnode struct as a container for fields not needed in key_vector Alexander Duyck
2015-03-06 17:54 ` [net-next PATCH v2 07/10] fib_trie: Move rcu from key_vector to tnode, add accessors Alexander Duyck
2015-03-06 17:54 ` [net-next PATCH v2 08/10] fib_trie: Pull empty_children and full_children into tnode Alexander Duyck
2015-03-06 17:54 ` [net-next PATCH v2 09/10] fib_trie: Move parent from key_vector to tnode Alexander Duyck
2015-03-06 17:54 ` [net-next PATCH v2 10/10] fib_trie: Add key vector to root, return parent key_vector in resize Alexander Duyck
2015-03-06 20:52 ` [net-next PATCH v2 00/10] The rest of the FIB patches (add key_vector to fib_table) David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150306175356.2452.11301.stgit@ahduyck-vm-fedora20 \
    --to=alexander.h.duyck@redhat.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox