kernel: bump 5.15 to 5.15.153
[openwrt/openwrt.git] / target / linux / generic / backport-5.15 / 706-03-v6.0-net-ethernet-mtk_eth_soc-add-xmit-XDP-support.patch
index f774f9875d9dead0cc6d0172dec0ab52db6b787f..deb06d489265b42e035ed562d7ad2bd9d4a3b0d0 100644 (file)
@@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -988,15 +988,26 @@ static void mtk_tx_unmap(struct mtk_eth
+@@ -987,15 +987,26 @@ static void mtk_tx_unmap(struct mtk_eth
                }
        }
  
@@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  }
  
  static void setup_tx_buf(struct mtk_eth *eth, struct mtk_tx_buf *tx_buf,
-@@ -1013,7 +1024,7 @@ static void setup_tx_buf(struct mtk_eth
+@@ -1012,7 +1023,7 @@ static void setup_tx_buf(struct mtk_eth
                        dma_unmap_addr_set(tx_buf, dma_addr1, mapped_addr);
                        dma_unmap_len_set(tx_buf, dma_len1, size);
                } else {
@@ -58,7 +58,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                        txd->txd1 = mapped_addr;
                        txd->txd2 = TX_DMA_PLEN0(size);
                        dma_unmap_addr_set(tx_buf, dma_addr0, mapped_addr);
-@@ -1189,7 +1200,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1188,7 +1199,7 @@ static int mtk_tx_map(struct sk_buff *sk
                                                    soc->txrx.txd_size);
                        if (new_desc)
                                memset(tx_buf, 0, sizeof(*tx_buf));
@@ -67,7 +67,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                        tx_buf->flags |= MTK_TX_FLAGS_PAGE0;
                        tx_buf->flags |= (!mac->id) ? MTK_TX_FLAGS_FPORT0 :
                                         MTK_TX_FLAGS_FPORT1;
-@@ -1203,7 +1214,8 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1202,7 +1213,8 @@ static int mtk_tx_map(struct sk_buff *sk
        }
  
        /* store skb to cleanup */
@@ -77,7 +77,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        if (!MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
                if (k & 0x1)
-@@ -1415,13 +1427,14 @@ static struct page_pool *mtk_create_page
+@@ -1414,13 +1426,14 @@ static struct page_pool *mtk_create_page
                .pool_size = size,
                .nid = NUMA_NO_NODE,
                .dev = eth->dma_dev,
@@ -93,7 +93,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        pp = page_pool_create(&pp_params);
        if (IS_ERR(pp))
                return pp;
-@@ -1467,6 +1480,122 @@ static void mtk_rx_put_buff(struct mtk_r
+@@ -1466,6 +1479,122 @@ static void mtk_rx_put_buff(struct mtk_r
                skb_free_frag(data);
  }
  
@@ -216,7 +216,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  static u32 mtk_xdp_run(struct mtk_eth *eth, struct mtk_rx_ring *ring,
                       struct xdp_buff *xdp, struct net_device *dev)
  {
-@@ -1495,6 +1624,18 @@ static u32 mtk_xdp_run(struct mtk_eth *e
+@@ -1494,6 +1623,18 @@ static u32 mtk_xdp_run(struct mtk_eth *e
  
                count = &hw_stats->xdp_stats.rx_xdp_redirect;
                goto update_stats;
@@ -235,7 +235,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        default:
                bpf_warn_invalid_xdp_action(act);
                fallthrough;
-@@ -1728,9 +1869,8 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1727,9 +1868,8 @@ static int mtk_poll_tx_qdma(struct mtk_e
  {
        const struct mtk_reg_map *reg_map = eth->soc->reg_map;
        struct mtk_tx_ring *ring = &eth->tx_ring;
@@ -246,7 +246,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        u32 cpu, dma;
  
        cpu = ring->last_free_ptr;
-@@ -1751,15 +1891,21 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1750,15 +1890,21 @@ static int mtk_poll_tx_qdma(struct mtk_e
                if (tx_buf->flags & MTK_TX_FLAGS_FPORT1)
                        mac = 1;
  
@@ -271,7 +271,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                mtk_tx_unmap(eth, tx_buf, true);
  
                ring->last_free = desc;
-@@ -1778,9 +1924,8 @@ static int mtk_poll_tx_pdma(struct mtk_e
+@@ -1777,9 +1923,8 @@ static int mtk_poll_tx_pdma(struct mtk_e
                            unsigned int *done, unsigned int *bytes)
  {
        struct mtk_tx_ring *ring = &eth->tx_ring;
@@ -282,7 +282,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        u32 cpu, dma;
  
        cpu = ring->cpu_idx;
-@@ -1788,14 +1933,18 @@ static int mtk_poll_tx_pdma(struct mtk_e
+@@ -1787,14 +1932,18 @@ static int mtk_poll_tx_pdma(struct mtk_e
  
        while ((cpu != dma) && budget) {
                tx_buf = &ring->buf[cpu];
@@ -304,7 +304,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                }
  
                mtk_tx_unmap(eth, tx_buf, true);
-@@ -3463,6 +3612,7 @@ static const struct net_device_ops mtk_n
+@@ -3462,6 +3611,7 @@ static const struct net_device_ops mtk_n
  #endif
        .ndo_setup_tc           = mtk_eth_setup_tc,
        .ndo_bpf                = mtk_xdp,