Subject: Re: MACVLANs really best solution? How about a bridge with multiple bridge virtual interfaces?

From: Patrick McHardy <[email-masked]>
Date: Mon, 09 Mar 2009 17:45:00 +0100

Eric W. Biederman wrote:
> Patrick McHardy <[email-masked]> writes:
> 
>> Eric W. Biederman wrote:
>>> There are two tricky parts.
>>>
>>> One problem is that macvlans and the primary hardware device share the
>>> same transmit queue.  So when I have a broadcast packet on the primary
>>> devices queue I don't know if I have already sent it out to the
>>> macvlan devices or not.
>> So its about receiving packets on macvlan when transmitting on the
>> real device? That sounds like a really hard problem that would probably
>> indeed be better solved by a bridge.
> 
> Yes.  My concern is that if we hook the real device we will
> software broadcast packets twice.

It would also require an additional hook in the networking core,
right? Which doesn't seem appropriate for a corner case like this.

> Now that I think about it we could call ndo_start_xmit directly
> from the macvlan code, and bypass whatever hook we use to
> intercept packets going out the normal device it should not
> be too difficult.

We don't intercept packets on TX, they have to be explicitly delivered
to macvlan.