--- 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
}
}
}
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 {
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));
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 */
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,
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);
}
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;
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 = ð->tx_ring;
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;
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 = ð->tx_ring;
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];
}
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,