Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Ido Schimmel <idosch@idosch.org>,
	Florian Fainelli <f.fainelli@gmail.com>
Cc: Vasundhara Volam <vasundhara-v.volam@broadcom.com>,
	Jiri Pirko <jiri@mellanox.com>,
	Michael Chan <michael.chan@broadcom.com>,
	jtoppins@redhat.com, Netdev <netdev@vger.kernel.org>,
	Andrew Lunn <andrew@lunn.ch>
Subject: Re: Failing to attach bond(created with two interfaces from different NICs) to a bridge
Date: Sun, 6 Sep 2020 10:13:35 -0700	[thread overview]
Message-ID: <20200906101335.47b2b60b@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <20200906111249.GA2419244@shredder.lan>

On Sun, 6 Sep 2020 14:12:49 +0300 Ido Schimmel wrote:
> On Thu, Sep 03, 2020 at 12:14:28PM -0700, Jakub Kicinski wrote:
> > On Thu, 3 Sep 2020 12:52:25 +0530 Vasundhara Volam wrote:  
> > > Hello Jiri,
> > > 
> > > After the following set of upstream commits, the user fails to attach
> > > a bond to the bridge, if the user creates the bond with two interfaces
> > > from different bnxt_en NICs. Previously bnxt_en driver does not
> > > advertise the switch_id for legacy mode as part of
> > > ndo_get_port_parent_id cb but with the following patches, switch_id is
> > > returned even in legacy mode which is causing the failure.
> > > 
> > > ---------------
> > > 7e1146e8c10c00f859843817da8ecc5d902ea409 net: devlink: introduce
> > > devlink_compat_switch_id_get() helper
> > > 6605a226781eb1224c2dcf974a39eea11862b864 bnxt: pass switch ID through
> > > devlink_port_attrs_set()
> > > 56d9f4e8f70e6f47ad4da7640753cf95ae51a356 bnxt: remove
> > > ndo_get_port_parent_id implementation for physical ports
> > > ----------------
> > > 
> > > As there is a plan to get rid of ndo_get_port_parent_id in future, I
> > > think there is a need to fix devlink_compat_switch_id_get() to return
> > > the switch_id only when device is in SWITCHDEV mode and this effects
> > > all the NICs.
> > > 
> > > Please let me know your thoughts. Thank you.  
> > 
> > I'm not Jiri, but I'd think that hiding switch_id from devices should
> > not be the solution here. Especially that no NICs offload bridging
> > today. 
> > 
> > Could you describe the team/bridge failure in detail, I'm not that
> > familiar with this code.  
> 
> Maybe:
> 
> br_add_slave()
> 	br_add_if()
> 		nbp_switchdev_mark_set()
> 			dev_get_port_parent_id()
> 
> I believe the last call will return '-ENODATA' because the two bnxt
> netdevs member in the bond have different switch IDs. Perhaps the 
> function can be changed to return '-EOPNOTSUPP' when it's called for an
> upper device that have multiple parent IDs beneath it:
> 
> diff --git a/net/core/dev.c b/net/core/dev.c
> index d42c9ea0c3c0..7932594ca437 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -8646,7 +8646,7 @@ int dev_get_port_parent_id(struct net_device *dev,
>                 if (!first.id_len)
>                         first = *ppid;
>                 else if (memcmp(&first, ppid, sizeof(*ppid)))
> -                       return -ENODATA;
> +                       return -EOPNOTSUPP;
>         }
>  
>         return err;

LGTM, or we could make bridge ignore ENODATA (in case the distinctions
is useful?)

I was searching for the early versions of Florian's patch set but
I can't find it :( Florian, do you remember if there was a reason to
fail bridge in this case?

  reply	other threads:[~2020-09-06 17:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03  7:22 Vasundhara Volam
2020-09-03 19:14 ` Jakub Kicinski
2020-09-06 11:12   ` Ido Schimmel
2020-09-06 17:13     ` Jakub Kicinski [this message]
2020-09-06 19:23       ` Florian Fainelli
2020-09-07  7:36         ` Ido Schimmel
2020-09-07 16:14           ` Jakub Kicinski
2020-09-08  6:24           ` Vasundhara Volam
2020-09-06 11:15   ` Vasundhara Volam

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=20200906101335.47b2b60b@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=f.fainelli@gmail.com \
    --cc=idosch@idosch.org \
    --cc=jiri@mellanox.com \
    --cc=jtoppins@redhat.com \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=vasundhara-v.volam@broadcom.com \
    --subject='Re: Failing to attach bond(created with two interfaces from different NICs) to a bridge' \
    /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

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).