<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/net/netdevsim/dev.c, branch v6.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.3</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2023-01-30T08:37:46Z</updated>
<entry>
<title>devlink: remove devlink features</title>
<updated>2023-01-30T08:37:46Z</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@nvidia.com</email>
</author>
<published>2023-01-27T15:50:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fb8421a94c5613fee86e192bab0892ecb1d56e4c'/>
<id>urn:sha1:fb8421a94c5613fee86e192bab0892ecb1d56e4c</id>
<content type='text'>
Devlink features were introduced to disallow devlink reload calls of
userspace before the devlink was fully initialized. The reason for this
workaround was the fact that devlink reload was originally called
without devlink instance lock held.

However, with recent changes that converted devlink reload to be
performed under devlink instance lock, this is redundant so remove
devlink features entirely.

Note that mlx5 used this to enable devlink reload conditionally only
when device didn't act as multi port slave. Move the multi port check
into mlx5_devlink_reload_down() callback alongside with the other
checks preventing the device from reload in certain states.

Signed-off-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Reviewed-by: Jacob Keller &lt;jacob.e.keller@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>devlink: protect devlink param list by instance lock</title>
<updated>2023-01-27T12:32:02Z</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@nvidia.com</email>
</author>
<published>2023-01-26T07:58:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=075935f0ae0fbbe469a911d685f6cc59de892700'/>
<id>urn:sha1:075935f0ae0fbbe469a911d685f6cc59de892700</id>
<content type='text'>
Commit 1d18bb1a4ddd ("devlink: allow registering parameters after
the instance") as the subject implies introduced possibility to register
devlink params even for already registered devlink instance. This is a
bit problematic, as the consistency or params list was originally
secured by the fact it is static during devlink lifetime. So in order to
protect the params list, take devlink instance lock during the params
operations. Introduce unlocked function variants and use them in drivers
in locked context. Put lock assertions to appropriate places.

Signed-off-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Reviewed-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Reviewed-by: Jacob Keller &lt;jacob.e.keller@intel.com&gt;
Reviewed-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Reviewed-by: Simon Horman &lt;simon.horman@corigine.com&gt;
Tested-by: Simon Horman &lt;simon.horman@corigine.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netdevsim: move devlink registration under the instance lock</title>
<updated>2023-01-06T12:56:19Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2023-01-06T06:34:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=82a3aef2e6af2fdd04d542c83b7a35990d94afc9'/>
<id>urn:sha1:82a3aef2e6af2fdd04d542c83b7a35990d94afc9</id>
<content type='text'>
To prevent races with netdev code accessing free devlink instances
move the registration under the devlink instance lock.
Core now waits for the instance to be registered before accessing it.

Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netdevsim: rename a label</title>
<updated>2023-01-06T12:56:19Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2023-01-06T06:34:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5c5ea1d09fd8aec8319d629df47a581bd19f8f91'/>
<id>urn:sha1:5c5ea1d09fd8aec8319d629df47a581bd19f8f91</id>
<content type='text'>
err_dl_unregister should unregister the devlink instance.
Looks like renaming it was missed in one of the reshufflings.

Reviewed-by: Jacob Keller &lt;jacob.e.keller@intel.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: devlink: let the core report the driver name instead of the drivers</title>
<updated>2022-12-01T05:49:38Z</updated>
<author>
<name>Vincent Mailhol</name>
<email>mailhol.vincent@wanadoo.fr</email>
</author>
<published>2022-11-29T09:51:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=226bf980550627c88549b112ac6c8fb40873afb4'/>
<id>urn:sha1:226bf980550627c88549b112ac6c8fb40873afb4</id>
<content type='text'>
The driver name is available in device_driver::name. Right now,
drivers still have to report this piece of information themselves in
their devlink_ops::info_get callback function.

In order to factorize code, make devlink_nl_info_fill() add the driver
name attribute.

Now that the core sets the driver name attribute, drivers are not
supposed to call devlink_info_driver_name_put() anymore. Remove
devlink_info_driver_name_put() and clean-up all the drivers using this
function in their callback.

Signed-off-by: Vincent Mailhol &lt;mailhol.vincent@wanadoo.fr&gt;
Tested-by: Ido Schimmel &lt;idosch@nvidia.com&gt; # mlxsw
Reviewed-by: Jacob Keller  &lt;jacob.e.keller@intel.com&gt;
Reviewed-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>devlink: Allow to set up parent in devl_rate_leaf_create()</title>
<updated>2022-11-18T05:41:27Z</updated>
<author>
<name>Michal Wilczynski</name>
<email>michal.wilczynski@intel.com</email>
</author>
<published>2022-11-15T10:48:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f2fc15e271f2d17f2bee2c5a3b3e50252a7ba91f'/>
<id>urn:sha1:f2fc15e271f2d17f2bee2c5a3b3e50252a7ba91f</id>
<content type='text'>
Currently the driver is able to create leaf nodes for the devlink-rate,
but is unable to set parent for them. This wasn't as issue before the
possibility to export hierarchy from the driver. After adding the export
feature, in order for the driver to supply correct hierarchy, it's
necessary for it to be able to supply a parent name to
devl_rate_leaf_create().

Introduce a new parameter 'parent_name' in devl_rate_leaf_create().

Signed-off-by: Michal Wilczynski &lt;michal.wilczynski@intel.com&gt;
Reviewed-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net</title>
<updated>2022-11-18T02:30:39Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2022-11-18T00:19:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=224b744abf9f0663ca6762a79c7298b663fa4f04'/>
<id>urn:sha1:224b744abf9f0663ca6762a79c7298b663fa4f04</id>
<content type='text'>
include/linux/bpf.h
  1f6e04a1c7b8 ("bpf: Fix offset calculation error in __copy_map_value and zero_map_value")
  aa3496accc41 ("bpf: Refactor kptr_off_tab into btf_record")
  f71b2f64177a ("bpf: Refactor map-&gt;off_arr handling")
https://lore.kernel.org/all/20221114095000.67a73239@canb.auug.org.au/

Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>netdevsim: Fix memory leak of nsim_dev-&gt;fa_cookie</title>
<updated>2022-11-16T20:20:57Z</updated>
<author>
<name>Wang Yufen</name>
<email>wangyufen@huawei.com</email>
</author>
<published>2022-11-15T09:30:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=064bc7312bd09a48798418663090be0c776183db'/>
<id>urn:sha1:064bc7312bd09a48798418663090be0c776183db</id>
<content type='text'>
kmemleak reports this issue:

unreferenced object 0xffff8881bac872d0 (size 8):
  comm "sh", pid 58603, jiffies 4481524462 (age 68.065s)
  hex dump (first 8 bytes):
    04 00 00 00 de ad be ef                          ........
  backtrace:
    [&lt;00000000c80b8577&gt;] __kmalloc+0x49/0x150
    [&lt;000000005292b8c6&gt;] nsim_dev_trap_fa_cookie_write+0xc1/0x210 [netdevsim]
    [&lt;0000000093d78e77&gt;] full_proxy_write+0xf3/0x180
    [&lt;000000005a662c16&gt;] vfs_write+0x1c5/0xaf0
    [&lt;000000007aabf84a&gt;] ksys_write+0xed/0x1c0
    [&lt;000000005f1d2e47&gt;] do_syscall_64+0x3b/0x90
    [&lt;000000006001c6ec&gt;] entry_SYSCALL_64_after_hwframe+0x63/0xcd

The issue occurs in the following scenarios:

nsim_dev_trap_fa_cookie_write()
  kmalloc() fa_cookie
  nsim_dev-&gt;fa_cookie = fa_cookie
..
nsim_drv_remove()

The fa_cookie allocked in nsim_dev_trap_fa_cookie_write() is not freed. To
fix, add kfree(nsim_dev-&gt;fa_cookie) to nsim_drv_remove().

Fixes: d3cbb907ae57 ("netdevsim: add ACL trap reporting cookie as a metadata")
Signed-off-by: Wang Yufen &lt;wangyufen@huawei.com&gt;
Cc: Jiri Pirko &lt;jiri@mellanox.com&gt;
Link: https://lore.kernel.org/r/1668504625-14698-1-git-send-email-wangyufen@huawei.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: make drivers to use SET_NETDEV_DEVLINK_PORT to set devlink_port</title>
<updated>2022-11-04T03:48:34Z</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@nvidia.com</email>
</author>
<published>2022-11-02T16:02:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ac73d4bf2cdaf2cb8a43df8ee4a5c066d2c5d7b4'/>
<id>urn:sha1:ac73d4bf2cdaf2cb8a43df8ee4a5c066d2c5d7b4</id>
<content type='text'>
Benefit from the previously implemented tracking of netdev events in
devlink code and instead of calling  devlink_port_type_eth_set() and
devlink_port_type_clear() to set devlink port type and link to related
netdev, use SET_NETDEV_DEVLINK_PORT() macro to assign devlink_port
pointer to netdevice which is about to be registered.

Signed-off-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>netdevsim: remove dir in nsim_dev_debugfs_init() when creating ports dir failed</title>
<updated>2022-10-27T17:47:29Z</updated>
<author>
<name>Zhengchao Shao</name>
<email>shaozhengchao@huawei.com</email>
</author>
<published>2022-10-26T01:46:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a6aa8d0ce2cfba57ac0f23293fcb3be0b9f53fba'/>
<id>urn:sha1:a6aa8d0ce2cfba57ac0f23293fcb3be0b9f53fba</id>
<content type='text'>
Remove dir in nsim_dev_debugfs_init() when creating ports dir failed.
Otherwise, the netdevsim device will not be created next time. Kernel
reports an error: debugfs: Directory 'netdevsim1' with parent 'netdevsim'
already present!

Fixes: ab1d0cc004d7 ("netdevsim: change debugfs tree topology")
Signed-off-by: Zhengchao Shao &lt;shaozhengchao@huawei.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
</feed>
