From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Horman Subject: [PATCH 01/24] ipvs: avoid lookup for fwmark 0 Date: Tue, 15 Mar 2011 14:27:09 +0900 Message-ID: <1300166852-725-2-git-send-email-horms@verge.net.au> References: <1300166852-725-1-git-send-email-horms@verge.net.au> Cc: Eric Dumazet , Julian Anastasov , Hans Schillstrom , Patrick McHardy , Simon Horman To: netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, netfilter@vger.kernel.org, lvs-devel@vger.kernel.org Return-path: Received: from kirsty.vergenet.net ([202.4.237.240]:52581 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753450Ab1COF1n (ORCPT ); Tue, 15 Mar 2011 01:27:43 -0400 In-Reply-To: <1300166852-725-1-git-send-email-horms@verge.net.au> Sender: netfilter-devel-owner@vger.kernel.org List-ID: From: Julian Anastasov Restore the previous behaviour to lookup for fwmark service only when fwmark is non-null. This saves only CPU. Signed-off-by: Julian Anastasov Signed-off-by: Hans Schillstrom Signed-off-by: Simon Horman --- net/netfilter/ipvs/ip_vs_ctl.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index c73b0c8..f0369d6 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c @@ -411,9 +411,11 @@ ip_vs_service_get(struct net *net, int af, __u32 fwmark, __u16 protocol, /* * Check the table hashed by fwmark first */ - svc = __ip_vs_svc_fwm_find(net, af, fwmark); - if (fwmark && svc) - goto out; + if (fwmark) { + svc = __ip_vs_svc_fwm_find(net, af, fwmark); + if (svc) + goto out; + } /* * Check the table hashed by -- 1.7.2.3