RE: [PATCH v3] net: usb: r8152: Add MAC passthrough support for RTL8153BL

From: Limonciello, Mario
Date: Fri Jan 28 2022 - 13:41:21 EST


[Public]



> -----Original Message-----
> From: Andrew Lunn <andrew@xxxxxxx>
> Sent: Friday, January 28, 2022 12:07
> To: Henning Schild <henning.schild@xxxxxxxxxxx>
> Cc: Aaron Ma <aaron.ma@xxxxxxxxxxxxx>; Limonciello, Mario
> <Mario.Limonciello@xxxxxxx>; kuba@xxxxxxxxxx; linux-usb@xxxxxxxxxxxxxxx;
> netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> gregkh@xxxxxxxxxxxxxxxxxxx; davem@xxxxxxxxxxxxx;
> hayeswang@xxxxxxxxxxx; tiwai@xxxxxxx
> Subject: Re: [PATCH v3] net: usb: r8152: Add MAC passthrough support for
> RTL8153BL
>
> On Fri, Jan 28, 2022 at 09:21:03AM +0100, Henning Schild wrote:
> > I am still very much against any patches in that direction. The feature
> > as the vendors envision it does not seem to be really understood or
> > even explained.
> > Just narrowing down the device matching caters for vendor lock-in and
> > confusion when that pass through is happening and when not. And seems
> > to lead to unmaintainable spaghetti-code.
> > People that use this very dock today will see an unexpected mac-change
> > once they update to a kernel with this patch applied.
>
> I've not yet been convinced by replies that the proposed code really
> does only match the given dock, and not random USB dongles.

Didn't Realtek confirm this bit is used to identify the Lenovo devices?

> To be
> convinced i would probably like to see code which positively
> identifies the dock, and that the USB device is on the correct port of
> the USB hub within the dock. I doubt you can actually do that in a
> sane way inside an Ethernet driver. As you say, it will likely lead to
> unmaintainable spaghetti-code.
>
> I also don't really think the vendor would be keen on adding code
> which they know will get reverted as soon as it is shown to cause a
> regression.
>
> So i would prefer to NACK this, and push it to udev rules where you
> have a complete picture of the hardware and really can identify with
> 100% certainty it really is the docks NIC.

I remember when I did the Dell implementation I tried userspace first.

Pushing this out to udev has a few other implications I remember hitting:
1) You need to also get the value you're supposed to use from ACPI BIOS
exported some way in userland too.
2) You can run into race conditions with other device or MAC renaming rules.
My first try I did it with NM and hit that continually. So you would probably
need to land this in systemd or so.

>
> Andrew