]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
airoha: backport upstream fix for Airoha reported bug for ethernet
authorChristian Marangi <ansuelsmth@gmail.com>
Sat, 16 May 2026 10:10:22 +0000 (12:10 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Sat, 16 May 2026 10:11:52 +0000 (12:11 +0200)
Airoha reported some additional bug and fixes were pushed for the ethernet
driver. Backport the additional patch merged upstream and refresh all
affected patch.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
13 files changed:
target/linux/airoha/patches-6.12/155-v7.2-net-airoha-Rename-get_src_port_id-callback-in-get_sp.patch [new file with mode: 0644]
target/linux/airoha/patches-6.12/156-v7.2-net-airoha-Do-not-return-err-in-ndo_stop-callback.patch [new file with mode: 0644]
target/linux/airoha/patches-6.12/157-v7.2-net-airoha-Move-entries-to-queue-head-in-case-of-DMA.patch [new file with mode: 0644]
target/linux/airoha/patches-6.12/158-v7.2-net-airoha-configure-QoS-channel-for-HW-accelerated-.patch [new file with mode: 0644]
target/linux/airoha/patches-6.12/159-v7.2-net-airoha-Introduce-airoha_fe_get-airoha_qdma_get-r.patch [new file with mode: 0644]
target/linux/airoha/patches-6.12/160-v7.2-net-airoha-Reserve-RX-headroom-to-avoid-skb-realloca.patch [new file with mode: 0644]
target/linux/airoha/patches-6.12/310-02-net-airoha-deassert-XSI-line-on-hw-init.patch
target/linux/airoha/patches-6.12/310-03-net-airoha-add-reference-for-SPORT-GDM4-in-qdma_get_.patch
target/linux/airoha/patches-6.12/310-06-net-airoha-add-initial-fixup-for-GDM3-4-port-support.patch
target/linux/airoha/patches-6.12/310-07-airoha-ethernet-drop-xsi-mac-reset.patch
target/linux/airoha/patches-6.12/310-10-net-airoha-add-phylink-support-for-GDM2-3-4.patch
target/linux/airoha/patches-6.12/604-02-net-ethernet-airoha-define-sport-value-for-GDM3.patch
target/linux/airoha/patches-6.12/606-net-airoha-disable-external-phy-code-if-PCS_AIROHA-i.patch

diff --git a/target/linux/airoha/patches-6.12/155-v7.2-net-airoha-Rename-get_src_port_id-callback-in-get_sp.patch b/target/linux/airoha/patches-6.12/155-v7.2-net-airoha-Rename-get_src_port_id-callback-in-get_sp.patch
new file mode 100644 (file)
index 0000000..425ee19
--- /dev/null
@@ -0,0 +1,75 @@
+From c06a2f2903f6fba0a3088ad05fc5cf61a66e5d89 Mon Sep 17 00:00:00 2001
+From: Lorenzo Bianconi <lorenzo@kernel.org>
+Date: Tue, 28 Apr 2026 07:23:38 +0200
+Subject: [PATCH] net: airoha: Rename get_src_port_id callback in get_sport
+
+For code consistency, rename get_src_port_id callback in get_sport.
+Please note this patch does not introduce any logical change and it is
+just a cosmetic patch.
+
+Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
+Link: https://patch.msgid.link/20260428-airoha-get_src_port_id-callback-v1-1-3f765c91c1e8@kernel.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+---
+ drivers/net/ethernet/airoha/airoha_eth.c | 10 +++++-----
+ drivers/net/ethernet/airoha/airoha_eth.h |  2 +-
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+--- a/drivers/net/ethernet/airoha/airoha_eth.c
++++ b/drivers/net/ethernet/airoha/airoha_eth.c
+@@ -1823,7 +1823,7 @@ static int airoha_set_gdm2_loopback(stru
+       airoha_fe_clear(eth, REG_FE_VIP_PORT_EN, BIT(AIROHA_GDM2_IDX));
+       airoha_fe_clear(eth, REG_FE_IFC_PORT_EN, BIT(AIROHA_GDM2_IDX));
+-      src_port = eth->soc->ops.get_src_port_id(port, port->nbq);
++      src_port = eth->soc->ops.get_sport(port, port->nbq);
+       if (src_port < 0)
+               return src_port;
+@@ -3199,7 +3199,7 @@ static const char * const en7581_xsi_rst
+       "xfp-mac",
+ };
+-static int airoha_en7581_get_src_port_id(struct airoha_gdm_port *port, int nbq)
++static int airoha_en7581_get_sport(struct airoha_gdm_port *port, int nbq)
+ {
+       switch (port->id) {
+       case AIROHA_GDM3_IDX:
+@@ -3252,7 +3252,7 @@ static const char * const an7583_xsi_rst
+       "xfp-mac",
+ };
+-static int airoha_an7583_get_src_port_id(struct airoha_gdm_port *port, int nbq)
++static int airoha_an7583_get_sport(struct airoha_gdm_port *port, int nbq)
+ {
+       switch (port->id) {
+       case AIROHA_GDM3_IDX:
+@@ -3300,7 +3300,7 @@ static const struct airoha_eth_soc_data
+       .num_xsi_rsts = ARRAY_SIZE(en7581_xsi_rsts_names),
+       .num_ppe = 2,
+       .ops = {
+-              .get_src_port_id = airoha_en7581_get_src_port_id,
++              .get_sport = airoha_en7581_get_sport,
+               .get_vip_port = airoha_en7581_get_vip_port,
+       },
+ };
+@@ -3311,7 +3311,7 @@ static const struct airoha_eth_soc_data
+       .num_xsi_rsts = ARRAY_SIZE(an7583_xsi_rsts_names),
+       .num_ppe = 1,
+       .ops = {
+-              .get_src_port_id = airoha_an7583_get_src_port_id,
++              .get_sport = airoha_an7583_get_sport,
+               .get_vip_port = airoha_an7583_get_vip_port,
+       },
+ };
+--- a/drivers/net/ethernet/airoha/airoha_eth.h
++++ b/drivers/net/ethernet/airoha/airoha_eth.h
+@@ -578,7 +578,7 @@ struct airoha_eth_soc_data {
+       int num_xsi_rsts;
+       int num_ppe;
+       struct {
+-              int (*get_src_port_id)(struct airoha_gdm_port *port, int nbq);
++              int (*get_sport)(struct airoha_gdm_port *port, int nbq);
+               u32 (*get_vip_port)(struct airoha_gdm_port *port, int nbq);
+       } ops;
+ };
diff --git a/target/linux/airoha/patches-6.12/156-v7.2-net-airoha-Do-not-return-err-in-ndo_stop-callback.patch b/target/linux/airoha/patches-6.12/156-v7.2-net-airoha-Do-not-return-err-in-ndo_stop-callback.patch
new file mode 100644 (file)
index 0000000..a111990
--- /dev/null
@@ -0,0 +1,36 @@
+From 4ca01292ea2f2363660610a65ba0285d7c3309ed Mon Sep 17 00:00:00 2001
+From: Lorenzo Bianconi <lorenzo@kernel.org>
+Date: Tue, 28 Apr 2026 08:53:16 +0200
+Subject: [PATCH] net: airoha: Do not return err in ndo_stop() callback
+
+Always complete the airoha_dev_stop() routine regardless of the
+airoha_set_vip_for_gdm_port() return value, since errors from
+ndo_stop() are ignored by the networking stack and the interface is
+always considered down after the call.
+
+Fixes: 23020f049327 ("net: airoha: Introduce ethernet support for EN7581 SoC")
+Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
+Link: https://patch.msgid.link/20260428-airoha-ndo-stop-not-err-v1-1-674506d29a91@kernel.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+---
+ drivers/net/ethernet/airoha/airoha_eth.c | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+--- a/drivers/net/ethernet/airoha/airoha_eth.c
++++ b/drivers/net/ethernet/airoha/airoha_eth.c
+@@ -1747,13 +1747,10 @@ static int airoha_dev_stop(struct net_de
+ {
+       struct airoha_gdm_port *port = netdev_priv(dev);
+       struct airoha_qdma *qdma = port->qdma;
+-      int i, err;
++      int i;
+       netif_tx_disable(dev);
+-      err = airoha_set_vip_for_gdm_port(port, false);
+-      if (err)
+-              return err;
+-
++      airoha_set_vip_for_gdm_port(port, false);
+       for (i = 0; i < dev->num_tx_queues; i++)
+               netdev_tx_reset_subqueue(dev, i);
diff --git a/target/linux/airoha/patches-6.12/157-v7.2-net-airoha-Move-entries-to-queue-head-in-case-of-DMA.patch b/target/linux/airoha/patches-6.12/157-v7.2-net-airoha-Move-entries-to-queue-head-in-case-of-DMA.patch
new file mode 100644 (file)
index 0000000..45d1a19
--- /dev/null
@@ -0,0 +1,38 @@
+From 75df490c9e8457990c8b227650f6491218ce018b Mon Sep 17 00:00:00 2001
+From: Lorenzo Bianconi <lorenzo@kernel.org>
+Date: Wed, 29 Apr 2026 14:02:31 +0200
+Subject: [PATCH] net: airoha: Move entries to queue head in case of DMA
+ mapping failure in airoha_dev_xmit()
+
+In order to respect the original descriptor order and avoid any
+potential IOMMU fault or memory corruption, move pending queue entries
+to the head of hw queue tx_list if the DMA mapping of current inflight
+packet fails in airoha_dev_xmit routine.
+
+Fixes: 3f47e67dff1f7 ("net: airoha: Add the capability to consume out-of-order DMA tx descriptors")
+Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
+Link: https://patch.msgid.link/20260429-airoha-xmit-unmap-error-path-v2-1-32e43b7c6d25@kernel.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+---
+ drivers/net/ethernet/airoha/airoha_eth.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/ethernet/airoha/airoha_eth.c
++++ b/drivers/net/ethernet/airoha/airoha_eth.c
+@@ -2120,14 +2120,12 @@ static netdev_tx_t airoha_dev_xmit(struc
+       return NETDEV_TX_OK;
+ error_unmap:
+-      while (!list_empty(&tx_list)) {
+-              e = list_first_entry(&tx_list, struct airoha_queue_entry,
+-                                   list);
++      list_for_each_entry(e, &tx_list, list) {
+               dma_unmap_single(dev->dev.parent, e->dma_addr, e->dma_len,
+                                DMA_TO_DEVICE);
+               e->dma_addr = 0;
+-              list_move_tail(&e->list, &q->tx_list);
+       }
++      list_splice(&tx_list, &q->tx_list);
+       spin_unlock_bh(&q->lock);
+ error:
diff --git a/target/linux/airoha/patches-6.12/158-v7.2-net-airoha-configure-QoS-channel-for-HW-accelerated-.patch b/target/linux/airoha/patches-6.12/158-v7.2-net-airoha-configure-QoS-channel-for-HW-accelerated-.patch
new file mode 100644 (file)
index 0000000..c9a6192
--- /dev/null
@@ -0,0 +1,44 @@
+From 286efd34d1a1ef5d83f9441b5e59421a26738169 Mon Sep 17 00:00:00 2001
+From: Lorenzo Bianconi <lorenzo@kernel.org>
+Date: Thu, 30 Apr 2026 10:47:38 +0200
+Subject: [PATCH] net: airoha: configure QoS channel for HW accelerated
+ flowtable traffic
+
+As done for the SW path, configure the QoS channel for HW accelerated
+traffic according to the user port index when forwarding to a DSA port,
+or rely on the GDM port identifier otherwise. This allows HTB shaping
+to be applied to HW accelerated traffic.
+
+Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
+Link: https://patch.msgid.link/20260430-airoha-ppe-qos-channel-v1-1-5ef9221e85c1@kernel.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+---
+ drivers/net/ethernet/airoha/airoha_ppe.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/airoha/airoha_ppe.c
++++ b/drivers/net/ethernet/airoha/airoha_ppe.c
+@@ -332,7 +332,7 @@ static int airoha_ppe_foe_entry_prepare(
+                                               info.wcid);
+               } else {
+                       struct airoha_gdm_port *port = netdev_priv(dev);
+-                      u8 pse_port;
++                      u8 pse_port, channel;
+                       if (!airoha_is_valid_gdm_port(eth, port))
+                               return -EINVAL;
+@@ -345,6 +345,14 @@ static int airoha_ppe_foe_entry_prepare(
+                                              * loopback
+                                              */
++                      /* For traffic forwarded to DSA devices select QoS
++                       * channel according to the DSA user port index, rely
++                       * on port id otherwise.
++                       */
++                      channel = dsa_port >= 0 ? dsa_port : port->id;
++                      channel = channel % AIROHA_NUM_QOS_CHANNELS;
++                      qdata |= FIELD_PREP(AIROHA_FOE_CHANNEL, channel);
++
+                       val |= FIELD_PREP(AIROHA_FOE_IB2_PSE_PORT, pse_port) |
+                              AIROHA_FOE_IB2_PSE_QOS;
+                       /* For downlink traffic consume SRAM memory for hw
diff --git a/target/linux/airoha/patches-6.12/159-v7.2-net-airoha-Introduce-airoha_fe_get-airoha_qdma_get-r.patch b/target/linux/airoha/patches-6.12/159-v7.2-net-airoha-Introduce-airoha_fe_get-airoha_qdma_get-r.patch
new file mode 100644 (file)
index 0000000..ad5dcc9
--- /dev/null
@@ -0,0 +1,95 @@
+From 98e490930de3af9afa0bbb2d1d79d6d5b5513012 Mon Sep 17 00:00:00 2001
+From: Lorenzo Bianconi <lorenzo@kernel.org>
+Date: Fri, 1 May 2026 09:49:11 +0200
+Subject: [PATCH] net: airoha: Introduce airoha_fe_get()/airoha_qdma_get()
+ register read helpers
+
+Add airoha_fe_get() and airoha_qdma_get() as utility routines for reading
+a masked field from a specified register.
+This is a non-functional refactor, no logical changes are introduced to
+the existing codebase.
+
+Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
+Link: https://patch.msgid.link/20260501-airoha_fe_get-airoha_qdma_get-v3-1-126c6f647ccb@kernel.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+---
+ drivers/net/ethernet/airoha/airoha_eth.c | 13 ++++---------
+ drivers/net/ethernet/airoha/airoha_eth.h |  4 ++++
+ drivers/net/ethernet/airoha/airoha_ppe.c |  5 ++---
+ 3 files changed, 10 insertions(+), 12 deletions(-)
+
+--- a/drivers/net/ethernet/airoha/airoha_eth.c
++++ b/drivers/net/ethernet/airoha/airoha_eth.c
+@@ -201,15 +201,13 @@ static void airoha_fe_vip_setup(struct a
+ static u32 airoha_fe_get_pse_queue_rsv_pages(struct airoha_eth *eth,
+                                            u32 port, u32 queue)
+ {
+-      u32 val;
+-
+       airoha_fe_rmw(eth, REG_FE_PSE_QUEUE_CFG_WR,
+                     PSE_CFG_PORT_ID_MASK | PSE_CFG_QUEUE_ID_MASK,
+                     FIELD_PREP(PSE_CFG_PORT_ID_MASK, port) |
+                     FIELD_PREP(PSE_CFG_QUEUE_ID_MASK, queue));
+-      val = airoha_fe_rr(eth, REG_FE_PSE_QUEUE_CFG_VAL);
+-      return FIELD_GET(PSE_CFG_OQ_RSV_MASK, val);
++      return airoha_fe_get(eth, REG_FE_PSE_QUEUE_CFG_VAL,
++                           PSE_CFG_OQ_RSV_MASK);
+ }
+ static void airoha_fe_set_pse_queue_rsv_pages(struct airoha_eth *eth,
+@@ -227,9 +225,7 @@ static void airoha_fe_set_pse_queue_rsv_
+ static u32 airoha_fe_get_pse_all_rsv(struct airoha_eth *eth)
+ {
+-      u32 val = airoha_fe_rr(eth, REG_FE_PSE_BUF_SET);
+-
+-      return FIELD_GET(PSE_ALLRSV_MASK, val);
++      return airoha_fe_get(eth, REG_FE_PSE_BUF_SET, PSE_ALLRSV_MASK);
+ }
+ static int airoha_fe_set_pse_oq_rsv(struct airoha_eth *eth,
+@@ -247,8 +243,7 @@ static int airoha_fe_set_pse_oq_rsv(stru
+                     FIELD_PREP(PSE_ALLRSV_MASK, all_rsv));
+       /* modify hthd */
+-      tmp = airoha_fe_rr(eth, PSE_FQ_CFG);
+-      fq_limit = FIELD_GET(PSE_FQ_LIMIT_MASK, tmp);
++      fq_limit = airoha_fe_get(eth, PSE_FQ_CFG, PSE_FQ_LIMIT_MASK);
+       tmp = fq_limit - all_rsv - 0x20;
+       airoha_fe_rmw(eth, REG_PSE_SHARE_USED_THD,
+                     PSE_SHARE_USED_HTHD_MASK,
+--- a/drivers/net/ethernet/airoha/airoha_eth.h
++++ b/drivers/net/ethernet/airoha/airoha_eth.h
+@@ -619,6 +619,8 @@ u32 airoha_rmw(void __iomem *base, u32 o
+       airoha_rmw((eth)->fe_regs, (offset), 0, (val))
+ #define airoha_fe_clear(eth, offset, val)                     \
+       airoha_rmw((eth)->fe_regs, (offset), (val), 0)
++#define airoha_fe_get(eth, offset, mask)                      \
++      FIELD_GET((mask), airoha_fe_rr((eth), (offset)))
+ #define airoha_qdma_rr(qdma, offset)                          \
+       airoha_rr((qdma)->regs, (offset))
+@@ -630,6 +632,8 @@ u32 airoha_rmw(void __iomem *base, u32 o
+       airoha_rmw((qdma)->regs, (offset), 0, (val))
+ #define airoha_qdma_clear(qdma, offset, val)                  \
+       airoha_rmw((qdma)->regs, (offset), (val), 0)
++#define airoha_qdma_get(qdma, offset, mask)                   \
++      FIELD_GET((mask), airoha_qdma_rr((qdma), (offset)))
+ static inline u16 airoha_qdma_get_txq(struct airoha_qdma *qdma, u16 qid)
+ {
+--- a/drivers/net/ethernet/airoha/airoha_ppe.c
++++ b/drivers/net/ethernet/airoha/airoha_ppe.c
+@@ -80,9 +80,8 @@ bool airoha_ppe_is_enabled(struct airoha
+ static u32 airoha_ppe_get_timestamp(struct airoha_ppe *ppe)
+ {
+-      u16 timestamp = airoha_fe_rr(ppe->eth, REG_FE_FOE_TS);
+-
+-      return FIELD_GET(AIROHA_FOE_IB1_BIND_TIMESTAMP, timestamp);
++      return airoha_fe_get(ppe->eth, REG_FE_FOE_TS,
++                           AIROHA_FOE_IB1_BIND_TIMESTAMP);
+ }
+ void airoha_ppe_set_cpu_port(struct airoha_gdm_port *port, u8 ppe_id, u8 fport)
diff --git a/target/linux/airoha/patches-6.12/160-v7.2-net-airoha-Reserve-RX-headroom-to-avoid-skb-realloca.patch b/target/linux/airoha/patches-6.12/160-v7.2-net-airoha-Reserve-RX-headroom-to-avoid-skb-realloca.patch
new file mode 100644 (file)
index 0000000..06d6443
--- /dev/null
@@ -0,0 +1,73 @@
+From bbfb1983944f2eaa8ee192e0f7b59ecc0fda9981 Mon Sep 17 00:00:00 2001
+From: Lorenzo Bianconi <lorenzo@kernel.org>
+Date: Wed, 13 May 2026 17:03:59 +0200
+Subject: [PATCH] net: airoha: Reserve RX headroom to avoid skb reallocation
+
+Reserve NET_SKB_PAD + NET_IP_ALIGN bytes of headroom for received packets
+to avoid skb head reallocation when pushing protocol headers into the skb.
+
+Tested-by: Xuegang Lu <xuegang.lu@airoha.com>
+Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
+Link: https://patch.msgid.link/20260513-airoha-rx-headroom-v1-1-bd87798e422d@kernel.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+---
+ drivers/net/ethernet/airoha/airoha_eth.c | 14 ++++++++------
+ drivers/net/ethernet/airoha/airoha_eth.h |  2 ++
+ 2 files changed, 10 insertions(+), 6 deletions(-)
+
+--- a/drivers/net/ethernet/airoha/airoha_eth.c
++++ b/drivers/net/ethernet/airoha/airoha_eth.c
+@@ -543,9 +543,10 @@ static int airoha_qdma_fill_rx_queue(str
+               q->queued++;
+               nframes++;
++              offset += AIROHA_RX_HEADROOM;
+               e->buf = page_address(page) + offset;
+               e->dma_addr = page_pool_get_dma_addr(page) + offset;
+-              e->dma_len = SKB_WITH_OVERHEAD(q->buf_size);
++              e->dma_len = SKB_WITH_OVERHEAD(AIROHA_RX_LEN(q->buf_size));
+               val = FIELD_PREP(QDMA_DESC_LEN_MASK, e->dma_len);
+               WRITE_ONCE(desc->ctrl, cpu_to_le32(val));
+@@ -611,13 +612,12 @@ static int airoha_qdma_rx_process(struct
+               q->tail = (q->tail + 1) % q->ndesc;
+               q->queued--;
+-              dma_sync_single_for_cpu(eth->dev, e->dma_addr,
+-                                      SKB_WITH_OVERHEAD(q->buf_size), dir);
++              dma_sync_single_for_cpu(eth->dev, e->dma_addr, e->dma_len,
++                                      dir);
+               page = virt_to_head_page(e->buf);
+               len = FIELD_GET(QDMA_DESC_LEN_MASK, desc_ctrl);
+-              data_len = q->skb ? q->buf_size
+-                                : SKB_WITH_OVERHEAD(q->buf_size);
++              data_len = q->skb ? AIROHA_RX_LEN(q->buf_size) : e->dma_len;
+               if (!len || data_len < len)
+                       goto free_frag;
+@@ -627,10 +627,12 @@ static int airoha_qdma_rx_process(struct
+               port = eth->ports[p];
+               if (!q->skb) { /* first buffer */
+-                      q->skb = napi_build_skb(e->buf, q->buf_size);
++                      q->skb = napi_build_skb(e->buf - AIROHA_RX_HEADROOM,
++                                              q->buf_size);
+                       if (!q->skb)
+                               goto free_frag;
++                      skb_reserve(q->skb, AIROHA_RX_HEADROOM);
+                       __skb_put(q->skb, len);
+                       skb_mark_for_recycle(q->skb);
+                       q->skb->dev = port->dev;
+--- a/drivers/net/ethernet/airoha/airoha_eth.h
++++ b/drivers/net/ethernet/airoha/airoha_eth.h
+@@ -32,6 +32,8 @@
+ #define AIROHA_FE_MC_MAX_VLAN_TABLE   64
+ #define AIROHA_FE_MC_MAX_VLAN_PORT    16
+ #define AIROHA_NUM_TX_IRQ             2
++#define AIROHA_RX_HEADROOM            (NET_SKB_PAD + NET_IP_ALIGN)
++#define AIROHA_RX_LEN(_n)             ((_n) - AIROHA_RX_HEADROOM)
+ #define HW_DSCP_NUM                   2048
+ #define IRQ_QUEUE_LEN(_n)             ((_n) ? 1024 : 2048)
+ #define TX_DSCP_NUM                   1024
index 2d9ee580d6cde931e8f315c5910abe4a77b29143..a75e06f944a34822d3369a1f856c37028aa15a0c 100644 (file)
@@ -13,7 +13,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
 
 --- a/drivers/net/ethernet/airoha/airoha_eth.c
 +++ b/drivers/net/ethernet/airoha/airoha_eth.c
-@@ -1490,6 +1490,10 @@ static int airoha_hw_init(struct platfor
+@@ -1487,6 +1487,10 @@ static int airoha_hw_init(struct platfor
        if (err)
                return err;
  
index 874b832c427789bbbc6d18339c9f0ebaf4642dc3..d5a2ba9d1ae1dcfd28f77fe1134663a15601e93b 100644 (file)
@@ -16,7 +16,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
 
 --- a/drivers/net/ethernet/airoha/airoha_eth.c
 +++ b/drivers/net/ethernet/airoha/airoha_eth.c
-@@ -578,8 +578,11 @@ static int airoha_qdma_get_gdm_port(stru
+@@ -574,8 +574,11 @@ static int airoha_qdma_get_gdm_port(stru
  
        sport = FIELD_GET(QDMA_ETH_RXMSG_SPORT_MASK, msg1);
        switch (sport) {
index 7dcdd745afdf5b8cc259f824c374204e2a22fa21..cd774e11eace72b6558d8bc9ac00d7c27cf3bc5f 100644 (file)
@@ -15,7 +15,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
 
 --- a/drivers/net/ethernet/airoha/airoha_eth.c
 +++ b/drivers/net/ethernet/airoha/airoha_eth.c
-@@ -503,8 +503,10 @@ static int airoha_fe_init(struct airoha_
+@@ -498,8 +498,10 @@ static int airoha_fe_init(struct airoha_
                      FIELD_PREP(IP_ASSEMBLE_PORT_MASK, 0) |
                      FIELD_PREP(IP_ASSEMBLE_NBQ_MASK, 22));
  
@@ -28,7 +28,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
  
        airoha_fe_crsn_qsel_init(eth);
  
-@@ -1722,7 +1724,8 @@ static int airoha_dev_open(struct net_de
+@@ -1719,7 +1721,8 @@ static int airoha_dev_open(struct net_de
        if (err)
                return err;
  
index 1e70f32e9d5a63d4bf427bc59aeee03b3671289a..fefca21ca26fb057c6eb2b7363e22c5a57999b13 100644 (file)
@@ -15,7 +15,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
 
 --- a/drivers/net/ethernet/airoha/airoha_eth.c
 +++ b/drivers/net/ethernet/airoha/airoha_eth.c
-@@ -3202,7 +3202,6 @@ static void airoha_remove(struct platfor
+@@ -3194,7 +3194,6 @@ static void airoha_remove(struct platfor
  }
  
  static const char * const en7581_xsi_rsts_names[] = {
@@ -23,7 +23,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
        "hsi0-mac",
        "hsi1-mac",
        "hsi-mac",
-@@ -3256,7 +3255,6 @@ static u32 airoha_en7581_get_vip_port(st
+@@ -3248,7 +3247,6 @@ static u32 airoha_en7581_get_vip_port(st
  }
  
  static const char * const an7583_xsi_rsts_names[] = {
index bc45a4c6548c09ab8e98a22bf91872fa1c854f87..d686fc739be22304d4e9a98bc1f6d7437164482a 100644 (file)
@@ -49,7 +49,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
  static void airoha_set_macaddr(struct airoha_gdm_port *port, const u8 *addr)
  {
        struct airoha_eth *eth = port->qdma->eth;
-@@ -1719,6 +1725,17 @@ static int airoha_dev_open(struct net_de
+@@ -1716,6 +1722,17 @@ static int airoha_dev_open(struct net_de
        struct airoha_qdma *qdma = port->qdma;
        u32 pse_port = FE_PSE_PORT_PPE1;
  
@@ -67,7 +67,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
        netif_tx_start_all_queues(dev);
        err = airoha_set_vip_for_gdm_port(port, true);
        if (err)
-@@ -1783,6 +1800,11 @@ static int airoha_dev_stop(struct net_de
+@@ -1777,6 +1794,11 @@ static int airoha_dev_stop(struct net_de
                }
        }
  
@@ -79,7 +79,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
        return 0;
  }
  
-@@ -2922,6 +2944,11 @@ static const struct ethtool_ops airoha_e
+@@ -2914,6 +2936,11 @@ static const struct ethtool_ops airoha_e
        .get_link               = ethtool_op_get_link,
  };
  
@@ -91,7 +91,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
  static int airoha_metadata_dst_alloc(struct airoha_gdm_port *port)
  {
        int i;
-@@ -2966,6 +2993,124 @@ bool airoha_is_valid_gdm_port(struct air
+@@ -2958,6 +2985,124 @@ bool airoha_is_valid_gdm_port(struct air
        return false;
  }
  
@@ -216,7 +216,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
  static int airoha_alloc_gdm_port(struct airoha_eth *eth,
                                 struct device_node *np)
  {
-@@ -3039,6 +3184,12 @@ static int airoha_alloc_gdm_port(struct
+@@ -3031,6 +3176,12 @@ static int airoha_alloc_gdm_port(struct
        port->nbq = id == AIROHA_GDM3_IDX && airoha_is_7581(eth) ? 4 : 0;
        eth->ports[p] = port;
  
@@ -229,7 +229,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
        return airoha_metadata_dst_alloc(port);
  }
  
-@@ -3166,8 +3317,11 @@ error_napi_stop:
+@@ -3158,8 +3309,11 @@ error_napi_stop:
                if (!port)
                        continue;
  
@@ -242,7 +242,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
                airoha_metadata_dst_free(port);
        }
        airoha_hw_cleanup(eth);
-@@ -3192,6 +3346,8 @@ static void airoha_remove(struct platfor
+@@ -3184,6 +3338,8 @@ static void airoha_remove(struct platfor
                if (!port)
                        continue;
  
@@ -253,7 +253,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
        }
 --- a/drivers/net/ethernet/airoha/airoha_eth.h
 +++ b/drivers/net/ethernet/airoha/airoha_eth.h
-@@ -540,6 +540,9 @@ struct airoha_gdm_port {
+@@ -542,6 +542,9 @@ struct airoha_gdm_port {
        int id;
        int nbq;
  
index 5c354ad29272bb809818b0d84cfe8f114225427e..b78cc3455fe69578b877831e0b2d8d83448d034d 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
 
 --- a/drivers/net/ethernet/airoha/airoha_eth.c
 +++ b/drivers/net/ethernet/airoha/airoha_eth.c
-@@ -589,6 +589,9 @@ static int airoha_qdma_get_gdm_port(stru
+@@ -585,6 +585,9 @@ static int airoha_qdma_get_gdm_port(stru
        case 0x18:
                port = 3; /* GDM4 */
                break;
index 4d2c003f06b876089d510de571b7f3a7251d8153..c55abcbd34f19c061fd66400f80a678681e6f930 100644 (file)
@@ -28,7 +28,7 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
  
  static void airoha_set_macaddr(struct airoha_gdm_port *port, const u8 *addr)
  {
-@@ -1728,6 +1730,7 @@ static int airoha_dev_open(struct net_de
+@@ -1725,6 +1727,7 @@ static int airoha_dev_open(struct net_de
        struct airoha_qdma *qdma = port->qdma;
        u32 pse_port = FE_PSE_PORT_PPE1;
  
@@ -36,7 +36,7 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
        if (airhoa_is_phy_external(port)) {
                err = phylink_of_phy_connect(port->phylink, dev->dev.of_node, 0);
                if (err) {
-@@ -1738,6 +1741,7 @@ static int airoha_dev_open(struct net_de
+@@ -1735,6 +1738,7 @@ static int airoha_dev_open(struct net_de
  
                phylink_start(port->phylink);
        }
@@ -44,7 +44,7 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
  
        netif_tx_start_all_queues(dev);
        err = airoha_set_vip_for_gdm_port(port, true);
-@@ -1803,10 +1807,12 @@ static int airoha_dev_stop(struct net_de
+@@ -1797,10 +1801,12 @@ static int airoha_dev_stop(struct net_de
                }
        }
  
@@ -57,7 +57,7 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
  
        return 0;
  }
-@@ -2996,6 +3002,7 @@ bool airoha_is_valid_gdm_port(struct air
+@@ -2988,6 +2994,7 @@ bool airoha_is_valid_gdm_port(struct air
        return false;
  }
  
@@ -65,7 +65,7 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
  static void airoha_mac_link_up(struct phylink_config *config, struct phy_device *phy,
                               unsigned int mode, phy_interface_t interface,
                               int speed, int duplex, bool tx_pause, bool rx_pause)
-@@ -3113,6 +3120,7 @@ out:
+@@ -3105,6 +3112,7 @@ out:
  
        return err;
  }
@@ -73,7 +73,7 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
  
  static int airoha_alloc_gdm_port(struct airoha_eth *eth,
                                 struct device_node *np)
-@@ -3187,11 +3195,13 @@ static int airoha_alloc_gdm_port(struct
+@@ -3179,11 +3187,13 @@ static int airoha_alloc_gdm_port(struct
        port->nbq = id == AIROHA_GDM3_IDX && airoha_is_7581(eth) ? 4 : 0;
        eth->ports[p] = port;
  
@@ -87,7 +87,7 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
  
        return airoha_metadata_dst_alloc(port);
  }
-@@ -3321,8 +3331,10 @@ error_napi_stop:
+@@ -3313,8 +3323,10 @@ error_napi_stop:
                        continue;
  
                if (port->dev->reg_state == NETREG_REGISTERED) {
@@ -98,7 +98,7 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
                        unregister_netdev(port->dev);
                }
                airoha_metadata_dst_free(port);
-@@ -3349,8 +3361,10 @@ static void airoha_remove(struct platfor
+@@ -3341,8 +3353,10 @@ static void airoha_remove(struct platfor
                if (!port)
                        continue;
  
@@ -111,7 +111,7 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
        }
 --- a/drivers/net/ethernet/airoha/airoha_eth.h
 +++ b/drivers/net/ethernet/airoha/airoha_eth.h
-@@ -540,8 +540,10 @@ struct airoha_gdm_port {
+@@ -542,8 +542,10 @@ struct airoha_gdm_port {
        int id;
        int nbq;