From: Jiri Pirko <jpirko@redhat.com>
To: David Lamparter <equinox@diac24.net>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
shemminger@linux-foundation.org, kaber@trash.net,
fubar@us.ibm.com, eric.dumazet@gmail.com,
nicolas.2p.debian@gmail.com, andy@greyhouse.net,
greearb@candelatech.com, mirqus@gmail.com
Subject: Re: [patch net-next-2.6] net: allow multiple rx_handler registration
Date: Tue, 12 Jul 2011 15:20:08 +0200 [thread overview]
Message-ID: <20110712132005.GA2300@minipsycho.brq.redhat.com> (raw)
In-Reply-To: <20110712115422.GD616804@jupiter.n2.diac24.net>
Tue, Jul 12, 2011 at 01:54:22PM CEST, equinox@diac24.net wrote:
>On Tue, Jul 12, 2011 at 01:06:01PM +0200, Jiri Pirko wrote:
>> For some net topos it is necessary to have multiple "soft-net-devices"
>> hooked on one netdev. For example very common is to have
>> eth<->(br+vlan). Vlan is not using rh_handler (yet) but it might be useful
>> for other setups.
>
>I disagree strongly, especially with the use cases you're enabling in
>this patch.
>
>> + res = netdev_rx_handler_register(slave_dev, &new_slave->rx_handler,
>> + bond_handle_frame,
>> + RX_HANDLER_PRIO_BOND);
>
>> + err = netdev_rx_handler_register(dev, &port->rx_handler,
>> + macvlan_handle_frame,
>> + RX_HANDLER_PRIO_MACVLAN);
>
>> + err = netdev_rx_handler_register(dev, &p->rx_handler, br_handle_frame,
>> + RX_HANDLER_PRIO_BRIDGE);
>
>> +enum rx_handler_prio {
>> + RX_HANDLER_PRIO_BRIDGE,
>> + RX_HANDLER_PRIO_BOND,
>> + RX_HANDLER_PRIO_MACVLAN,
>> +};
>
>These are all incompatible with each other to a varying degree and/or
>don't make much sense. Let's look at them:
>
>a) a device simultaneously being a bridge member and a bond slave
> -> Fully incompatible. Your bonding peer switch will start sending
> the bridge's packets on other bond member devices.
Not possible. See netdev_set_master(). Anyway, before rx_handler was
introduced, this was possible and no one cared.
>
>b) a device having macvlans and being a bond slave
> -> Fully incompatible. Same as above, packets to the macvlan will end
> up on other bond member devices.
>
>c) bridge + macvlan
> -> Mostly useless. Add veth/tap devices to your bridge... as a bonus
> you get a proper MAC table.
>
>This at least needs bonding support removed since bonding is essentially
>incompatible with anything else w/ the same reasoning as above. Bonds
>are as low-level as Pause frames. Never ever touch individual bond
>slaves.
>
>What does make sense is a device being member of multiple bridges, with
>ebtables as solicitor for which bridge gets the packet. But that's not
>possible with your patch...
>+ if (netdev_rx_handler_get_by_prio(dev, prio))
> return -EBUSY;
>
>I think your idea is good, but it needs WAY more proper consideration.
This patch doen't introduce anything new which wasn't possible before
rx_handler times. Anyway removing bond from using rx_handler as you
suggested pushes us back.
The rationale of this patch is to have all in one place, clean
architecture. The rest of problems, like what can be
used with what in one time etc can be easily sorted out by follow-up
patches.
And to your idea about multi-bridge support, br co needs to be
adjusted as well. And in relation with PRIO, my idea (inspired from RFC
of this patch comments) is to allow users to change priorities
dynamically from userspace. Also then it could be a range of prios for
bridge for example.
Hope that I cleared that out for you.
Jirka
>
>
>-David
>
next prev parent reply other threads:[~2011-07-12 13:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-12 11:06 [patch net-next-2.6] net: allow multiple rx_handler registration Jiri Pirko
2011-07-12 11:54 ` David Lamparter
2011-07-12 13:20 ` Jiri Pirko [this message]
2011-07-12 14:29 ` David Lamparter
2011-07-12 15:01 ` Jiri Pirko
2011-07-12 16:02 ` Michał Mirosław
2011-07-12 16:03 ` David Lamparter
2011-07-13 5:28 ` Jiri Pirko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110712132005.GA2300@minipsycho.brq.redhat.com \
--to=jpirko@redhat.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=equinox@diac24.net \
--cc=eric.dumazet@gmail.com \
--cc=fubar@us.ibm.com \
--cc=greearb@candelatech.com \
--cc=kaber@trash.net \
--cc=mirqus@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=nicolas.2p.debian@gmail.com \
--cc=shemminger@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).