nat46: Fix PKG_MIRROR_HASH
[openwrt/staging/rmilecki.git] / target / linux / generic / pending-5.4 / 770-14-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Sun, 13 Sep 2020 08:27:24 +0200
3 Subject: [PATCH] net: ethernet: mtk_eth_soc: set PPE flow hash as skb hash
4 if present
5
6 This improves GRO performance
7
8 Signed-off-by: Felix Fietkau <nbd@nbd.name>
9 ---
10
11 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
12 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
13 @@ -1316,6 +1316,10 @@ static int mtk_poll_rx(struct napi_struc
14 skb->protocol = eth_type_trans(skb, netdev);
15 bytes += pktlen;
16
17 + hash = trxd.rxd4 & GENMASK(13, 0);
18 + if (hash != GENMASK(13, 0))
19 + skb_set_hash(skb, hash, PKT_HASH_TYPE_L4);
20 +
21 if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX &&
22 (trxd.rxd2 & RX_DMA_VTAG))
23 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),