RE: [EXTERNAL] [PATCH net-next v3] net: ti: icssg-prueth: Split out common object into module
From: Sai Krishna Gajula
Date: Mon Jul 15 2024 - 02:03:26 EST
> -----Original Message-----
> From: Andrew Lunn <andrew@xxxxxxx>
> Sent: Saturday, July 13, 2024 8:15 PM
> To: Sai Krishna Gajula <saikrishnag@xxxxxxxxxxx>
> Cc: MD Danish Anwar <danishanwar@xxxxxx>; Heiner Kallweit
> <hkallweit1@xxxxxxxxx>; Simon Horman <horms@xxxxxxxxxx>; Dan
> Carpenter <dan.carpenter@xxxxxxxxxx>; Jan Kiszka
> <jan.kiszka@xxxxxxxxxxx>; Wolfram Sang <wsa+renesas@sang-
> engineering.com>; Diogo Ivo <diogo.ivo@xxxxxxxxxxx>; Roger Quadros
> <rogerq@xxxxxxxxxx>; Paolo Abeni <pabeni@xxxxxxxxxx>; Jakub Kicinski
> <kuba@xxxxxxxxxx>; Eric Dumazet <edumazet@xxxxxxxxxx>; David S. Miller
> <davem@xxxxxxxxxxxxx>; linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; srk@xxxxxx; Vignesh
> Raghavendra <vigneshr@xxxxxx>; Thorsten Leemhuis <linux@xxxxxxxxxxxxx>
> Subject: Re: [EXTERNAL] [PATCH net-next v3] net: ti: icssg-prueth: Split out
> common object into module
>
> On Sat, Jul 13, 2024 at 08: 33: 42AM +0000, Sai Krishna Gajula wrote: > > -----
> Original Message----- > > From: MD Danish Anwar <danishanwar@ ti. com> >
> > Sent: Friday, July 12, 2024 5: 37 PM > > To: Heiner Kallweit
>
> On Sat, Jul 13, 2024 at 08:33:42AM +0000, Sai Krishna Gajula wrote:
> > > -----Original Message-----
> > > From: MD Danish Anwar <danishanwar@xxxxxx>
> > > Sent: Friday, July 12, 2024 5:37 PM
> > > To: Heiner Kallweit <hkallweit1@xxxxxxxxx>; Simon Horman
> > > <horms@xxxxxxxxxx>; Dan Carpenter <dan.carpenter@xxxxxxxxxx>; Jan
> > > Kiszka <jan.kiszka@xxxxxxxxxxx>; Wolfram Sang <wsa+renesas@sang-
> > > engineering.com>; Diogo Ivo <diogo.ivo@xxxxxxxxxxx>; Andrew Lunn
> > > <andrew@xxxxxxx>; Roger Quadros <rogerq@xxxxxxxxxx>; MD Danish
> Anwar
> > > <danishanwar@xxxxxx>; Paolo Abeni <pabeni@xxxxxxxxxx>; Jakub
> > > Kicinski <kuba@xxxxxxxxxx>; Eric Dumazet <edumazet@xxxxxxxxxx>;
> > > David S. Miller <davem@xxxxxxxxxxxxx>
> > > Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx;
> > > linux-kernel@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; srk@xxxxxx;
> > > Vignesh Raghavendra <vigneshr@xxxxxx>; Thorsten Leemhuis
> > > <linux@xxxxxxxxxxxxx>
> > > Subject: [EXTERNAL] [PATCH net-next v3] net: ti: icssg-prueth: Split
> > > out common object into module
> > >
> > > icssg_prueth. c and icssg_prueth_sr1. c drivers use multiple common .c
> files.
> > > These common objects are getting added to multiple modules. As a
> > > result when both drivers are enabled in .config, below warning is seen.
> > > drivers/net/ethernet/ti/Makefile:
> > > icssg_prueth.c and icssg_prueth_sr1.c drivers use multiple common .c
> files.
> > > These common objects are getting added to multiple modules. As a
> > > result when both drivers are enabled in .config, below warning is seen.
> > >
> > > drivers/net/ethernet/ti/Makefile: icssg/icssg_common.o is added to
> > > multiple
> > > modules: icssg-prueth icssg-prueth-sr1
> > > drivers/net/ethernet/ti/Makefile: icssg/icssg_classifier.o is added
> > > to multiple
> > > modules: icssg-prueth icssg-prueth-sr1
> > > drivers/net/ethernet/ti/Makefile: icssg/icssg_config.o is added to
> > > multiple
> > > modules: icssg-prueth icssg-prueth-sr1
> > > drivers/net/ethernet/ti/Makefile: icssg/icssg_mii_cfg.o is added to
> > > multiple
> > > modules: icssg-prueth icssg-prueth-sr1
> > > drivers/net/ethernet/ti/Makefile: icssg/icssg_stats.o is added to
> > > multiple
> > > modules: icssg-prueth icssg-prueth-sr1
> > > drivers/net/ethernet/ti/Makefile: icssg/icssg_ethtool.o is added to
> > > multiple
> > > modules: icssg-prueth icssg-prueth-sr1
> > >
> > > Fix this by building a new module (icssg.o) for all the common objects.
> > > Both the driver can then depend on this common module.
> > >
> > > Some APIs being exported have emac_ as the prefix which may result
> > > into confusion with other existing APIs with emac_ prefix, to avoid
> > > confusion, rename the APIs being exported with emac_ to icssg_ prefix.
> > >
> > > This also fixes below error seen when both drivers are built.
> > > ERROR: modpost: "icssg_queue_pop"
> > > [drivers/net/ethernet/ti/icssg-prueth-sr1.ko] undefined!
> > > ERROR: modpost: "icssg_queue_push"
> > > [drivers/net/ethernet/ti/icssg-prueth-sr1.ko] undefined!
> > >
> > > Reported-and-tested-by: Thorsten Leemhuis <linux@xxxxxxxxxxxxx>
> > > Closes: https://urldefense.proofpoint.com/v2/url?u=https-
> > <https://urldefense.proofpoint.com/v2/url?u=https- >> >
> > 3A__lore.kernel.org_oe-2Dkbuild-2Dall_202405182038.ncf1mL7Z-2Dlkp-
> > > 40intel.com_&d=DwIDAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=c3MsgrR-U-
> > > HFhmFd6R4MWRZG-8QeikJn5PkjqMTpBSg&m=nS910f-bVPllINeciu3zcX-
> > > RmmuaN-hU--Y3YDvgknBD5A8sRk6hE3pZSocV-
> > > 37f&s=sIjxhBrYXEW3mtC1p8o5MaV-xpJ3n16Ct0mRhE52PCQ&e=
> > > Fixes: 487f7323f39a ("net: ti: icssg-prueth: Add helper functions to
> > > configure
> > > FDB")
> > > Reviewed-by: Roger Quadros <rogerq@xxxxxxxxxx>
> > > Signed-off-by: MD Danish Anwar <danishanwar@xxxxxx>
> > > ---
> > > Cc: Thorsten Leemhuis <linux@xxxxxxxxxxxxx>
>
> > > base-commit: 2146b7dd354c2a1384381ca3cd5751bfff6137d6
> > > --
> > > 2.34.1
> > >
> > Reviewed-by: Sai Krishna <saikrishnag@xxxxxxxxxxx>
>
> Please trim emails when replying.
>
> If you look what everybody else does with tags like this, they place it directly
> after the Signed-off-by: and delete the actual patch.
Sure Andrew, thanks for the suggestion.
>
> Andrew