netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] macvlan: Set IFF_UNICAST_FLT flag to prevent unnecessary promisc mode.
@ 2013-03-07 20:21 Vlad Yasevich
  2013-03-07 20:27 ` Ben Greear
  2013-03-07 21:37 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Vlad Yasevich @ 2013-03-07 20:21 UTC (permalink / raw)
  To: netdev; +Cc: Vlad Yasevich

Macvlan already supports hw address filters.  Set the IFF_UNICAST_FLT
so that it doesn't needlesly enter PROMISC mode when macvlans are
stacked.

Signed-of-by: Vlad Yasevich <vyasevic@redhat.com>
---
 drivers/net/macvlan.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 417b2af..73abbc1 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -660,6 +660,7 @@ void macvlan_common_setup(struct net_device *dev)
 	ether_setup(dev);
 
 	dev->priv_flags	       &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
+	dev->priv_flags	       |= IFF_UNICAST_FLT;
 	dev->netdev_ops		= &macvlan_netdev_ops;
 	dev->destructor		= free_netdev;
 	dev->header_ops		= &macvlan_hard_header_ops,
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] macvlan: Set IFF_UNICAST_FLT flag to prevent unnecessary promisc mode.
  2013-03-07 20:21 [PATCH] macvlan: Set IFF_UNICAST_FLT flag to prevent unnecessary promisc mode Vlad Yasevich
@ 2013-03-07 20:27 ` Ben Greear
  2013-03-07 20:32   ` Vlad Yasevich
  2013-03-07 21:37 ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Ben Greear @ 2013-03-07 20:27 UTC (permalink / raw)
  To: Vlad Yasevich; +Cc: netdev

On 03/07/2013 12:21 PM, Vlad Yasevich wrote:
> Macvlan already supports hw address filters.  Set the IFF_UNICAST_FLT
> so that it doesn't needlesly enter PROMISC mode when macvlans are
> stacked.

Out of curiosity, how can stacking mac-vlans be useful?

(You are stacking more macvlans on a base mac-vlan?)

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] macvlan: Set IFF_UNICAST_FLT flag to prevent unnecessary promisc mode.
  2013-03-07 20:27 ` Ben Greear
@ 2013-03-07 20:32   ` Vlad Yasevich
  2013-03-07 20:43     ` Vlad Yasevich
  0 siblings, 1 reply; 5+ messages in thread
From: Vlad Yasevich @ 2013-03-07 20:32 UTC (permalink / raw)
  To: Ben Greear; +Cc: netdev

On 03/07/2013 03:27 PM, Ben Greear wrote:
> On 03/07/2013 12:21 PM, Vlad Yasevich wrote:
>> Macvlan already supports hw address filters.  Set the IFF_UNICAST_FLT
>> so that it doesn't needlesly enter PROMISC mode when macvlans are
>> stacked.
>
> Out of curiosity, how can stacking mac-vlans be useful?
>
> (You are stacking more macvlans on a base mac-vlan?)

Yep, and macvlans allows, but it looks like it only tries to detect a 2 
level stack.  I am not sure what the reason is.  Might be realated to 
vlan-to-vlan communication.

-vlad

>
> Thanks,
> Ben
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] macvlan: Set IFF_UNICAST_FLT flag to prevent unnecessary promisc mode.
  2013-03-07 20:32   ` Vlad Yasevich
@ 2013-03-07 20:43     ` Vlad Yasevich
  0 siblings, 0 replies; 5+ messages in thread
From: Vlad Yasevich @ 2013-03-07 20:43 UTC (permalink / raw)
  To: Ben Greear; +Cc: netdev

On 03/07/2013 03:32 PM, Vlad Yasevich wrote:
> On 03/07/2013 03:27 PM, Ben Greear wrote:
>> On 03/07/2013 12:21 PM, Vlad Yasevich wrote:
>>> Macvlan already supports hw address filters.  Set the IFF_UNICAST_FLT
>>> so that it doesn't needlesly enter PROMISC mode when macvlans are
>>> stacked.
>>
>> Out of curiosity, how can stacking mac-vlans be useful?
>>
>> (You are stacking more macvlans on a base mac-vlan?)
>
> Yep, and macvlans allows, but it looks like it only tries to detect a 2
> level stack.  I am not sure what the reason is.  Might be realated to
> vlan-to-vlan communication.

Aha.  The reason is explained in this commit.

commit b0832a2961022a076c812384435b5f0290b3fc91
Author: Eric Biederman <ebiederm@aristanetworks.com>
Date:   Fri Mar 13 13:15:37 2009 -0700

     macvlan: Support creating macvlans from macvlans

     When running in a network namespace whose only link to
     the outside world is a macvlan device, not being
     able to create another macvlan is a real pain.

     So modify macvlan creation to allow automatically forward
     a creation of a macvlan on a macvlan to become a creation
     of a macvlan on the underlying network device.


I don't know if it's useful to support more then 2 levels.

-vlad

>
> -vlad
>
>>
>> Thanks,
>> Ben
>>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] macvlan: Set IFF_UNICAST_FLT flag to prevent unnecessary promisc mode.
  2013-03-07 20:21 [PATCH] macvlan: Set IFF_UNICAST_FLT flag to prevent unnecessary promisc mode Vlad Yasevich
  2013-03-07 20:27 ` Ben Greear
@ 2013-03-07 21:37 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2013-03-07 21:37 UTC (permalink / raw)
  To: vyasevic; +Cc: netdev

From: Vlad Yasevich <vyasevic@redhat.com>
Date: Thu,  7 Mar 2013 15:21:48 -0500

> Macvlan already supports hw address filters.  Set the IFF_UNICAST_FLT
> so that it doesn't needlesly enter PROMISC mode when macvlans are
> stacked.
> 
> Signed-of-by: Vlad Yasevich <vyasevic@redhat.com>

Applied, thanks Vlad.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-03-07 21:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-07 20:21 [PATCH] macvlan: Set IFF_UNICAST_FLT flag to prevent unnecessary promisc mode Vlad Yasevich
2013-03-07 20:27 ` Ben Greear
2013-03-07 20:32   ` Vlad Yasevich
2013-03-07 20:43     ` Vlad Yasevich
2013-03-07 21:37 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).