kernel: qca-ssdk: update to 12.4.5.r1
[openwrt/staging/nbd.git] / package / kernel / qca-nss-dp / patches / 0014-nss-dp-edma-v1-use-NAPI-GRO-by-default.patch
1 From ae4fe8fb79b68f4cf4a887434ab6a8a9a1c65bfc Mon Sep 17 00:00:00 2001
2 From: Robert Marko <robimarko@gmail.com>
3 Date: Thu, 23 Jun 2022 14:18:50 +0200
4 Subject: [PATCH] nss-dp: edma-v1: use NAPI GRO by default
5
6 Utilize napi_gro_receive instead of plain netif_receive_skb on EDMA v1.
7
8 Usually it provides quite a lot of RX speed improvements, however in some
9 cases it may lead to decreased performance as there is no checksum
10 offloading implemented.
11
12 In cases where reduced performance is experienced its possible to disable
13 GRO by using ethtool.
14
15 Signed-off-by: Robert Marko <robimarko@gmail.com>
16 ---
17 hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c | 10 ++++++----
18 hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c | 8 ++++++--
19 2 files changed, 12 insertions(+), 6 deletions(-)
20
21 --- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
22 +++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
23 @@ -589,10 +589,12 @@ drop:
24 */
25 static void edma_if_set_features(struct nss_dp_data_plane_ctx *dpc)
26 {
27 - /*
28 - * TODO - add flags to support HIGHMEM/cksum offload VLAN
29 - * the features are enabled.
30 - */
31 + struct net_device *netdev = dpc->dev;
32 +
33 + netdev->features |= NETIF_F_GRO;
34 + netdev->hw_features |= NETIF_F_GRO;
35 + netdev->vlan_features |= NETIF_F_GRO;
36 + netdev->wanted_features |= NETIF_F_GRO;
37 }
38
39 /* TODO - check if this is needed */
40 --- a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
41 +++ b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
42 @@ -410,8 +410,12 @@ static uint32_t edma_clean_rx(struct edm
43 if (unlikely(EDMA_RXPH_SERVICE_CODE_GET(rxph) ==
44 NSS_PTP_EVENT_SERVICE_CODE))
45 nss_phy_tstamp_rx_buf(ndev, skb);
46 - else
47 - netif_receive_skb(skb);
48 + else {
49 + if (likely(ndev->features & NETIF_F_GRO))
50 + napi_gro_receive(&ehw->napi, skb);
51 + else
52 + netif_receive_skb(skb);
53 + }
54
55 next_rx_desc:
56 /*