From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pravin B Shelar Subject: [PATCH net-next v2 09/14] openvswitch: Drop packets when interdev is not up Date: Thu, 6 Nov 2014 01:19:32 -0800 Message-ID: <1415265572-1785-1-git-send-email-pshelar@nicira.com> Cc: netdev@vger.kernel.org, Chunhe Li , Pravin B Shelar To: davem@davemloft.net Return-path: Received: from na3sys009aog118.obsmtp.com ([74.125.149.244]:40822 "HELO na3sys009aog118.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752022AbaKFJTf (ORCPT ); Thu, 6 Nov 2014 04:19:35 -0500 Received: by mail-pa0-f48.google.com with SMTP id ey11so897240pad.7 for ; Thu, 06 Nov 2014 01:19:34 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: From: Chunhe Li 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 Signed-off-by: Pravin B Shelar --- 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