Commit 6804d23
Izabela Bakollari
net: create a dummy net_device allocator
JIRA: https://issues.redhat.com/browse/RHEL-59092
commit c661050
Author: Breno Leitao <leitao@debian.org>
Date: Mon Apr 22 05:38:56 2024 -0700
net: create a dummy net_device allocator
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:
https://lore.kernel.org/all/20240322082336.49f110cc@kernel.org/
Split the init_dummy_netdev() function in two. Create a new function called
init_dummy_netdev_core() that does not memzero the net_device structure.
Then have init_dummy_netdev() memzero-ing and calling
init_dummy_netdev_core(), keeping the old behaviour.
init_dummy_netdev_core() is the new function that could be called as an
argument for alloc_netdev().
Also, create a helper to allocate and initialize dummy net devices,
leveraging init_dummy_netdev_core() as the setup argument. This function
basically simplify the allocation of dummy devices, by allocating and
initializing it. Freeing the device continue to be done through
free_netdev()
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>1 parent b5e1871 commit 6804d23
2 files changed
+41
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4580 | 4580 | | |
4581 | 4581 | | |
4582 | 4582 | | |
| 4583 | + | |
| 4584 | + | |
| 4585 | + | |
4583 | 4586 | | |
4584 | 4587 | | |
4585 | 4588 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10149 | 10149 | | |
10150 | 10150 | | |
10151 | 10151 | | |
10152 | | - | |
10153 | | - | |
10154 | | - | |
10155 | | - | |
10156 | | - | |
10157 | | - | |
10158 | | - | |
10159 | | - | |
10160 | | - | |
| 10152 | + | |
| 10153 | + | |
| 10154 | + | |
10161 | 10155 | | |
10162 | | - | |
| 10156 | + | |
10163 | 10157 | | |
10164 | | - | |
10165 | | - | |
10166 | | - | |
10167 | | - | |
10168 | | - | |
10169 | | - | |
10170 | | - | |
10171 | 10158 | | |
10172 | 10159 | | |
10173 | 10160 | | |
| |||
10188 | 10175 | | |
10189 | 10176 | | |
10190 | 10177 | | |
10191 | | - | |
10192 | 10178 | | |
| 10179 | + | |
| 10180 | + | |
| 10181 | + | |
| 10182 | + | |
| 10183 | + | |
| 10184 | + | |
| 10185 | + | |
| 10186 | + | |
| 10187 | + | |
| 10188 | + | |
| 10189 | + | |
| 10190 | + | |
| 10191 | + | |
| 10192 | + | |
| 10193 | + | |
| 10194 | + | |
| 10195 | + | |
| 10196 | + | |
| 10197 | + | |
| 10198 | + | |
| 10199 | + | |
10193 | 10200 | | |
10194 | 10201 | | |
10195 | 10202 | | |
| |||
10779 | 10786 | | |
10780 | 10787 | | |
10781 | 10788 | | |
| 10789 | + | |
| 10790 | + | |
| 10791 | + | |
| 10792 | + | |
| 10793 | + | |
| 10794 | + | |
| 10795 | + | |
| 10796 | + | |
| 10797 | + | |
| 10798 | + | |
| 10799 | + | |
| 10800 | + | |
| 10801 | + | |
10782 | 10802 | | |
10783 | 10803 | | |
10784 | 10804 | | |
| |||
0 commit comments