* [PATCH net-next] net: airoha: select QDMA block according LAN/WAN configuration
@ 2026-03-10 14:46 Lorenzo Bianconi
2026-03-12 17:24 ` Simon Horman
0 siblings, 1 reply; 7+ messages in thread
From: Lorenzo Bianconi @ 2026-03-10 14:46 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni
Cc: linux-arm-kernel, linux-mediatek, netdev, Lorenzo Bianconi
Select the QDMA block used to send the traffic to host cpu according to
LAN/WAN port confiugration:
- QDMA0 is used for LAN devices
- QDMA1 is used for WAN devices
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/ethernet/airoha/airoha_eth.c | 18 ++++++++----------
drivers/net/ethernet/airoha/airoha_eth.h | 1 +
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c
index 3e9ec5c178f86fdd055e079078a23461edf97951..b4563b5d53bbf174d45548a5efc6fdfb79d33c19 100644
--- a/drivers/net/ethernet/airoha/airoha_eth.c
+++ b/drivers/net/ethernet/airoha/airoha_eth.c
@@ -1754,11 +1754,13 @@ static int airhoha_set_gdm2_loopback(struct airoha_gdm_port *port)
static int airoha_dev_init(struct net_device *dev)
{
struct airoha_gdm_port *port = netdev_priv(dev);
- struct airoha_qdma *qdma = port->qdma;
- struct airoha_eth *eth = qdma->eth;
+ struct airoha_eth *eth = port->eth;
u32 fe_cpu_port;
u8 ppe_id;
+ /* QDMA0 is used for lan ports while QDMA1 is used for WAN ports */
+ port->qdma = ð->qdma[!airoha_is_lan_gdm_port(port)];
+ port->dev->irq = port->qdma->irq_banks[0].irq;
airoha_set_macaddr(port, dev->dev_addr);
switch (port->id) {
@@ -1782,7 +1784,7 @@ static int airoha_dev_init(struct net_device *dev)
}
fallthrough;
default: {
- u8 qdma_id = qdma - ð->qdma[0];
+ u8 qdma_id = port->qdma - ð->qdma[0];
/* For PPE1 select cpu port according to the running QDMA. */
fe_cpu_port = qdma_id ? FE_PSE_PORT_CDM2 : FE_PSE_PORT_CDM1;
@@ -2866,11 +2868,10 @@ bool airoha_is_valid_gdm_port(struct airoha_eth *eth,
}
static int airoha_alloc_gdm_port(struct airoha_eth *eth,
- struct device_node *np, int index)
+ struct device_node *np)
{
const __be32 *id_ptr = of_get_property(np, "reg", NULL);
struct airoha_gdm_port *port;
- struct airoha_qdma *qdma;
struct net_device *dev;
int err, p;
u32 id;
@@ -2901,7 +2902,6 @@ static int airoha_alloc_gdm_port(struct airoha_eth *eth,
return -ENOMEM;
}
- qdma = ð->qdma[index % AIROHA_MAX_NUM_QDMA];
dev->netdev_ops = &airoha_netdev_ops;
dev->ethtool_ops = &airoha_ethtool_ops;
dev->max_mtu = AIROHA_MAX_MTU;
@@ -2913,7 +2913,6 @@ static int airoha_alloc_gdm_port(struct airoha_eth *eth,
dev->features |= dev->hw_features;
dev->vlan_features = dev->hw_features;
dev->dev.of_node = np;
- dev->irq = qdma->irq_banks[0].irq;
SET_NETDEV_DEV(dev, eth->dev);
/* reserve hw queues for HTB offloading */
@@ -2934,7 +2933,7 @@ static int airoha_alloc_gdm_port(struct airoha_eth *eth,
port = netdev_priv(dev);
u64_stats_init(&port->stats.syncp);
spin_lock_init(&port->stats.lock);
- port->qdma = qdma;
+ port->eth = eth;
port->dev = dev;
port->id = id;
eth->ports[p] = port;
@@ -3034,7 +3033,6 @@ static int airoha_probe(struct platform_device *pdev)
for (i = 0; i < ARRAY_SIZE(eth->qdma); i++)
airoha_qdma_start_napi(ð->qdma[i]);
- i = 0;
for_each_child_of_node(pdev->dev.of_node, np) {
if (!of_device_is_compatible(np, "airoha,eth-mac"))
continue;
@@ -3042,7 +3040,7 @@ static int airoha_probe(struct platform_device *pdev)
if (!of_device_is_available(np))
continue;
- err = airoha_alloc_gdm_port(eth, np, i++);
+ err = airoha_alloc_gdm_port(eth, np);
if (err) {
of_node_put(np);
goto error_napi_stop;
diff --git a/drivers/net/ethernet/airoha/airoha_eth.h b/drivers/net/ethernet/airoha/airoha_eth.h
index 59ed7569f7c33620ea694ec52384a37e1917eaf8..8cfa94ec084a16d6b2d3c94c404f25904c1150e3 100644
--- a/drivers/net/ethernet/airoha/airoha_eth.h
+++ b/drivers/net/ethernet/airoha/airoha_eth.h
@@ -533,6 +533,7 @@ struct airoha_qdma {
struct airoha_gdm_port {
struct airoha_qdma *qdma;
+ struct airoha_eth *eth;
struct net_device *dev;
int id;
---
base-commit: 89fe91c65992a37863241e35aec151210efc53ce
change-id: 20260310-airoha-qdma-lan-wan-mode-63d322eefef3
Best regards,
--
Lorenzo Bianconi <lorenzo@kernel.org>
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net-next] net: airoha: select QDMA block according LAN/WAN configuration
2026-03-10 14:46 [PATCH net-next] net: airoha: select QDMA block according LAN/WAN configuration Lorenzo Bianconi
@ 2026-03-12 17:24 ` Simon Horman
2026-03-12 21:14 ` Lorenzo Bianconi
0 siblings, 1 reply; 7+ messages in thread
From: Simon Horman @ 2026-03-12 17:24 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, linux-arm-kernel, linux-mediatek, netdev
On Tue, Mar 10, 2026 at 03:46:53PM +0100, Lorenzo Bianconi wrote:
> Select the QDMA block used to send the traffic to host cpu according to
> LAN/WAN port confiugration:
> - QDMA0 is used for LAN devices
> - QDMA1 is used for WAN devices
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Hi Lorenzo,
Is this a bug fix?
If so, perhaps it is for net with a fixes tag.
And at any rate, could you add some description of the before and after
behaviour?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next] net: airoha: select QDMA block according LAN/WAN configuration
2026-03-12 17:24 ` Simon Horman
@ 2026-03-12 21:14 ` Lorenzo Bianconi
2026-03-13 0:22 ` Jakub Kicinski
0 siblings, 1 reply; 7+ messages in thread
From: Lorenzo Bianconi @ 2026-03-12 21:14 UTC (permalink / raw)
To: Simon Horman
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, linux-arm-kernel, linux-mediatek, netdev
[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]
> On Tue, Mar 10, 2026 at 03:46:53PM +0100, Lorenzo Bianconi wrote:
> > Select the QDMA block used to send the traffic to host cpu according to
> > LAN/WAN port confiugration:
> > - QDMA0 is used for LAN devices
> > - QDMA1 is used for WAN devices
> >
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
>
> Hi Lorenzo,
Hi Simon,
>
> Is this a bug fix?
> If so, perhaps it is for net with a fixes tag.
I guess we do not need to target net tree since airoha_eth driver currently
supports just the LAN interface via the MT7530 DSA switch connected to GDM1
and there are no WAN interfaces officially supported (PCS/external phy is not
merged mainline yet, it is only available in OpenWrt).
>
> And at any rate, could you add some description of the before and after
> behaviour?
Theoretically, before this patch, GDM ports were equally distributed between
QDMA0 and QDMA1 while this patch assigns LAN interfaces to QDMA0 and WAN
interface to QDMA1. However, for the reason explained above, this change is
not currently visible to the user.
Regards,
Lorenzo
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next] net: airoha: select QDMA block according LAN/WAN configuration
2026-03-12 21:14 ` Lorenzo Bianconi
@ 2026-03-13 0:22 ` Jakub Kicinski
2026-03-13 11:35 ` Lorenzo Bianconi
0 siblings, 1 reply; 7+ messages in thread
From: Jakub Kicinski @ 2026-03-13 0:22 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: Simon Horman, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, linux-arm-kernel, linux-mediatek, netdev
On Thu, 12 Mar 2026 22:14:36 +0100 Lorenzo Bianconi wrote:
> > Is this a bug fix?
> > If so, perhaps it is for net with a fixes tag.
>
> I guess we do not need to target net tree since airoha_eth driver currently
> supports just the LAN interface via the MT7530 DSA switch connected to GDM1
> and there are no WAN interfaces officially supported (PCS/external phy is not
> merged mainline yet, it is only available in OpenWrt).
>
> >
> > And at any rate, could you add some description of the before and after
> > behaviour?
>
> Theoretically, before this patch, GDM ports were equally distributed between
> QDMA0 and QDMA1 while this patch assigns LAN interfaces to QDMA0 and WAN
> interface to QDMA1. However, for the reason explained above, this change is
> not currently visible to the user.
Please update the commit message. And please try harder to explain
the patches, this happens a lot with your submissions..
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next] net: airoha: select QDMA block according LAN/WAN configuration
2026-03-13 0:22 ` Jakub Kicinski
@ 2026-03-13 11:35 ` Lorenzo Bianconi
2026-03-13 14:30 ` Simon Horman
0 siblings, 1 reply; 7+ messages in thread
From: Lorenzo Bianconi @ 2026-03-13 11:35 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Simon Horman, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, linux-arm-kernel, linux-mediatek, netdev
[-- Attachment #1: Type: text/plain, Size: 1193 bytes --]
> On Thu, 12 Mar 2026 22:14:36 +0100 Lorenzo Bianconi wrote:
> > > Is this a bug fix?
> > > If so, perhaps it is for net with a fixes tag.
> >
> > I guess we do not need to target net tree since airoha_eth driver currently
> > supports just the LAN interface via the MT7530 DSA switch connected to GDM1
> > and there are no WAN interfaces officially supported (PCS/external phy is not
> > merged mainline yet, it is only available in OpenWrt).
> >
> > >
> > > And at any rate, could you add some description of the before and after
> > > behaviour?
> >
> > Theoretically, before this patch, GDM ports were equally distributed between
> > QDMA0 and QDMA1 while this patch assigns LAN interfaces to QDMA0 and WAN
> > interface to QDMA1. However, for the reason explained above, this change is
> > not currently visible to the user.
>
> Please update the commit message. And please try harder to explain
> the patches, this happens a lot with your submissions..
ack, fine. Sorry for not beeing very clear about this (and other
patches), I will pay more attention in the future.
Do you think we should target net-next or net for this patch?
Regards,
Lorenzo
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next] net: airoha: select QDMA block according LAN/WAN configuration
2026-03-13 11:35 ` Lorenzo Bianconi
@ 2026-03-13 14:30 ` Simon Horman
2026-03-13 15:25 ` Lorenzo Bianconi
0 siblings, 1 reply; 7+ messages in thread
From: Simon Horman @ 2026-03-13 14:30 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: Jakub Kicinski, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, linux-arm-kernel, linux-mediatek, netdev
On Fri, Mar 13, 2026 at 12:35:16PM +0100, Lorenzo Bianconi wrote:
> > On Thu, 12 Mar 2026 22:14:36 +0100 Lorenzo Bianconi wrote:
> > > > Is this a bug fix?
> > > > If so, perhaps it is for net with a fixes tag.
> > >
> > > I guess we do not need to target net tree since airoha_eth driver currently
> > > supports just the LAN interface via the MT7530 DSA switch connected to GDM1
> > > and there are no WAN interfaces officially supported (PCS/external phy is not
> > > merged mainline yet, it is only available in OpenWrt).
> > >
> > > >
> > > > And at any rate, could you add some description of the before and after
> > > > behaviour?
> > >
> > > Theoretically, before this patch, GDM ports were equally distributed between
> > > QDMA0 and QDMA1 while this patch assigns LAN interfaces to QDMA0 and WAN
> > > interface to QDMA1. However, for the reason explained above, this change is
> > > not currently visible to the user.
> >
> > Please update the commit message. And please try harder to explain
> > the patches, this happens a lot with your submissions..
>
> ack, fine. Sorry for not beeing very clear about this (and other
> patches), I will pay more attention in the future.
> Do you think we should target net-next or net for this patch?
Hi Lorenzo,
As per your explanation above it seems to me that there is
no user-visible change. And I assume that implies no bug manifests.
If so, net-next sounds right to me.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next] net: airoha: select QDMA block according LAN/WAN configuration
2026-03-13 14:30 ` Simon Horman
@ 2026-03-13 15:25 ` Lorenzo Bianconi
0 siblings, 0 replies; 7+ messages in thread
From: Lorenzo Bianconi @ 2026-03-13 15:25 UTC (permalink / raw)
To: Simon Horman
Cc: Jakub Kicinski, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, linux-arm-kernel, linux-mediatek, netdev
[-- Attachment #1: Type: text/plain, Size: 1618 bytes --]
> On Fri, Mar 13, 2026 at 12:35:16PM +0100, Lorenzo Bianconi wrote:
> > > On Thu, 12 Mar 2026 22:14:36 +0100 Lorenzo Bianconi wrote:
> > > > > Is this a bug fix?
> > > > > If so, perhaps it is for net with a fixes tag.
> > > >
> > > > I guess we do not need to target net tree since airoha_eth driver currently
> > > > supports just the LAN interface via the MT7530 DSA switch connected to GDM1
> > > > and there are no WAN interfaces officially supported (PCS/external phy is not
> > > > merged mainline yet, it is only available in OpenWrt).
> > > >
> > > > >
> > > > > And at any rate, could you add some description of the before and after
> > > > > behaviour?
> > > >
> > > > Theoretically, before this patch, GDM ports were equally distributed between
> > > > QDMA0 and QDMA1 while this patch assigns LAN interfaces to QDMA0 and WAN
> > > > interface to QDMA1. However, for the reason explained above, this change is
> > > > not currently visible to the user.
> > >
> > > Please update the commit message. And please try harder to explain
> > > the patches, this happens a lot with your submissions..
> >
> > ack, fine. Sorry for not beeing very clear about this (and other
> > patches), I will pay more attention in the future.
> > Do you think we should target net-next or net for this patch?
>
> Hi Lorenzo,
>
> As per your explanation above it seems to me that there is
> no user-visible change. And I assume that implies no bug manifests.
>
> If so, net-next sounds right to me.
ack, I will rework the commit log and repost to net-next.
Regards,
Lorenzo
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-03-13 15:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-10 14:46 [PATCH net-next] net: airoha: select QDMA block according LAN/WAN configuration Lorenzo Bianconi
2026-03-12 17:24 ` Simon Horman
2026-03-12 21:14 ` Lorenzo Bianconi
2026-03-13 0:22 ` Jakub Kicinski
2026-03-13 11:35 ` Lorenzo Bianconi
2026-03-13 14:30 ` Simon Horman
2026-03-13 15:25 ` Lorenzo Bianconi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox