From patchwork Fri Mar 6 17:53:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Duyck X-Patchwork-Id: 447381 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 07868140082 for ; Sat, 7 Mar 2015 04:54:03 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754256AbbCFRx7 (ORCPT ); Fri, 6 Mar 2015 12:53:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33956 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752905AbbCFRx6 (ORCPT ); Fri, 6 Mar 2015 12:53:58 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t26HrvYR023868 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 6 Mar 2015 12:53:57 -0500 Received: from [192.168.122.173] (ovpn-112-24.phx2.redhat.com [10.3.112.24]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t26HruL4006323; Fri, 6 Mar 2015 12:53:56 -0500 Subject: [net-next PATCH v2 01/10] fib_trie: Minor cleanups to fib_table_flush_external From: Alexander Duyck To: netdev@vger.kernel.org Cc: davem@davemloft.net Date: Fri, 06 Mar 2015 09:53:56 -0800 Message-ID: <20150306175356.2452.11301.stgit@ahduyck-vm-fedora20> In-Reply-To: <20150306174814.2452.18308.stgit@ahduyck-vm-fedora20> References: <20150306174814.2452.18308.stgit@ahduyck-vm-fedora20> User-Agent: StGit/0.17-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- net/ipv4/fib_trie.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 */