RE: [PATCH v4 2/5] net: lan743x: read SFP straps from PCI11x1x device

From: Thangaraj.S

Date: Mon Jun 01 2026 - 02:10:21 EST


Hi Andrew,
Thanks for the comments.

> -----Original Message-----
> From: Andrew Lunn <andrew@xxxxxxx>
> Sent: Wednesday, May 27, 2026 6:53 PM
> To: Thangaraj Samynathan - I53494 <Thangaraj.S@xxxxxxxxxxxxx>
> Cc: netdev@xxxxxxxxxxxxxxx; andrew+netdev@xxxxxxx;
> davem@xxxxxxxxxxxxx; edumazet@xxxxxxxxxx; kuba@xxxxxxxxxx;
> pabeni@xxxxxxxxxx; Bryan Whitehead - C21958
> <Bryan.Whitehead@xxxxxxxxxxxxx>; UNGLinuxDriver
> <UNGLinuxDriver@xxxxxxxxxxxxx>; linux@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v4 2/5] net: lan743x: read SFP straps from PCI11x1x
> device
>
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
>
> > > > Introduce CONFIG_LAN743X_SFP to guard SFP-specific code
> > >
> > > Why? Does this add a lot of code? Most MAC drivers don't have such a
> > > Kconfig configuration, so i think this needs some justification.
> > [Thangaraj Samynathan] CONFIG_LAN743X_SFP was introduced based on
> > Jakub's v3 review feedback. There are devices on this LAN743x family
> > of devices (LAN7430, LAN7431, PCI11x1x) that do not support SFP at
> > all. So while the amount of code in the common LAN743x driver itself
> > may not be that much, the dependencies could force an intended
> > minimalistic build of the kernel that wanted to use the lan7430 device
> > (which is rgmii only capable device) to have to include tons of kernel
> > code (sfp, i2c, gpio) it does not need otherwise.
>
> In practice distributions turn on nearly everything. So the code is likely to be
> built. Rather than a Kconfig symbol, can you move the code into a module,
> which only gets loaded for pci11x1x?
[Thangaraj Samynathan] Thanks for the suggestion. We agree this is a reasonable direction.
For this series, CONFIG_LAN743X_SFP addresses the dependency concern.
For distro builds that enable most options, a separate module would
typically be built and loaded as well, so the practical result is the
same. For minimal builds, CONFIG_LAN743X_SFP keeps the SFP, I2C, and
GPIO dependencies optional at compile time without requiring a module
split.
Keeping multiple chip variants in one module is also common; for
example, igb supports 82575, 82576, i210, and i350 in a single
module. We think the Kconfig option is the simpler solution for this
series.
If there is still a preference for splitting this out, we can address it
in a follow-up. PCI11x1x differs in more areas than SFP support,
including TX channel count, IRQ vectors, SGMII/XPCS paths, and power
management. A clean split would likely require an ops structure across
the driver, which seems better handled as a separate refactoring.
Would that be acceptable?
> Andrew