* Move airoha in a dedicated folder
@ 2025-02-01 12:44 Lorenzo Bianconi
2025-02-01 15:43 ` Andrew Lunn
2025-02-01 15:50 ` Simon Horman
0 siblings, 2 replies; 8+ messages in thread
From: Lorenzo Bianconi @ 2025-02-01 12:44 UTC (permalink / raw)
To: netdev
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, nbd, sean.wang,
ansuelsmth, upstream
[-- Attachment #1: Type: text/plain, Size: 343 bytes --]
Hi all,
Since more features are on the way for airoha_eth driver (support for flowtable
hw offloading, 10g phy support, ..), I was wondering if it is neater to move
the driver in a dedicated folder (e.g. drivers/net/ethernet/airoha or
drivers/net/ethernet/mediatek/airoha) or if you prefer to keep current
approach. Thanks.
Regards,
Lorenzo
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Move airoha in a dedicated folder
2025-02-01 12:44 Move airoha in a dedicated folder Lorenzo Bianconi
@ 2025-02-01 15:43 ` Andrew Lunn
2025-02-01 15:50 ` Simon Horman
1 sibling, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2025-02-01 15:43 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni, nbd,
sean.wang, ansuelsmth, upstream
On Sat, Feb 01, 2025 at 01:44:53PM +0100, Lorenzo Bianconi wrote:
> Hi all,
>
> Since more features are on the way for airoha_eth driver (support for flowtable
> hw offloading, 10g phy support, ..), I was wondering if it is neater to move
> the driver in a dedicated folder (e.g. drivers/net/ethernet/airoha or
> drivers/net/ethernet/mediatek/airoha) or if you prefer to keep current
> approach. Thanks.
Hi Lorenzo
Moving it into a subdirectoruy of mediatek is fine. Maybe also
consider moving mtk_eth and mtk_wed into subdirectories.
Andrew
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Move airoha in a dedicated folder
2025-02-01 12:44 Move airoha in a dedicated folder Lorenzo Bianconi
2025-02-01 15:43 ` Andrew Lunn
@ 2025-02-01 15:50 ` Simon Horman
2025-02-02 15:50 ` Christian Marangi (Ansuel)
1 sibling, 1 reply; 8+ messages in thread
From: Simon Horman @ 2025-02-01 15:50 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni, nbd,
sean.wang, ansuelsmth, upstream
On Sat, Feb 01, 2025 at 01:44:53PM +0100, Lorenzo Bianconi wrote:
> Hi all,
>
> Since more features are on the way for airoha_eth driver (support for flowtable
> hw offloading, 10g phy support, ..), I was wondering if it is neater to move
> the driver in a dedicated folder (e.g. drivers/net/ethernet/airoha or
> drivers/net/ethernet/mediatek/airoha) or if you prefer to keep current
> approach. Thanks.
<2c>
Hi Lorenzo,
There already seem drivers to be drivers under drivers/net/ethernet/mediatek/
which are built from more than once .c file. So I think it is fine
to leave Airoha's source there. But, OTOH, I do think it would
be neater to move it into it's own directory. Which is to say,
I for one am happy either way.
If you do chose to go for a new directory, I would suggest
drivers/net/ethernet/mediatek/airoha assuming as it is a Mediatek device.
</2c>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Move airoha in a dedicated folder
2025-02-01 15:50 ` Simon Horman
@ 2025-02-02 15:50 ` Christian Marangi (Ansuel)
2025-02-02 16:49 ` Andrew Lunn
2025-02-04 9:37 ` Simon Horman
0 siblings, 2 replies; 8+ messages in thread
From: Christian Marangi (Ansuel) @ 2025-02-02 15:50 UTC (permalink / raw)
To: Simon Horman
Cc: Lorenzo Bianconi, netdev, andrew+netdev, davem, edumazet, kuba,
pabeni, nbd, sean.wang, upstream
Il giorno sab 1 feb 2025 alle ore 16:50 Simon Horman
<horms@kernel.org> ha scritto:
>
> On Sat, Feb 01, 2025 at 01:44:53PM +0100, Lorenzo Bianconi wrote:
> > Hi all,
> >
> > Since more features are on the way for airoha_eth driver (support for flowtable
> > hw offloading, 10g phy support, ..), I was wondering if it is neater to move
> > the driver in a dedicated folder (e.g. drivers/net/ethernet/airoha or
> > drivers/net/ethernet/mediatek/airoha) or if you prefer to keep current
> > approach. Thanks.
>
> <2c>
>
> Hi Lorenzo,
>
> There already seem drivers to be drivers under drivers/net/ethernet/mediatek/
> which are built from more than once .c file. So I think it is fine
> to leave Airoha's source there. But, OTOH, I do think it would
> be neater to move it into it's own directory. Which is to say,
> I for one am happy either way.
>
> If you do chose to go for a new directory, I would suggest
> drivers/net/ethernet/mediatek/airoha assuming as it is a Mediatek device.
>
Hi,
may I push for a dedicated Airoha directory? (/net/ethernet/airoha ?)
With new SoC it seems Airoha is progressively detaching from Mediatek.
There are some similarities but for example for the PPE only the logical entry
table is similar but rest of the stuff is handled by a coprocessor
with dedicated
firmware. My big concern is that we will start to bloat the mediatek directory
with very different kind of code.
Putting stuff in ethernet/mediatek/airoha would imply starting to use
format like
#include "../stuff.h" and maybe we would start to import stuff from
mediatek that
should not be used by airoha.
Keeping the 2 thing split might make the similarities even more
evident and easier
to handle as we will have to rework the header to use the generic include/linux.
Hope all of this makes sense, it's really to prevent situation and keep things
organized from the start.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Move airoha in a dedicated folder
2025-02-02 15:50 ` Christian Marangi (Ansuel)
@ 2025-02-02 16:49 ` Andrew Lunn
2025-02-02 17:00 ` Christian Marangi (Ansuel)
2025-02-02 20:59 ` Lorenzo Bianconi
2025-02-04 9:37 ` Simon Horman
1 sibling, 2 replies; 8+ messages in thread
From: Andrew Lunn @ 2025-02-02 16:49 UTC (permalink / raw)
To: Christian Marangi (Ansuel)
Cc: Simon Horman, Lorenzo Bianconi, netdev, andrew+netdev, davem,
edumazet, kuba, pabeni, nbd, sean.wang, upstream
> Hi,
> may I push for a dedicated Airoha directory? (/net/ethernet/airoha ?)
>
> With new SoC it seems Airoha is progressively detaching from Mediatek.
The vendor name is actually not very relevant. Linux has a much longer
life than most vendors. Assets get bought and sold, but they keep the
same name in Linux simply to make Maintenance simpler. FEC has not
been part of Freescale for a long time. Microsemi and micrel are part
of microchip, but we still call them microsemi and micrel, because who
knows, microchip might soon be eaten by somebody bigger, or broken up?
> Putting stuff in ethernet/mediatek/airoha would imply starting to
> use format like #include "../stuff.h" and maybe we would start to
> import stuff from mediatek that should not be used by airoha.
obj-$(CONFIG_NET_AIROHA) += airoha_eth.o
#include <linux/etherdevice.h>
#include <linux/iopoll.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/of.h>
#include <linux/of_net.h>
#include <linux/platform_device.h>
#include <linux/reset.h>
#include <linux/tcp.h>
#include <linux/u64_stats_sync.h>
#include <net/dsa.h>
#include <net/page_pool/helpers.h>
#include <net/pkt_cls.h>
#include <uapi/linux/ppp_defs.h>
I don't see anything being shared. Maybe that is just because those
features are not implemented yet? But if there is sharing, we do want
code to be shared, rather than copy/paste bugs and code between
drivers.
Maybe drivers/net/ethernet/wangxun is a good model to follow, although
i might put the headers in include/linux/net/mediatek rather than do
relative #includes.
Andrew
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Move airoha in a dedicated folder
2025-02-02 16:49 ` Andrew Lunn
@ 2025-02-02 17:00 ` Christian Marangi (Ansuel)
2025-02-02 20:59 ` Lorenzo Bianconi
1 sibling, 0 replies; 8+ messages in thread
From: Christian Marangi (Ansuel) @ 2025-02-02 17:00 UTC (permalink / raw)
To: Andrew Lunn
Cc: Simon Horman, Lorenzo Bianconi, netdev, andrew+netdev, davem,
edumazet, kuba, pabeni, nbd, sean.wang, upstream
Il giorno dom 2 feb 2025 alle ore 17:49 Andrew Lunn <andrew@lunn.ch> ha scritto:
>
> > Hi,
> > may I push for a dedicated Airoha directory? (/net/ethernet/airoha ?)
> >
> > With new SoC it seems Airoha is progressively detaching from Mediatek.
>
> The vendor name is actually not very relevant. Linux has a much longer
> life than most vendors. Assets get bought and sold, but they keep the
> same name in Linux simply to make Maintenance simpler. FEC has not
> been part of Freescale for a long time. Microsemi and micrel are part
> of microchip, but we still call them microsemi and micrel, because who
> knows, microchip might soon be eaten by somebody bigger, or broken up?
>
Yep, with detaching I mean more with the fact that it seems they are
stopping reusing Mediatek as a base for new HW.
Aka code sharing and registers are getting very different or no
similarities at all.
> > Putting stuff in ethernet/mediatek/airoha would imply starting to
> > use format like #include "../stuff.h" and maybe we would start to
> > import stuff from mediatek that should not be used by airoha.
>
> obj-$(CONFIG_NET_AIROHA) += airoha_eth.o
>
> #include <linux/etherdevice.h>
> #include <linux/iopoll.h>
> #include <linux/kernel.h>
> #include <linux/netdevice.h>
> #include <linux/of.h>
> #include <linux/of_net.h>
> #include <linux/platform_device.h>
> #include <linux/reset.h>
> #include <linux/tcp.h>
> #include <linux/u64_stats_sync.h>
> #include <net/dsa.h>
> #include <net/page_pool/helpers.h>
> #include <net/pkt_cls.h>
> #include <uapi/linux/ppp_defs.h>
>
> I don't see anything being shared. Maybe that is just because those
> features are not implemented yet? But if there is sharing, we do want
> code to be shared, rather than copy/paste bugs and code between
> drivers.
Yes this is really to understand how to move for the next drivers submission.
It's mainly about PPE and firmware loading. Airoha_eth got quite big already
and the code got split in multiple drivers. Also the header is planned to
be split in a dedicated airoha_regs header.
>
> Maybe drivers/net/ethernet/wangxun is a good model to follow, although
> i might put the headers in include/linux/net/mediatek rather than do
> relative #includes.
>
I personally prefer include/linux than relative includes, so if everyone is
ok with that I would choose that path.
Again this is really to better organize and understand how to move
with the new code. Thanks for the suggestions as always.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Move airoha in a dedicated folder
2025-02-02 16:49 ` Andrew Lunn
2025-02-02 17:00 ` Christian Marangi (Ansuel)
@ 2025-02-02 20:59 ` Lorenzo Bianconi
1 sibling, 0 replies; 8+ messages in thread
From: Lorenzo Bianconi @ 2025-02-02 20:59 UTC (permalink / raw)
To: Andrew Lunn
Cc: Christian Marangi (Ansuel), Simon Horman, netdev, andrew+netdev,
davem, edumazet, kuba, pabeni, nbd, sean.wang, upstream
[-- Attachment #1: Type: text/plain, Size: 2488 bytes --]
> > Hi,
> > may I push for a dedicated Airoha directory? (/net/ethernet/airoha ?)
> >
> > With new SoC it seems Airoha is progressively detaching from Mediatek.
>
> The vendor name is actually not very relevant. Linux has a much longer
> life than most vendors. Assets get bought and sold, but they keep the
> same name in Linux simply to make Maintenance simpler. FEC has not
> been part of Freescale for a long time. Microsemi and micrel are part
> of microchip, but we still call them microsemi and micrel, because who
> knows, microchip might soon be eaten by somebody bigger, or broken up?
>
> > Putting stuff in ethernet/mediatek/airoha would imply starting to
> > use format like #include "../stuff.h" and maybe we would start to
> > import stuff from mediatek that should not be used by airoha.
>
> obj-$(CONFIG_NET_AIROHA) += airoha_eth.o
>
> #include <linux/etherdevice.h>
> #include <linux/iopoll.h>
> #include <linux/kernel.h>
> #include <linux/netdevice.h>
> #include <linux/of.h>
> #include <linux/of_net.h>
> #include <linux/platform_device.h>
> #include <linux/reset.h>
> #include <linux/tcp.h>
> #include <linux/u64_stats_sync.h>
> #include <net/dsa.h>
> #include <net/page_pool/helpers.h>
> #include <net/pkt_cls.h>
> #include <uapi/linux/ppp_defs.h>
>
> I don't see anything being shared. Maybe that is just because those
> features are not implemented yet? But if there is sharing, we do want
> code to be shared, rather than copy/paste bugs and code between
> drivers.
>
> Maybe drivers/net/ethernet/wangxun is a good model to follow, although
> i might put the headers in include/linux/net/mediatek rather than do
> relative #includes.
I do not think we can reuse many code from MTK codebase since, even if the
Packet Switch Engine (PSE)/Packet Processor Engine (PPE) architecture is
similar to MTK one (you can find a diagram here [0]), Airoha SoC runs a NPU
to configure the PPE module and we can't access the hw directly as we do
for MTK. Moreover, the PPE entry layout is slightly different and we could
reuse just some MTK definitions. For these reasons I guess it does not worth
to have a structure similar to wangxun's one (lib + hw specific code), maybe
just move the driver in a dedicated folder? (e.g. drivers/net/ethernet/airoha)
Regards,
Lorenzo
[0] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=23020f04932701d5c8363e60756f12b43b8ed752
>
> Andrew
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Move airoha in a dedicated folder
2025-02-02 15:50 ` Christian Marangi (Ansuel)
2025-02-02 16:49 ` Andrew Lunn
@ 2025-02-04 9:37 ` Simon Horman
1 sibling, 0 replies; 8+ messages in thread
From: Simon Horman @ 2025-02-04 9:37 UTC (permalink / raw)
To: Christian Marangi (Ansuel)
Cc: Lorenzo Bianconi, netdev, andrew+netdev, davem, edumazet, kuba,
pabeni, nbd, sean.wang, upstream
On Sun, Feb 02, 2025 at 04:50:33PM +0100, Christian Marangi (Ansuel) wrote:
> Il giorno sab 1 feb 2025 alle ore 16:50 Simon Horman
> <horms@kernel.org> ha scritto:
> >
> > On Sat, Feb 01, 2025 at 01:44:53PM +0100, Lorenzo Bianconi wrote:
> > > Hi all,
> > >
> > > Since more features are on the way for airoha_eth driver (support for flowtable
> > > hw offloading, 10g phy support, ..), I was wondering if it is neater to move
> > > the driver in a dedicated folder (e.g. drivers/net/ethernet/airoha or
> > > drivers/net/ethernet/mediatek/airoha) or if you prefer to keep current
> > > approach. Thanks.
> >
> > <2c>
> >
> > Hi Lorenzo,
> >
> > There already seem drivers to be drivers under drivers/net/ethernet/mediatek/
> > which are built from more than once .c file. So I think it is fine
> > to leave Airoha's source there. But, OTOH, I do think it would
> > be neater to move it into it's own directory. Which is to say,
> > I for one am happy either way.
> >
> > If you do chose to go for a new directory, I would suggest
> > drivers/net/ethernet/mediatek/airoha assuming as it is a Mediatek device.
> >
>
> Hi,
> may I push for a dedicated Airoha directory? (/net/ethernet/airoha ?)
>
> With new SoC it seems Airoha is progressively detaching from Mediatek.
>
> There are some similarities but for example for the PPE only the logical entry
> table is similar but rest of the stuff is handled by a coprocessor
> with dedicated
> firmware. My big concern is that we will start to bloat the mediatek directory
> with very different kind of code.
>
> Putting stuff in ethernet/mediatek/airoha would imply starting to use
> format like
> #include "../stuff.h" and maybe we would start to import stuff from
> mediatek that
> should not be used by airoha.
>
> Keeping the 2 thing split might make the similarities even more
> evident and easier
> to handle as we will have to rework the header to use the generic include/linux.
>
> Hope all of this makes sense, it's really to prevent situation and keep things
> organized from the start.
Thanks Christian,
Given the above and the conversation thus far elsewhere in this thread
I now agree that drivers/net/ethernet/airoha is a good option.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-02-04 9:37 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-01 12:44 Move airoha in a dedicated folder Lorenzo Bianconi
2025-02-01 15:43 ` Andrew Lunn
2025-02-01 15:50 ` Simon Horman
2025-02-02 15:50 ` Christian Marangi (Ansuel)
2025-02-02 16:49 ` Andrew Lunn
2025-02-02 17:00 ` Christian Marangi (Ansuel)
2025-02-02 20:59 ` Lorenzo Bianconi
2025-02-04 9:37 ` Simon Horman
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).