[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240328235214.4079063-1-leitao@debian.org>
Date: Thu, 28 Mar 2024 16:52:00 -0700
From: Breno Leitao <leitao@...ian.org>
To: aleksander.lobakin@...el.com,
kuba@...nel.org,
davem@...emloft.net,
pabeni@...hat.com,
edumazet@...gle.com,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
Cc: quic_jjohnson@...cinc.com,
kvalo@...nel.org,
leon@...nel.org,
dennis.dalessandro@...nelisnetworks.com,
linux-kernel@...r.kernel.org,
netdev@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org (moderated list:ARM/Mediatek SoC support:Keyword:mediatek),
linux-mediatek@...ts.infradead.org (moderated list:ARM/Mediatek SoC support:Keyword:mediatek)
Subject: [PATCH net-next v2 0/5] allocate dummy device dynamically
struct net_device shouldn't be embedded into any structure, instead,
the owner should use the private space to embed their state into
net_device.
But, in some cases the net_device is embedded inside the private
structure, which blocks the usage of zero-length arrays inside
net_device.
Create a helper to allocate a dummy device at dynamically runtime, and
move the Ethernet devices to use it, instead of embedding the dummy
device inside the private structure.
This fixes all the network cases except for wireless drivers.
PS: Due to lack of hardware, unfortunately all these patches are
compiled tested only.
---
Changelog:
v1:
* https://lore.kernel.org/all/20240327200809.512867-1-leitao@debian.org/
v2:
* Patch 1: Use a pre-defined name ("dummy#") for the dummy
net_devices.
* Patch 2-5: Added users for the new helper.
Breno Leitao (5):
net: create a dummy net_device allocator
net: marvell: prestera: allocate dummy net_device dynamically
net: mediatek: mtk_eth_sock: allocate dummy net_device dynamically
net: ipa: allocate dummy net_device dynamically
net: ibm/emac: allocate dummy net_device dynamically
drivers/net/ethernet/ibm/emac/mal.c | 13 +++--
drivers/net/ethernet/ibm/emac/mal.h | 2 +-
.../ethernet/marvell/prestera/prestera_rxtx.c | 15 ++++--
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 17 ++++--
drivers/net/ethernet/mediatek/mtk_eth_soc.h | 2 +-
drivers/net/ipa/gsi.c | 12 +++--
drivers/net/ipa/gsi.h | 2 +-
include/linux/netdevice.h | 3 ++
net/core/dev.c | 54 ++++++++++++-------
9 files changed, 85 insertions(+), 35 deletions(-)
--
2.43.0
Powered by blists - more mailing lists