<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/net/netdevsim, branch v6.2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>xfrm: allow state packet offload mode</title>
<updated>2022-12-05T09:32:44+00:00</updated>
<author>
<name>Leon Romanovsky</name>
<email>leonro@nvidia.com</email>
</author>
<published>2022-12-02T18:41:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=62f6eca5de103c6823f6ca2abbf2ee242e132207'/>
<id>62f6eca5de103c6823f6ca2abbf2ee242e132207</id>
<content type='text'>
Allow users to configure xfrm states with packet offload mode.
The packet mode must be requested both for policy and state, and
such requires us to do not implement fallback.

We explicitly return an error if requested packet mode can't
be configured.

Reviewed-by: Raed Salem &lt;raeds@nvidia.com&gt;
Signed-off-by: Leon Romanovsky &lt;leonro@nvidia.com&gt;
Signed-off-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allow users to configure xfrm states with packet offload mode.
The packet mode must be requested both for policy and state, and
such requires us to do not implement fallback.

We explicitly return an error if requested packet mode can't
be configured.

Reviewed-by: Raed Salem &lt;raeds@nvidia.com&gt;
Signed-off-by: Leon Romanovsky &lt;leonro@nvidia.com&gt;
Signed-off-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: devlink: let the core report the driver name instead of the drivers</title>
<updated>2022-12-01T05:49:38+00:00</updated>
<author>
<name>Vincent Mailhol</name>
<email>mailhol.vincent@wanadoo.fr</email>
</author>
<published>2022-11-29T09:51:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=226bf980550627c88549b112ac6c8fb40873afb4'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>devlink: Allow to set up parent in devl_rate_leaf_create()</title>
<updated>2022-11-18T05:41:27+00:00</updated>
<author>
<name>Michal Wilczynski</name>
<email>michal.wilczynski@intel.com</email>
</author>
<published>2022-11-15T10:48:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=f2fc15e271f2d17f2bee2c5a3b3e50252a7ba91f'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net</title>
<updated>2022-11-18T02:30:39+00:00</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2022-11-18T00:19:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=224b744abf9f0663ca6762a79c7298b663fa4f04'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>netdevsim: Fix memory leak of nsim_dev-&gt;fa_cookie</title>
<updated>2022-11-16T20:20:57+00:00</updated>
<author>
<name>Wang Yufen</name>
<email>wangyufen@huawei.com</email>
</author>
<published>2022-11-15T09:30:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=064bc7312bd09a48798418663090be0c776183db'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: remove unused ndo_get_devlink_port</title>
<updated>2022-11-04T03:48:36+00:00</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@nvidia.com</email>
</author>
<published>2022-11-02T16:02:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=77df1db80da384c565106321f5934967690da7dd'/>
<id>77df1db80da384c565106321f5934967690da7dd</id>
<content type='text'>
Remove ndo_get_devlink_port which is no longer used alongside with the
implementations in drivers.

Signed-off-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove ndo_get_devlink_port which is no longer used alongside with the
implementations in drivers.

Signed-off-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: make drivers to use SET_NETDEV_DEVLINK_PORT to set devlink_port</title>
<updated>2022-11-04T03:48:34+00:00</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@nvidia.com</email>
</author>
<published>2022-11-02T16:02:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ac73d4bf2cdaf2cb8a43df8ee4a5c066d2c5d7b4'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: Remove the obsolte u64_stats_fetch_*_irq() users (drivers).</title>
<updated>2022-10-29T03:13:54+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2022-10-26T13:22:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=068c38ad88ccb09e5e966d4db5cedab0e02b3b95'/>
<id>068c38ad88ccb09e5e966d4db5cedab0e02b3b95</id>
<content type='text'>
Now that the 32bit UP oddity is gone and 32bit uses always a sequence
count, there is no need for the fetch_irq() variants anymore.

Convert to the regular interface.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that the 32bit UP oddity is gone and 32bit uses always a sequence
count, there is no need for the fetch_irq() variants anymore.

Convert to the regular interface.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netdevsim: remove dir in nsim_dev_debugfs_init() when creating ports dir failed</title>
<updated>2022-10-27T17:47:29+00:00</updated>
<author>
<name>Zhengchao Shao</name>
<email>shaozhengchao@huawei.com</email>
</author>
<published>2022-10-26T01:46:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a6aa8d0ce2cfba57ac0f23293fcb3be0b9f53fba'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>netdevsim: fix memory leak in nsim_drv_probe() when nsim_dev_resources_register() failed</title>
<updated>2022-10-27T17:47:24+00:00</updated>
<author>
<name>Zhengchao Shao</name>
<email>shaozhengchao@huawei.com</email>
</author>
<published>2022-10-26T01:46:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6b1da9f7126f05e857da6db24c6a04aa7974d644'/>
<id>6b1da9f7126f05e857da6db24c6a04aa7974d644</id>
<content type='text'>
If some items in nsim_dev_resources_register() fail, memory leak will
occur. The following is the memory leak information.

unreferenced object 0xffff888074c02600 (size 128):
  comm "echo", pid 8159, jiffies 4294945184 (age 493.530s)
  hex dump (first 32 bytes):
    40 47 ea 89 ff ff ff ff 01 00 00 00 00 00 00 00  @G..............
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
  backtrace:
    [&lt;0000000011a31c98&gt;] kmalloc_trace+0x22/0x60
    [&lt;0000000027384c69&gt;] devl_resource_register+0x144/0x4e0
    [&lt;00000000a16db248&gt;] nsim_drv_probe+0x37a/0x1260
    [&lt;000000007d1f448c&gt;] really_probe+0x20b/0xb10
    [&lt;00000000c416848a&gt;] __driver_probe_device+0x1b3/0x4a0
    [&lt;00000000077e0351&gt;] driver_probe_device+0x49/0x140
    [&lt;0000000054f2465a&gt;] __device_attach_driver+0x18c/0x2a0
    [&lt;000000008538f359&gt;] bus_for_each_drv+0x151/0x1d0
    [&lt;0000000038e09747&gt;] __device_attach+0x1c9/0x4e0
    [&lt;00000000dd86e533&gt;] bus_probe_device+0x1d5/0x280
    [&lt;00000000839bea35&gt;] device_add+0xae0/0x1cb0
    [&lt;000000009c2abf46&gt;] new_device_store+0x3b6/0x5f0
    [&lt;00000000fb823d7f&gt;] bus_attr_store+0x72/0xa0
    [&lt;000000007acc4295&gt;] sysfs_kf_write+0x106/0x160
    [&lt;000000005f50cb4d&gt;] kernfs_fop_write_iter+0x3a8/0x5a0
    [&lt;0000000075eb41bf&gt;] vfs_write+0x8f0/0xc80

Fixes: 37923ed6b8ce ("netdevsim: Add simple FIB resource controller via devlink")
Signed-off-by: Zhengchao Shao &lt;shaozhengchao@huawei.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If some items in nsim_dev_resources_register() fail, memory leak will
occur. The following is the memory leak information.

unreferenced object 0xffff888074c02600 (size 128):
  comm "echo", pid 8159, jiffies 4294945184 (age 493.530s)
  hex dump (first 32 bytes):
    40 47 ea 89 ff ff ff ff 01 00 00 00 00 00 00 00  @G..............
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
  backtrace:
    [&lt;0000000011a31c98&gt;] kmalloc_trace+0x22/0x60
    [&lt;0000000027384c69&gt;] devl_resource_register+0x144/0x4e0
    [&lt;00000000a16db248&gt;] nsim_drv_probe+0x37a/0x1260
    [&lt;000000007d1f448c&gt;] really_probe+0x20b/0xb10
    [&lt;00000000c416848a&gt;] __driver_probe_device+0x1b3/0x4a0
    [&lt;00000000077e0351&gt;] driver_probe_device+0x49/0x140
    [&lt;0000000054f2465a&gt;] __device_attach_driver+0x18c/0x2a0
    [&lt;000000008538f359&gt;] bus_for_each_drv+0x151/0x1d0
    [&lt;0000000038e09747&gt;] __device_attach+0x1c9/0x4e0
    [&lt;00000000dd86e533&gt;] bus_probe_device+0x1d5/0x280
    [&lt;00000000839bea35&gt;] device_add+0xae0/0x1cb0
    [&lt;000000009c2abf46&gt;] new_device_store+0x3b6/0x5f0
    [&lt;00000000fb823d7f&gt;] bus_attr_store+0x72/0xa0
    [&lt;000000007acc4295&gt;] sysfs_kf_write+0x106/0x160
    [&lt;000000005f50cb4d&gt;] kernfs_fop_write_iter+0x3a8/0x5a0
    [&lt;0000000075eb41bf&gt;] vfs_write+0x8f0/0xc80

Fixes: 37923ed6b8ce ("netdevsim: Add simple FIB resource controller via devlink")
Signed-off-by: Zhengchao Shao &lt;shaozhengchao@huawei.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
