lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251103-airoha-tx-linked-list-v1-2-baa07982cc30@kernel.org>
Date: Mon, 03 Nov 2025 11:27:56 +0100
From: Lorenzo Bianconi <lorenzo@...nel.org>
To: Andrew Lunn <andrew+netdev@...n.ch>, 
 "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, 
 Lorenzo Bianconi <lorenzo@...nel.org>
Cc: linux-arm-kernel@...ts.infradead.org, 
 linux-mediatek@...ts.infradead.org, netdev@...r.kernel.org
Subject: [PATCH net-next 2/2] net: airoha: Reorganize airoha_queue struct

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@...nel.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ