[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210114084435.094c260a@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Thu, 14 Jan 2021 08:44:35 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Vladimir Oltean <olteanv@...il.com>
Cc: netdev@...r.kernel.org, alexandre.belloni@...tlin.com,
andrew@...n.ch, f.fainelli@...il.com, vivien.didelot@...il.com,
alexandru.marginean@....com, claudiu.manoil@....com,
xiaoliang.yang_1@....com, hongbo.wang@....com, jiri@...nulli.us,
idosch@...sch.org, UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH v3 net-next 08/10] net: mscc: ocelot: register devlink
ports
On Thu, 14 Jan 2021 12:34:05 +0200 Vladimir Oltean wrote:
> On Mon, Jan 11, 2021 at 11:19:09AM -0800, Jakub Kicinski wrote:
> > > > devlink_port_attrs_set() should be called before netdev is registered,
> > > > and devlink_port_type_eth_set() after. So this sequence makes me a tad
> > > > suspicious.
> > > >
> > > > In particular IIRC devlink's .ndo_get_phys_port_name depends on it,
> > > > because udev event needs to carry the right info for interface renaming
> > > > to work reliably. No?
> > >
> > > If I change the driver's Kconfig from tristate to bool, all is fine,
> > > isn't it?
> >
> > How does Kconfig change the order of registration of objects to
> > subsystems _within_ the driver?
>
> The registration order within the driver is not what matters. What
> matters is that the devlink_port and net_device are both registered
> _before_ udev is up.
I see.
> > Can you unbind and bind the driver back and see if phys_port_name
> > always gets the correct value? (replay/udevadm test is not sufficient)
>
> Yes, and that udev renaming test failed miserably still.
>
> I have dhcpcd in my system, and it races with my udev script by
> auto-upping the interfaces when they probe. Then, dev_change_name()
> returns -EBUSY because the interfaces are up but its priv_flags do not
> declare IFF_LIVE_RENAME_OK.
>
> How is that one solved?
Yeah, that's one of those perennial problems we never found a strong
answer to. IIRC IFF_LIVE_RENAME_OK was more of a dirty hack than a
serious answer. I think we should allow renaming interfaces while
they're up, and see if anything breaks. We'd just need to add the right
netlink notifications to dev_change_name(), maybe?
Powered by blists - more mailing lists