[ovs-dev] [PATCH] vport-internal_dev:Drop packets when interdev is not up

Pravin Shelar pshelar at nicira.com
Fri Aug 1 21:55:27 UTC 2014


On Wed, Jul 30, 2014 at 6:28 PM, Lichunhe <lichunhe at huawei.com> wrote:
> Thanks your reply, Could this patch be applied to other branches?
>

OK, I pushed it to branch 2.1 and 2.3.


> Chunhe
>
>>-----Original Message-----
>>From: Pravin Shelar [mailto:pshelar at nicira.com]
>>Sent: Thursday, July 31, 2014 4:38 AM
>>To: Lichunhe
>>Cc: dev at openvswitch.org
>>Subject: Re: [ovs-dev] [PATCH] vport-internal_dev:Drop packets when interdev is
>>not up
>>
>>On Tue, Jul 29, 2014 at 6:49 PM,  <lichunhe at huawei.com> wrote:
>>> From: Chunhe Li <lichunhe at huawei.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 at huawei.com>
>>> ---
>>>  datapath/vport-internal_dev.c | 5 +++++
>>>  1 file changed, 5 insertions(+)
>>>
>>> diff --git a/datapath/vport-internal_dev.c
>>> b/datapath/vport-internal_dev.c index 3b0f9a7..b0e1b24 100644
>>> --- a/datapath/vport-internal_dev.c
>>> +++ b/datapath/vport-internal_dev.c
>>> @@ -242,6 +242,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 (netdev && !(netdev->flags & IFF_UP)) {
>>> +               kfree_skb(skb);
>>> +               return 0;
>>> +       }
>>> +
>>There is no need to check for netdev pointer, so I removed it, added unlikely
>>annotation and pushed the patch.
>>
>>Thanks,
>>Pravin.



More information about the dev mailing list