netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/5] allocate dummy device dynamically
@ 2024-03-28 23:52 Breno Leitao
  2024-03-28 23:52 ` [PATCH net-next v2 1/5] net: create a dummy net_device allocator Breno Leitao
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Breno Leitao @ 2024-03-28 23:52 UTC (permalink / raw)
  To: aleksander.lobakin, kuba, davem, pabeni, edumazet,
	Matthias Brugger, AngeloGioacchino Del Regno
  Cc: quic_jjohnson, kvalo, leon, dennis.dalessandro, linux-kernel,
	netdev, moderated list:ARM/Mediatek SoC support:Keyword:mediatek,
	moderated list:ARM/Mediatek SoC support:Keyword:mediatek

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-04-03 14:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-28 23:52 [PATCH net-next v2 0/5] allocate dummy device dynamically Breno Leitao
2024-03-28 23:52 ` [PATCH net-next v2 1/5] net: create a dummy net_device allocator Breno Leitao
2024-03-28 23:52 ` [PATCH net-next v2 2/5] net: marvell: prestera: allocate dummy net_device dynamically Breno Leitao
2024-03-29 15:56   ` Jakub Kicinski
2024-03-29 17:21     ` Breno Leitao
2024-03-31  8:54   ` Simon Horman
2024-04-03 14:27     ` Breno Leitao
2024-03-28 23:52 ` [PATCH net-next v2 3/5] net: mediatek: mtk_eth_sock: " Breno Leitao
2024-03-28 23:52 ` [PATCH net-next v2 4/5] net: ipa: " Breno Leitao
2024-04-01 13:56   ` Alex Elder
2024-04-03 13:38     ` Breno Leitao
2024-03-28 23:52 ` [PATCH net-next v2 5/5] net: ibm/emac: " Breno Leitao

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).