Add hardware TCP Large Receive Offload (LRO) support to the airoha_eth driver, leveraging the EN7581/AN7583 SoC's 8 dedicated LRO hardware queues mapped to RX queues 24–31. LRO hw offloading does not support Scatter-Gather (SG) so it is required to increase the page_pool allocation order to 2 for RX queues 24–31 (LRO queues). Performance comparison between GRO and hw LRO has been carried out using a 10Gbps NIC: GRO: ~2.7 Gbps LRO: ~8.1 Gbps Tested-by: Madhur Agrawal <madhur.agrawal@airoha.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://github.com/openwrt/openwrt/pull/23530 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
74 lines
2.6 KiB
Diff
74 lines
2.6 KiB
Diff
From 00272dbf6a52241a21145631f22dc5f03891078b Mon Sep 17 00:00:00 2001
|
|
Message-ID: <00272dbf6a52241a21145631f22dc5f03891078b.1779348625.git.lorenzo@kernel.org>
|
|
In-Reply-To: <e15783f7c987e199ecf80b3d858ed5a86d33c508.1779348625.git.lorenzo@kernel.org>
|
|
References: <e15783f7c987e199ecf80b3d858ed5a86d33c508.1779348625.git.lorenzo@kernel.org>
|
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
|
Date: Fri, 10 Apr 2026 14:47:08 +0200
|
|
Subject: [PATCH 05/13] net: airoha: Move {cpu,fwd}_tx_packets in
|
|
airoha_gdm_dev struct
|
|
|
|
Since now multiple net_devices connected to different QDMA blocks can
|
|
share the same GDM port, cpu_tx_packets and fwd_tx_packets fields can
|
|
be overwritten with the value from a different QDMA block. In order to
|
|
fix the issue move cpu_tx_packets and fwd_tx_packets fields from
|
|
airoha_gdm_port struct to airoha_gdm_dev one.
|
|
|
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
|
---
|
|
drivers/net/ethernet/airoha/airoha_eth.c | 16 +++++++---------
|
|
drivers/net/ethernet/airoha/airoha_eth.h | 7 +++----
|
|
2 files changed, 10 insertions(+), 13 deletions(-)
|
|
|
|
--- a/drivers/net/ethernet/airoha/airoha_eth.c
|
|
+++ b/drivers/net/ethernet/airoha/airoha_eth.c
|
|
@@ -2547,19 +2547,17 @@ static int airoha_qdma_get_tx_ets_stats(
|
|
struct tc_ets_qopt_offload *opt)
|
|
{
|
|
struct airoha_gdm_dev *dev = netdev_priv(netdev);
|
|
- struct airoha_gdm_port *port = dev->port;
|
|
+ struct airoha_qdma *qdma = dev->qdma;
|
|
|
|
- u64 cpu_tx_packets = airoha_qdma_rr(dev->qdma,
|
|
- REG_CNTR_VAL(channel << 1));
|
|
- u64 fwd_tx_packets = airoha_qdma_rr(dev->qdma,
|
|
+ u64 cpu_tx_packets = airoha_qdma_rr(qdma, REG_CNTR_VAL(channel << 1));
|
|
+ u64 fwd_tx_packets = airoha_qdma_rr(qdma,
|
|
REG_CNTR_VAL((channel << 1) + 1));
|
|
- u64 tx_packets = (cpu_tx_packets - port->cpu_tx_packets) +
|
|
- (fwd_tx_packets - port->fwd_tx_packets);
|
|
+ u64 tx_packets = (cpu_tx_packets - dev->cpu_tx_packets) +
|
|
+ (fwd_tx_packets - dev->fwd_tx_packets);
|
|
|
|
_bstats_update(opt->stats.bstats, 0, tx_packets);
|
|
-
|
|
- port->cpu_tx_packets = cpu_tx_packets;
|
|
- port->fwd_tx_packets = fwd_tx_packets;
|
|
+ dev->cpu_tx_packets = cpu_tx_packets;
|
|
+ dev->fwd_tx_packets = fwd_tx_packets;
|
|
|
|
return 0;
|
|
}
|
|
--- a/drivers/net/ethernet/airoha/airoha_eth.h
|
|
+++ b/drivers/net/ethernet/airoha/airoha_eth.h
|
|
@@ -561,6 +561,9 @@ struct airoha_gdm_dev {
|
|
#endif
|
|
|
|
DECLARE_BITMAP(qos_sq_bmap, AIROHA_NUM_QOS_CHANNELS);
|
|
+ /* qos stats counters */
|
|
+ u64 cpu_tx_packets;
|
|
+ u64 fwd_tx_packets;
|
|
};
|
|
|
|
struct airoha_gdm_port {
|
|
@@ -570,10 +573,6 @@ struct airoha_gdm_port {
|
|
|
|
struct airoha_hw_stats stats;
|
|
|
|
- /* qos stats counters */
|
|
- u64 cpu_tx_packets;
|
|
- u64 fwd_tx_packets;
|
|
-
|
|
struct metadata_dst *dsa_meta[AIROHA_MAX_DSA_PORTS];
|
|
};
|
|
|