From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Lorenzo Bianconi <lorenzo@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, netdev@vger.kernel.org
Subject: [PATCH net-next 2/2] net: airoha: Reorganize airoha_queue struct
Date: Mon, 03 Nov 2025 11:27:56 +0100 [thread overview]
Message-ID: <20251103-airoha-tx-linked-list-v1-2-baa07982cc30@kernel.org> (raw)
In-Reply-To: <20251103-airoha-tx-linked-list-v1-0-baa07982cc30@kernel.org>
Do not allocate memory for rx-only fields for hw tx queues and for tx-only
fields for hw rx queues.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/ethernet/airoha/airoha_eth.h | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/airoha/airoha_eth.h b/drivers/net/ethernet/airoha/airoha_eth.h
index fbbc58133364baefafed30299ca0626c686b668e..750dd3e5dfecb5d3d0ff754f6a92ffa000db3343 100644
--- a/drivers/net/ethernet/airoha/airoha_eth.h
+++ b/drivers/net/ethernet/airoha/airoha_eth.h
@@ -185,19 +185,27 @@ struct airoha_queue {
spinlock_t lock;
struct airoha_queue_entry *entry;
struct airoha_qdma_desc *desc;
- u16 head;
- u16 tail;
int queued;
int ndesc;
- int free_thr;
- int buf_size;
struct napi_struct napi;
- struct page_pool *page_pool;
- struct sk_buff *skb;
- struct list_head tx_list;
+ union {
+ struct { /* rx */
+ u16 head;
+ u16 tail;
+ int buf_size;
+
+ struct page_pool *page_pool;
+ struct sk_buff *skb;
+ };
+
+ struct { /* tx */
+ struct list_head tx_list;
+ int free_thr;
+ };
+ };
};
struct airoha_tx_irq_queue {
--
2.51.1
next prev parent reply other threads:[~2025-11-03 10:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-03 10:27 [PATCH net-next 0/2] net: airoha: Allow mapping out-of-order DMA tx descriptors Lorenzo Bianconi
2025-11-03 10:27 ` [PATCH net-next 1/2] net: airoha: Add the capability to consume " Lorenzo Bianconi
2025-11-03 23:32 ` Jacob Keller
2025-11-05 2:30 ` Jakub Kicinski
2025-11-05 8:18 ` Lorenzo Bianconi
2025-11-03 10:27 ` Lorenzo Bianconi [this message]
2025-11-03 23:36 ` [PATCH net-next 2/2] net: airoha: Reorganize airoha_queue struct Jacob Keller
2025-11-05 2:32 ` Jakub Kicinski
2025-11-05 7:53 ` Lorenzo Bianconi
2025-11-06 0:28 ` Jakub Kicinski
2025-11-06 8:27 ` Lorenzo Bianconi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251103-airoha-tx-linked-list-v1-2-baa07982cc30@kernel.org \
--to=lorenzo@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).