[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1415265572-1785-1-git-send-email-pshelar@nicira.com>
Date: Thu, 6 Nov 2014 01:19:32 -0800
From: Pravin B Shelar <pshelar@...ira.com>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, Chunhe Li <lichunhe@...wei.com>,
Pravin B Shelar <pshelar@...ira.com>
Subject: [PATCH net-next v2 09/14] openvswitch: Drop packets when interdev is not up
From: Chunhe Li <lichunhe@...wei.com>
If the internal device is not up, it should drop received
packets. Sometimes it receive the broadcast or multicast
packets, and the ip protocol stack will casue more cpu
usage wasted.
Signed-off-by: Chunhe Li <lichunhe@...wei.com>
Signed-off-by: Pravin B Shelar <pshelar@...ira.com>
---
net/openvswitch/vport-internal_dev.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
index 10dc07e..6a55f71 100644
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
@@ -224,6 +224,11 @@ static int internal_dev_recv(struct vport *vport, struct sk_buff *skb)
struct net_device *netdev = netdev_vport_priv(vport)->dev;
int len;
+ if (unlikely(!(netdev->flags & IFF_UP))) {
+ kfree_skb(skb);
+ return 0;
+ }
+
len = skb->len;
skb_dst_drop(skb);
--
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists