From patchwork Sat Mar 9 21:16:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Anastasov X-Patchwork-Id: 226382 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 A59622C0298 for ; Sun, 10 Mar 2013 08:16:23 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752026Ab3CIVQK (ORCPT ); Sat, 9 Mar 2013 16:16:10 -0500 Received: from ja.ssi.bg ([178.16.129.10]:46862 "EHLO ja.ssi.bg" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751728Ab3CIVP6 (ORCPT ); Sat, 9 Mar 2013 16:15:58 -0500 Received: from ja.ssi.bg (localhost.localdomain [127.0.0.1]) by ja.ssi.bg (8.14.4/8.14.4) with ESMTP id r29LH7Of005937; Sat, 9 Mar 2013 23:17:08 +0200 Received: (from root@localhost) by ja.ssi.bg (8.14.4/8.14.4/Submit) id r29LH7em005936; Sat, 9 Mar 2013 23:17:07 +0200 From: Julian Anastasov To: Simon Horman Cc: lvs-devel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCHv2 net-next 03/15] ipvs: prefer NETDEV_DOWN event to free cached dsts Date: Sat, 9 Mar 2013 23:16:43 +0200 Message-Id: <1362863815-5898-4-git-send-email-ja@ssi.bg> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1362863815-5898-1-git-send-email-ja@ssi.bg> References: <1362863815-5898-1-git-send-email-ja@ssi.bg> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The real server becomes unreachable on down event, no need to wait device unregistration. Should help in releasing dsts early before dst->dev is replaced with lo. Signed-off-by: Julian Anastasov Signed-off by: Hans Schillstrom --- net/netfilter/ipvs/ip_vs_ctl.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index c68198b..76fc8f2 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c @@ -1512,10 +1512,8 @@ __ip_vs_dev_reset(struct ip_vs_dest *dest, struct net_device *dev) spin_unlock_bh(&dest->dst_lock); } -/* - * Netdev event receiver - * Currently only NETDEV_UNREGISTER is handled, i.e. if we hold a reference to - * a device that is "unregister" it must be released. +/* Netdev event receiver + * Currently only NETDEV_DOWN is handled to release refs to cached dsts */ static int ip_vs_dst_event(struct notifier_block *this, unsigned long event, void *ptr) @@ -1527,7 +1525,7 @@ static int ip_vs_dst_event(struct notifier_block *this, unsigned long event, struct ip_vs_dest *dest; unsigned int idx; - if (event != NETDEV_UNREGISTER || !ipvs) + if (event != NETDEV_DOWN || !ipvs) return NOTIFY_DONE; IP_VS_DBG(3, "%s() dev=%s\n", __func__, dev->name); EnterFunction(2);