From patchwork Tue Oct 3 20:13:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishakha Narvekar X-Patchwork-Id: 821011 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=dell.com header.i=@dell.com header.b="EylGu5NR"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3y69GZ3yhCz9t5Y for ; Wed, 4 Oct 2017 07:13:58 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751770AbdJCUN4 (ORCPT ); Tue, 3 Oct 2017 16:13:56 -0400 Received: from esa2.dell-outbound.iphmx.com ([68.232.149.220]:32108 "EHLO esa2.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751756AbdJCUNy (ORCPT ); Tue, 3 Oct 2017 16:13:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1507061634; x=1538597634; h=from:to:cc:subject:date:message-id; bh=HYSXRb5+2Flo8W4mD3nl0PzVbw7GehP8pRf9r5tU4lk=; b=EylGu5NRBedPHyWkLeltMfPTviMmkDjUuHLvdYgnOg6jPgVZeEhJmc0G p9XDXtDXDSOS0aBK4eWmtQ7+PUeAGhqGjOtjwG5kDT/eeHNkmSqe3PQLl xYdf+4+mj24wNzz5mjPtRauGcFXexRBYjlOfagvGvg+eeIUB1SM33ebgR Q=; Received: from esa3.dell-outbound2.iphmx.com ([68.232.154.63]) by esa2.dell-outbound.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Oct 2017 15:13:54 -0500 Received: from mailuogwhop.emc.com ([168.159.213.141]) by esa3.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Oct 2017 02:06:18 +0600 Received: from maildlpprd02.lss.emc.com (maildlpprd02.lss.emc.com [10.253.24.34]) by mailuogwprd02.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id v93KDmYW017286 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 Oct 2017 16:13:51 -0400 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd02.lss.emc.com v93KDmYW017286 Received: from mailsyshubprd08.lss.emc.com (mailhub.lss.emc.com [10.253.24.64]) by maildlpprd02.lss.emc.com (RSA Interceptor); Tue, 3 Oct 2017 16:13:32 -0400 Received: from drmcyc-narvev-1.cec.lab.emc.com ([10.141.57.49]) by mailsyshubprd08.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id v93KDaSD012436; Tue, 3 Oct 2017 16:13:37 -0400 From: Vishakha Narvekar To: netdev@vger.kernel.org Cc: allen.hubbe@dell.com, andrew.boyer@dell.com, Vishakha Narvekar , "David S. Miller" Subject: [PATCH] net: 8021q: skip packets if the vlan is down Date: Tue, 3 Oct 2017 16:13:29 -0400 Message-Id: <1507061609-11972-1-git-send-email-Vishakha.Narvekar@dell.com> X-Mailer: git-send-email 1.8.3.1 X-RSA-Classifications: public X-Sentrion-Hostname: mailuogwprd02.lss.emc.com Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If the vlan is down, free the packet instead of proceeding with other processing, or counting it as received. If vlan interfaces are used as slaves for bonding, with arp monitoring for connectivity, if the rx counter is seen to be incrementing, then the bond device will not observe that the interface is down. CC: David S. Miller Signed-off-by: Vishakha Narvekar --- I don't know if this is the appropriate change, or if it is supposed to work as before. This change seemed to fix the behavior for bonding. net/8021q/vlan_core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c index e2ed698..0bc31de 100644 --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c @@ -21,6 +21,12 @@ bool vlan_do_receive(struct sk_buff **skbp) if (unlikely(!skb)) return false; + if (unlikely(!(vlan_dev->flags & IFF_UP))) { + kfree_skb(skb); + *skbp = NULL; + return false; + } + skb->dev = vlan_dev; if (unlikely(skb->pkt_type == PACKET_OTHERHOST)) { /* Our lower layer thinks this is not local, let's make sure.