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
6 Utilize napi_gro_receive instead of plain netif_receive_skb on EDMA v1.
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.
12 In cases where reduced performance is experienced its possible to disable
15 Signed-off-by: Robert Marko <robimarko@gmail.com>
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(-)
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:
25 static void edma_if_set_features(struct nss_dp_data_plane_ctx *dpc)
28 - * TODO - add flags to support HIGHMEM/cksum offload VLAN
29 - * the features are enabled.
31 + struct net_device *netdev = dpc->dev;
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;
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);
47 - netif_receive_skb(skb);
49 + if (likely(ndev->features & NETIF_F_GRO))
50 + napi_gro_receive(&ehw->napi, skb);
52 + netif_receive_skb(skb);