mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-22 15:02:32 +00:00
b55d3d6904
Manually rebased generic/hack-5.4/662-remove_pfifo_fast.patch ramips/patches-5.4/0048-asoc-add-mt7620-support.patch All others updated automatically. Compile-tested on: armvirt/64, x86/generic, ath79/generic, ramips/mt7621 Runtime-tested on: armvirt/64, x86/generic, ath79/generic Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
45 lines
1.2 KiB
Diff
45 lines
1.2 KiB
Diff
From: Felix Fietkau <nbd@nbd.name>
|
|
Date: Thu, 27 Aug 2020 09:44:43 +0200
|
|
Subject: [PATCH] net: ethernet: mtk_eth_soc: unmap rx data before calling
|
|
build_skb
|
|
|
|
Since build_skb accesses the data area (for initializing shinfo), dma unmap
|
|
needs to happen before that call
|
|
|
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
---
|
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
@@ -1314,17 +1314,18 @@ static int mtk_poll_rx(struct napi_struc
|
|
goto release_desc;
|
|
}
|
|
|
|
+ dma_unmap_single(eth->dev, trxd.rxd1,
|
|
+ ring->buf_size, DMA_FROM_DEVICE);
|
|
+
|
|
/* receive data */
|
|
skb = build_skb(data, ring->frag_size);
|
|
if (unlikely(!skb)) {
|
|
- skb_free_frag(new_data);
|
|
+ skb_free_frag(data);
|
|
netdev->stats.rx_dropped++;
|
|
- goto release_desc;
|
|
+ goto skip_rx;
|
|
}
|
|
skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN);
|
|
|
|
- dma_unmap_single(eth->dev, trxd.rxd1,
|
|
- ring->buf_size, DMA_FROM_DEVICE);
|
|
pktlen = RX_DMA_GET_PLEN0(trxd.rxd2);
|
|
skb->dev = netdev;
|
|
skb_put(skb, pktlen);
|
|
@@ -1342,6 +1343,7 @@ static int mtk_poll_rx(struct napi_struc
|
|
skb_record_rx_queue(skb, 0);
|
|
napi_gro_receive(napi, skb);
|
|
|
|
+skip_rx:
|
|
ring->data[idx] = new_data;
|
|
rxd->rxd1 = (unsigned int)dma_addr;
|
|
|