81d708f8ce8bc53d8bf517d0e8b8e91e5f233602
[openwrt/staging/blocktrron.git] /
1 From 09aa788f98da3e2f41ce158cc691d6d52e808bc9 Mon Sep 17 00:00:00 2001
2 From: Lorenzo Bianconi <lorenzo@kernel.org>
3 Date: Wed, 21 May 2025 09:16:37 +0200
4 Subject: [PATCH 1/3] net: airoha: Do not store hfwd references in airoha_qdma
5 struct
6
7 Since hfwd descriptor and buffer queues are allocated via
8 dmam_alloc_coherent() we do not need to store their references
9 in airoha_qdma struct. This patch does not introduce any logical changes,
10 just code clean-up.
11
12 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
13 Reviewed-by: Simon Horman <horms@kernel.org>
14 Link: https://patch.msgid.link/20250521-airopha-desc-sram-v3-2-a6e9b085b4f0@kernel.org
15 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
16 ---
17 drivers/net/ethernet/airoha/airoha_eth.c | 8 ++------
18 drivers/net/ethernet/airoha/airoha_eth.h | 6 ------
19 2 files changed, 2 insertions(+), 12 deletions(-)
20
21 --- a/drivers/net/ethernet/airoha/airoha_eth.c
22 +++ b/drivers/net/ethernet/airoha/airoha_eth.c
23 @@ -1078,17 +1078,13 @@ static int airoha_qdma_init_hfwd_queues(
24 int size;
25
26 size = HW_DSCP_NUM * sizeof(struct airoha_qdma_fwd_desc);
27 - qdma->hfwd.desc = dmam_alloc_coherent(eth->dev, size, &dma_addr,
28 - GFP_KERNEL);
29 - if (!qdma->hfwd.desc)
30 + if (!dmam_alloc_coherent(eth->dev, size, &dma_addr, GFP_KERNEL))
31 return -ENOMEM;
32
33 airoha_qdma_wr(qdma, REG_FWD_DSCP_BASE, dma_addr);
34
35 size = AIROHA_MAX_PACKET_SIZE * HW_DSCP_NUM;
36 - qdma->hfwd.q = dmam_alloc_coherent(eth->dev, size, &dma_addr,
37 - GFP_KERNEL);
38 - if (!qdma->hfwd.q)
39 + if (!dmam_alloc_coherent(eth->dev, size, &dma_addr, GFP_KERNEL))
40 return -ENOMEM;
41
42 airoha_qdma_wr(qdma, REG_FWD_BUF_BASE, dma_addr);
43 --- a/drivers/net/ethernet/airoha/airoha_eth.h
44 +++ b/drivers/net/ethernet/airoha/airoha_eth.h
45 @@ -513,12 +513,6 @@ struct airoha_qdma {
46
47 struct airoha_queue q_tx[AIROHA_NUM_TX_RING];
48 struct airoha_queue q_rx[AIROHA_NUM_RX_RING];
49 -
50 - /* descriptor and packet buffers for qdma hw forward */
51 - struct {
52 - void *desc;
53 - void *q;
54 - } hfwd;
55 };
56
57 struct airoha_gdm_port {