netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "Christian Marangi (Ansuel)" <ansuelsmth@gmail.com>,
	Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, nbd@nbd.name, sean.wang@mediatek.com,
	upstream@airoha.com
Subject: Re: Move airoha in a dedicated folder
Date: Sun, 2 Feb 2025 21:59:06 +0100	[thread overview]
Message-ID: <Z5_cmtVmYiNKkpe4@lore-desk> (raw)
In-Reply-To: <634c90a1-e671-42ae-9751-fee3a599af20@lunn.ch>

[-- 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 --]

  parent reply	other threads:[~2025-02-02 20:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2025-02-04  9:37     ` Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z5_cmtVmYiNKkpe4@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sean.wang@mediatek.com \
    --cc=upstream@airoha.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).