Re: [PATCH net-next v4 1/9] net: free_netdev: exit earlier if dummy

2024-04-09 Thread Jakub Kicinski
On Tue, 9 Apr 2024 05:57:15 -0700 Breno Leitao wrote: > For dummy devices, exit earlier at free_netdev() instead of executing > the whole function. This is necessary, because dummy devices are > special, and shouldn't have the second part of the function executed. > > Otherwise reg_state, which

[PATCH net-next v4 6/9] net: ibm/emac: allocate dummy net_device dynamically

2024-04-09 Thread Breno Leitao
Embedding net_device into structures prohibits the usage of flexible arrays in the net_device structure. For more details, see the discussion at [1]. Un-embed the net_device from the private struct by converting it into a pointer. Then use the leverage the new alloc_netdev_dummy() helper to

[PATCH net-next v4 7/9] wifi: qtnfmac: Use netdev dummy allocator helper

2024-04-09 Thread Breno Leitao
There is a new dummy netdev allocator, use it instead of alloc_netdev()/init_dummy_netdev combination. Using alloc_netdev() with init_dummy_netdev might cause some memory corruption at the driver removal side. Fixes: 61cdb09ff760 ("wifi: qtnfmac: allocate dummy net_device dynamically")

[PATCH net-next v4 8/9] wifi: ath10k: allocate dummy net_device dynamically

2024-04-09 Thread Breno Leitao
Embedding net_device into structures prohibits the usage of flexible arrays in the net_device structure. For more details, see the discussion at [1]. Un-embed the net_device from struct ath10k by converting it into a pointer. Then use the leverage alloc_netdev() to allocate the net_device object

[PATCH net-next v4 9/9] wifi: ath11k: allocate dummy net_device dynamically

2024-04-09 Thread Breno Leitao
Embedding net_device into structures prohibits the usage of flexible arrays in the net_device structure. For more details, see the discussion at [1]. Un-embed the net_device from struct ath11k_ext_irq_grp by converting it into a pointer. Then use the leverage alloc_netdev() to allocate the

[PATCH net-next v4 5/9] net: ipa: allocate dummy net_device dynamically

2024-04-09 Thread Breno Leitao
Embedding net_device into structures prohibits the usage of flexible arrays in the net_device structure. For more details, see the discussion at [1]. Un-embed the net_device from the private struct by converting it into a pointer. Then use the leverage the new alloc_netdev_dummy() helper to

[PATCH net-next v4 4/9] net: mediatek: mtk_eth_sock: allocate dummy net_device dynamically

2024-04-09 Thread Breno Leitao
Embedding net_device into structures prohibits the usage of flexible arrays in the net_device structure. For more details, see the discussion at [1]. Un-embed the net_device from the private struct by converting it into a pointer. Then use the leverage the new alloc_netdev_dummy() helper to

[PATCH net-next v4 2/9] net: create a dummy net_device allocator

2024-04-09 Thread Breno Leitao
It is impossible to use init_dummy_netdev together with alloc_netdev() as the 'setup' argument. This is because alloc_netdev() initializes some fields in the net_device structure, and later init_dummy_netdev() memzero them all. This causes some problems as reported here:

[PATCH net-next v4 0/9] allocate dummy device dynamically

2024-04-09 Thread Breno Leitao
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

[PATCH net-next v4 3/9] net: marvell: prestera: allocate dummy net_device dynamically

2024-04-09 Thread Breno Leitao
Embedding net_device into structures prohibits the usage of flexible arrays in the net_device structure. For more details, see the discussion at [1]. Un-embed the net_device from the private struct by converting it into a pointer. Then use the leverage the new alloc_netdev_dummy() helper to

[PATCH net-next v4 1/9] net: free_netdev: exit earlier if dummy

2024-04-09 Thread Breno Leitao
For dummy devices, exit earlier at free_netdev() instead of executing the whole function. This is necessary, because dummy devices are special, and shouldn't have the second part of the function executed. Otherwise reg_state, which is NETREG_DUMMY for dummy devices, will be overwritten and there

Re: [PATCH 0/3] wifi: Un-embed ath10k and ath11k dummy netdev

2024-04-09 Thread Kalle Valo
Breno Leitao writes: > On Tue, Apr 09, 2024 at 01:03:21PM +0300, Kalle Valo wrote: > >> Breno Leitao writes: >> >> >> > Reading the issue, I am afraid that freeing netdev explicitly >> >> > (free_netdev()) might not be the best approach at the exit path. >> >> > >> >> > I would like to try to

Re: [PATCH 0/3] wifi: Un-embed ath10k and ath11k dummy netdev

2024-04-09 Thread Breno Leitao
On Tue, Apr 09, 2024 at 01:03:21PM +0300, Kalle Valo wrote: > Breno Leitao writes: > > >> > Reading the issue, I am afraid that freeing netdev explicitly > >> > (free_netdev()) might not be the best approach at the exit path. > >> > > >> > I would like to try to leverage the ->needs_free_netdev

Re: [PATCH 0/3] wifi: Un-embed ath10k and ath11k dummy netdev

2024-04-09 Thread Kalle Valo
Breno Leitao writes: >> > Reading the issue, I am afraid that freeing netdev explicitly >> > (free_netdev()) might not be the best approach at the exit path. >> > >> > I would like to try to leverage the ->needs_free_netdev netdev >> > mechanism to do the clean-up, if that makes sense. I've

[kvalo-ath:master] BUILD SUCCESS b36766befd306a606f287b0c0f0e53d994516acb

2024-04-09 Thread kernel test robot
allmodconfig gcc arc allnoconfig gcc arc allyesconfig gcc arc defconfig gcc arc randconfig-001-20240409 gcc arc randconfig-002-20240409 gcc arm