<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/net/netdevsim, branch v5.12-rc8</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>netdevsim: init u64 stats for 32bit hardware</title>
<updated>2021-03-04T22:36:26+00:00</updated>
<author>
<name>Hillf Danton</name>
<email>hdanton@sina.com</email>
</author>
<published>2021-03-04T18:30:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=863a42b289c22df63db62b10fc2c2ffc237e2125'/>
<id>863a42b289c22df63db62b10fc2c2ffc237e2125</id>
<content type='text'>
Init the u64 stats in order to avoid the lockdep prints on the 32bit
hardware like

 INFO: trying to register non-static key.
 the code is fine but needs lockdep annotation.
 turning off the locking correctness validator.
 CPU: 0 PID: 4695 Comm: syz-executor.0 Not tainted 5.11.0-rc5-syzkaller #0
 Hardware name: ARM-Versatile Express
 Backtrace:
 [&lt;826fc5b8&gt;] (dump_backtrace) from [&lt;826fc82c&gt;] (show_stack+0x18/0x1c arch/arm/kernel/traps.c:252)
 [&lt;826fc814&gt;] (show_stack) from [&lt;8270d1f8&gt;] (__dump_stack lib/dump_stack.c:79 [inline])
 [&lt;826fc814&gt;] (show_stack) from [&lt;8270d1f8&gt;] (dump_stack+0xa8/0xc8 lib/dump_stack.c:120)
 [&lt;8270d150&gt;] (dump_stack) from [&lt;802bf9c0&gt;] (assign_lock_key kernel/locking/lockdep.c:935 [inline])
 [&lt;8270d150&gt;] (dump_stack) from [&lt;802bf9c0&gt;] (register_lock_class+0xabc/0xb68 kernel/locking/lockdep.c:1247)
 [&lt;802bef04&gt;] (register_lock_class) from [&lt;802baa2c&gt;] (__lock_acquire+0x84/0x32d4 kernel/locking/lockdep.c:4711)
 [&lt;802ba9a8&gt;] (__lock_acquire) from [&lt;802be840&gt;] (lock_acquire.part.0+0xf0/0x554 kernel/locking/lockdep.c:5442)
 [&lt;802be750&gt;] (lock_acquire.part.0) from [&lt;802bed10&gt;] (lock_acquire+0x6c/0x74 kernel/locking/lockdep.c:5415)
 [&lt;802beca4&gt;] (lock_acquire) from [&lt;81560548&gt;] (seqcount_lockdep_reader_access include/linux/seqlock.h:103 [inline])
 [&lt;802beca4&gt;] (lock_acquire) from [&lt;81560548&gt;] (__u64_stats_fetch_begin include/linux/u64_stats_sync.h:164 [inline])
 [&lt;802beca4&gt;] (lock_acquire) from [&lt;81560548&gt;] (u64_stats_fetch_begin include/linux/u64_stats_sync.h:175 [inline])
 [&lt;802beca4&gt;] (lock_acquire) from [&lt;81560548&gt;] (nsim_get_stats64+0xdc/0xf0 drivers/net/netdevsim/netdev.c:70)
 [&lt;8156046c&gt;] (nsim_get_stats64) from [&lt;81e2efa0&gt;] (dev_get_stats+0x44/0xd0 net/core/dev.c:10405)
 [&lt;81e2ef5c&gt;] (dev_get_stats) from [&lt;81e53204&gt;] (rtnl_fill_stats+0x38/0x120 net/core/rtnetlink.c:1211)
 [&lt;81e531cc&gt;] (rtnl_fill_stats) from [&lt;81e59d58&gt;] (rtnl_fill_ifinfo+0x6d4/0x148c net/core/rtnetlink.c:1783)
 [&lt;81e59684&gt;] (rtnl_fill_ifinfo) from [&lt;81e5ceb4&gt;] (rtmsg_ifinfo_build_skb+0x9c/0x108 net/core/rtnetlink.c:3798)
 [&lt;81e5ce18&gt;] (rtmsg_ifinfo_build_skb) from [&lt;81e5d0ac&gt;] (rtmsg_ifinfo_event net/core/rtnetlink.c:3830 [inline])
 [&lt;81e5ce18&gt;] (rtmsg_ifinfo_build_skb) from [&lt;81e5d0ac&gt;] (rtmsg_ifinfo_event net/core/rtnetlink.c:3821 [inline])
 [&lt;81e5ce18&gt;] (rtmsg_ifinfo_build_skb) from [&lt;81e5d0ac&gt;] (rtmsg_ifinfo+0x44/0x70 net/core/rtnetlink.c:3839)
 [&lt;81e5d068&gt;] (rtmsg_ifinfo) from [&lt;81e45c2c&gt;] (register_netdevice+0x664/0x68c net/core/dev.c:10103)
 [&lt;81e455c8&gt;] (register_netdevice) from [&lt;815608bc&gt;] (nsim_create+0xf8/0x124 drivers/net/netdevsim/netdev.c:317)
 [&lt;815607c4&gt;] (nsim_create) from [&lt;81561184&gt;] (__nsim_dev_port_add+0x108/0x188 drivers/net/netdevsim/dev.c:941)
 [&lt;8156107c&gt;] (__nsim_dev_port_add) from [&lt;815620d8&gt;] (nsim_dev_port_add_all drivers/net/netdevsim/dev.c:990 [inline])
 [&lt;8156107c&gt;] (__nsim_dev_port_add) from [&lt;815620d8&gt;] (nsim_dev_probe+0x5cc/0x750 drivers/net/netdevsim/dev.c:1119)
 [&lt;81561b0c&gt;] (nsim_dev_probe) from [&lt;815661dc&gt;] (nsim_bus_probe+0x10/0x14 drivers/net/netdevsim/bus.c:287)
 [&lt;815661cc&gt;] (nsim_bus_probe) from [&lt;811724c0&gt;] (really_probe+0x100/0x50c drivers/base/dd.c:554)
 [&lt;811723c0&gt;] (really_probe) from [&lt;811729c4&gt;] (driver_probe_device+0xf8/0x1c8 drivers/base/dd.c:740)
 [&lt;811728cc&gt;] (driver_probe_device) from [&lt;81172fe4&gt;] (__device_attach_driver+0x8c/0xf0 drivers/base/dd.c:846)
 [&lt;81172f58&gt;] (__device_attach_driver) from [&lt;8116fee0&gt;] (bus_for_each_drv+0x88/0xd8 drivers/base/bus.c:431)
 [&lt;8116fe58&gt;] (bus_for_each_drv) from [&lt;81172c6c&gt;] (__device_attach+0xdc/0x1d0 drivers/base/dd.c:914)
 [&lt;81172b90&gt;] (__device_attach) from [&lt;8117305c&gt;] (device_initial_probe+0x14/0x18 drivers/base/dd.c:961)
 [&lt;81173048&gt;] (device_initial_probe) from [&lt;81171358&gt;] (bus_probe_device+0x90/0x98 drivers/base/bus.c:491)
 [&lt;811712c8&gt;] (bus_probe_device) from [&lt;8116e77c&gt;] (device_add+0x320/0x824 drivers/base/core.c:3109)
 [&lt;8116e45c&gt;] (device_add) from [&lt;8116ec9c&gt;] (device_register+0x1c/0x20 drivers/base/core.c:3182)
 [&lt;8116ec80&gt;] (device_register) from [&lt;81566710&gt;] (nsim_bus_dev_new drivers/net/netdevsim/bus.c:336 [inline])
 [&lt;8116ec80&gt;] (device_register) from [&lt;81566710&gt;] (new_device_store+0x178/0x208 drivers/net/netdevsim/bus.c:215)
 [&lt;81566598&gt;] (new_device_store) from [&lt;8116fcb4&gt;] (bus_attr_store+0x2c/0x38 drivers/base/bus.c:122)
 [&lt;8116fc88&gt;] (bus_attr_store) from [&lt;805b4b8c&gt;] (sysfs_kf_write+0x48/0x54 fs/sysfs/file.c:139)
 [&lt;805b4b44&gt;] (sysfs_kf_write) from [&lt;805b3c90&gt;] (kernfs_fop_write_iter+0x128/0x1ec fs/kernfs/file.c:296)
 [&lt;805b3b68&gt;] (kernfs_fop_write_iter) from [&lt;804d22fc&gt;] (call_write_iter include/linux/fs.h:1901 [inline])
 [&lt;805b3b68&gt;] (kernfs_fop_write_iter) from [&lt;804d22fc&gt;] (new_sync_write fs/read_write.c:518 [inline])
 [&lt;805b3b68&gt;] (kernfs_fop_write_iter) from [&lt;804d22fc&gt;] (vfs_write+0x3dc/0x57c fs/read_write.c:605)
 [&lt;804d1f20&gt;] (vfs_write) from [&lt;804d2604&gt;] (ksys_write+0x68/0xec fs/read_write.c:658)
 [&lt;804d259c&gt;] (ksys_write) from [&lt;804d2698&gt;] (__do_sys_write fs/read_write.c:670 [inline])
 [&lt;804d259c&gt;] (ksys_write) from [&lt;804d2698&gt;] (sys_write+0x10/0x14 fs/read_write.c:667)
 [&lt;804d2688&gt;] (sys_write) from [&lt;80200060&gt;] (ret_fast_syscall+0x0/0x2c arch/arm/mm/proc-v7.S:64)

Fixes: 83c9e13aa39a ("netdevsim: add software driver for testing offloads")
Reported-by: syzbot+e74a6857f2d0efe3ad81@syzkaller.appspotmail.com
Tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Signed-off-by: Hillf Danton &lt;hdanton@sina.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Init the u64 stats in order to avoid the lockdep prints on the 32bit
hardware like

 INFO: trying to register non-static key.
 the code is fine but needs lockdep annotation.
 turning off the locking correctness validator.
 CPU: 0 PID: 4695 Comm: syz-executor.0 Not tainted 5.11.0-rc5-syzkaller #0
 Hardware name: ARM-Versatile Express
 Backtrace:
 [&lt;826fc5b8&gt;] (dump_backtrace) from [&lt;826fc82c&gt;] (show_stack+0x18/0x1c arch/arm/kernel/traps.c:252)
 [&lt;826fc814&gt;] (show_stack) from [&lt;8270d1f8&gt;] (__dump_stack lib/dump_stack.c:79 [inline])
 [&lt;826fc814&gt;] (show_stack) from [&lt;8270d1f8&gt;] (dump_stack+0xa8/0xc8 lib/dump_stack.c:120)
 [&lt;8270d150&gt;] (dump_stack) from [&lt;802bf9c0&gt;] (assign_lock_key kernel/locking/lockdep.c:935 [inline])
 [&lt;8270d150&gt;] (dump_stack) from [&lt;802bf9c0&gt;] (register_lock_class+0xabc/0xb68 kernel/locking/lockdep.c:1247)
 [&lt;802bef04&gt;] (register_lock_class) from [&lt;802baa2c&gt;] (__lock_acquire+0x84/0x32d4 kernel/locking/lockdep.c:4711)
 [&lt;802ba9a8&gt;] (__lock_acquire) from [&lt;802be840&gt;] (lock_acquire.part.0+0xf0/0x554 kernel/locking/lockdep.c:5442)
 [&lt;802be750&gt;] (lock_acquire.part.0) from [&lt;802bed10&gt;] (lock_acquire+0x6c/0x74 kernel/locking/lockdep.c:5415)
 [&lt;802beca4&gt;] (lock_acquire) from [&lt;81560548&gt;] (seqcount_lockdep_reader_access include/linux/seqlock.h:103 [inline])
 [&lt;802beca4&gt;] (lock_acquire) from [&lt;81560548&gt;] (__u64_stats_fetch_begin include/linux/u64_stats_sync.h:164 [inline])
 [&lt;802beca4&gt;] (lock_acquire) from [&lt;81560548&gt;] (u64_stats_fetch_begin include/linux/u64_stats_sync.h:175 [inline])
 [&lt;802beca4&gt;] (lock_acquire) from [&lt;81560548&gt;] (nsim_get_stats64+0xdc/0xf0 drivers/net/netdevsim/netdev.c:70)
 [&lt;8156046c&gt;] (nsim_get_stats64) from [&lt;81e2efa0&gt;] (dev_get_stats+0x44/0xd0 net/core/dev.c:10405)
 [&lt;81e2ef5c&gt;] (dev_get_stats) from [&lt;81e53204&gt;] (rtnl_fill_stats+0x38/0x120 net/core/rtnetlink.c:1211)
 [&lt;81e531cc&gt;] (rtnl_fill_stats) from [&lt;81e59d58&gt;] (rtnl_fill_ifinfo+0x6d4/0x148c net/core/rtnetlink.c:1783)
 [&lt;81e59684&gt;] (rtnl_fill_ifinfo) from [&lt;81e5ceb4&gt;] (rtmsg_ifinfo_build_skb+0x9c/0x108 net/core/rtnetlink.c:3798)
 [&lt;81e5ce18&gt;] (rtmsg_ifinfo_build_skb) from [&lt;81e5d0ac&gt;] (rtmsg_ifinfo_event net/core/rtnetlink.c:3830 [inline])
 [&lt;81e5ce18&gt;] (rtmsg_ifinfo_build_skb) from [&lt;81e5d0ac&gt;] (rtmsg_ifinfo_event net/core/rtnetlink.c:3821 [inline])
 [&lt;81e5ce18&gt;] (rtmsg_ifinfo_build_skb) from [&lt;81e5d0ac&gt;] (rtmsg_ifinfo+0x44/0x70 net/core/rtnetlink.c:3839)
 [&lt;81e5d068&gt;] (rtmsg_ifinfo) from [&lt;81e45c2c&gt;] (register_netdevice+0x664/0x68c net/core/dev.c:10103)
 [&lt;81e455c8&gt;] (register_netdevice) from [&lt;815608bc&gt;] (nsim_create+0xf8/0x124 drivers/net/netdevsim/netdev.c:317)
 [&lt;815607c4&gt;] (nsim_create) from [&lt;81561184&gt;] (__nsim_dev_port_add+0x108/0x188 drivers/net/netdevsim/dev.c:941)
 [&lt;8156107c&gt;] (__nsim_dev_port_add) from [&lt;815620d8&gt;] (nsim_dev_port_add_all drivers/net/netdevsim/dev.c:990 [inline])
 [&lt;8156107c&gt;] (__nsim_dev_port_add) from [&lt;815620d8&gt;] (nsim_dev_probe+0x5cc/0x750 drivers/net/netdevsim/dev.c:1119)
 [&lt;81561b0c&gt;] (nsim_dev_probe) from [&lt;815661dc&gt;] (nsim_bus_probe+0x10/0x14 drivers/net/netdevsim/bus.c:287)
 [&lt;815661cc&gt;] (nsim_bus_probe) from [&lt;811724c0&gt;] (really_probe+0x100/0x50c drivers/base/dd.c:554)
 [&lt;811723c0&gt;] (really_probe) from [&lt;811729c4&gt;] (driver_probe_device+0xf8/0x1c8 drivers/base/dd.c:740)
 [&lt;811728cc&gt;] (driver_probe_device) from [&lt;81172fe4&gt;] (__device_attach_driver+0x8c/0xf0 drivers/base/dd.c:846)
 [&lt;81172f58&gt;] (__device_attach_driver) from [&lt;8116fee0&gt;] (bus_for_each_drv+0x88/0xd8 drivers/base/bus.c:431)
 [&lt;8116fe58&gt;] (bus_for_each_drv) from [&lt;81172c6c&gt;] (__device_attach+0xdc/0x1d0 drivers/base/dd.c:914)
 [&lt;81172b90&gt;] (__device_attach) from [&lt;8117305c&gt;] (device_initial_probe+0x14/0x18 drivers/base/dd.c:961)
 [&lt;81173048&gt;] (device_initial_probe) from [&lt;81171358&gt;] (bus_probe_device+0x90/0x98 drivers/base/bus.c:491)
 [&lt;811712c8&gt;] (bus_probe_device) from [&lt;8116e77c&gt;] (device_add+0x320/0x824 drivers/base/core.c:3109)
 [&lt;8116e45c&gt;] (device_add) from [&lt;8116ec9c&gt;] (device_register+0x1c/0x20 drivers/base/core.c:3182)
 [&lt;8116ec80&gt;] (device_register) from [&lt;81566710&gt;] (nsim_bus_dev_new drivers/net/netdevsim/bus.c:336 [inline])
 [&lt;8116ec80&gt;] (device_register) from [&lt;81566710&gt;] (new_device_store+0x178/0x208 drivers/net/netdevsim/bus.c:215)
 [&lt;81566598&gt;] (new_device_store) from [&lt;8116fcb4&gt;] (bus_attr_store+0x2c/0x38 drivers/base/bus.c:122)
 [&lt;8116fc88&gt;] (bus_attr_store) from [&lt;805b4b8c&gt;] (sysfs_kf_write+0x48/0x54 fs/sysfs/file.c:139)
 [&lt;805b4b44&gt;] (sysfs_kf_write) from [&lt;805b3c90&gt;] (kernfs_fop_write_iter+0x128/0x1ec fs/kernfs/file.c:296)
 [&lt;805b3b68&gt;] (kernfs_fop_write_iter) from [&lt;804d22fc&gt;] (call_write_iter include/linux/fs.h:1901 [inline])
 [&lt;805b3b68&gt;] (kernfs_fop_write_iter) from [&lt;804d22fc&gt;] (new_sync_write fs/read_write.c:518 [inline])
 [&lt;805b3b68&gt;] (kernfs_fop_write_iter) from [&lt;804d22fc&gt;] (vfs_write+0x3dc/0x57c fs/read_write.c:605)
 [&lt;804d1f20&gt;] (vfs_write) from [&lt;804d2604&gt;] (ksys_write+0x68/0xec fs/read_write.c:658)
 [&lt;804d259c&gt;] (ksys_write) from [&lt;804d2698&gt;] (__do_sys_write fs/read_write.c:670 [inline])
 [&lt;804d259c&gt;] (ksys_write) from [&lt;804d2698&gt;] (sys_write+0x10/0x14 fs/read_write.c:667)
 [&lt;804d2688&gt;] (sys_write) from [&lt;80200060&gt;] (ret_fast_syscall+0x0/0x2c arch/arm/mm/proc-v7.S:64)

Fixes: 83c9e13aa39a ("netdevsim: add software driver for testing offloads")
Reported-by: syzbot+e74a6857f2d0efe3ad81@syzkaller.appspotmail.com
Tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Signed-off-by: Hillf Danton &lt;hdanton@sina.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netdevsim: fib: Add debugfs to debug route offload failure</title>
<updated>2021-02-09T00:47:03+00:00</updated>
<author>
<name>Amit Cohen</name>
<email>amcohen@nvidia.com</email>
</author>
<published>2021-02-07T08:22:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=134c7532424067b3006024c1acc44bd195245622'/>
<id>134c7532424067b3006024c1acc44bd195245622</id>
<content type='text'>
Add "fail_route_offload" flag to disallow offloading routes.
It is needed to test "offload failed" notifications.

Create the flag as part of nsim_fib_create() under fib directory and set
it to false by default.

When FIB_EVENT_ENTRY_{REPLACE, APPEND} are triggered and
"fail_route_offload" value is true, set the appropriate hardware flag to
make the kernel emit RTM_NEWROUTE notification with RTM_F_OFFLOAD_FAILED
flag.

Signed-off-by: Amit Cohen &lt;amcohen@nvidia.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add "fail_route_offload" flag to disallow offloading routes.
It is needed to test "offload failed" notifications.

Create the flag as part of nsim_fib_create() under fib directory and set
it to false by default.

When FIB_EVENT_ENTRY_{REPLACE, APPEND} are triggered and
"fail_route_offload" value is true, set the appropriate hardware flag to
make the kernel emit RTM_NEWROUTE notification with RTM_F_OFFLOAD_FAILED
flag.

Signed-off-by: Amit Cohen &lt;amcohen@nvidia.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netdevsim: dev: Initialize FIB module after debugfs</title>
<updated>2021-02-09T00:47:03+00:00</updated>
<author>
<name>Ido Schimmel</name>
<email>idosch@nvidia.com</email>
</author>
<published>2021-02-07T08:22:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f57ab5b75f7193e194c83616cd104f41c8350f68'/>
<id>f57ab5b75f7193e194c83616cd104f41c8350f68</id>
<content type='text'>
Initialize the dummy FIB offload module after debugfs, so that the FIB
module could create its own directory there.

Signed-off-by: Amit Cohen &lt;amcohen@nvidia.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Initialize the dummy FIB offload module after debugfs, so that the FIB
module could create its own directory there.

Signed-off-by: Amit Cohen &lt;amcohen@nvidia.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netdevsim: fib: Do not warn if route was not found for several events</title>
<updated>2021-02-09T00:47:03+00:00</updated>
<author>
<name>Amit Cohen</name>
<email>amcohen@nvidia.com</email>
</author>
<published>2021-02-07T08:22:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=484a4dfb7558bd3e3139bd9df026f645b07478dd'/>
<id>484a4dfb7558bd3e3139bd9df026f645b07478dd</id>
<content type='text'>
The next patch will add the ability to fail route offload controlled by
debugfs variable called "fail_route_offload".

If we vetoed the addition, we might get a delete or append notification
for a route we do not have. Therefore, do not warn if route was not found.

Signed-off-by: Amit Cohen &lt;amcohen@nvidia.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The next patch will add the ability to fail route offload controlled by
debugfs variable called "fail_route_offload".

If we vetoed the addition, we might get a delete or append notification
for a route we do not have. Therefore, do not warn if route was not found.

Signed-off-by: Amit Cohen &lt;amcohen@nvidia.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IPv6: Add "offload failed" indication to routes</title>
<updated>2021-02-09T00:47:03+00:00</updated>
<author>
<name>Amit Cohen</name>
<email>amcohen@nvidia.com</email>
</author>
<published>2021-02-07T08:22:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0c5fcf9e249ee1d94cf872c99baf9cba7ff9ce27'/>
<id>0c5fcf9e249ee1d94cf872c99baf9cba7ff9ce27</id>
<content type='text'>
After installing a route to the kernel, user space receives an
acknowledgment, which means the route was installed in the kernel, but not
necessarily in hardware.

The asynchronous nature of route installation in hardware can lead to a
routing daemon advertising a route before it was actually installed in
hardware. This can result in packet loss or mis-routed packets until the
route is installed in hardware.

To avoid such cases, previous patch set added the ability to emit
RTM_NEWROUTE notifications whenever RTM_F_OFFLOAD/RTM_F_TRAP flags
are changed, this behavior is controlled by sysctl.

With the above mentioned behavior, it is possible to know from user-space
if the route was offloaded, but if the offload fails there is no indication
to user-space. Following a failure, a routing daemon will wait indefinitely
for a notification that will never come.

This patch adds an "offload_failed" indication to IPv6 routes, so that
users will have better visibility into the offload process.

'struct fib6_info' is extended with new field that indicates if route
offload failed. Note that the new field is added using unused bit and
therefore there is no need to increase struct size.

Signed-off-by: Amit Cohen &lt;amcohen@nvidia.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After installing a route to the kernel, user space receives an
acknowledgment, which means the route was installed in the kernel, but not
necessarily in hardware.

The asynchronous nature of route installation in hardware can lead to a
routing daemon advertising a route before it was actually installed in
hardware. This can result in packet loss or mis-routed packets until the
route is installed in hardware.

To avoid such cases, previous patch set added the ability to emit
RTM_NEWROUTE notifications whenever RTM_F_OFFLOAD/RTM_F_TRAP flags
are changed, this behavior is controlled by sysctl.

With the above mentioned behavior, it is possible to know from user-space
if the route was offloaded, but if the offload fails there is no indication
to user-space. Following a failure, a routing daemon will wait indefinitely
for a notification that will never come.

This patch adds an "offload_failed" indication to IPv6 routes, so that
users will have better visibility into the offload process.

'struct fib6_info' is extended with new field that indicates if route
offload failed. Note that the new field is added using unused bit and
therefore there is no need to increase struct size.

Signed-off-by: Amit Cohen &lt;amcohen@nvidia.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IPv4: Add "offload failed" indication to routes</title>
<updated>2021-02-09T00:47:03+00:00</updated>
<author>
<name>Amit Cohen</name>
<email>amcohen@nvidia.com</email>
</author>
<published>2021-02-07T08:22:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=36c5100e859d93b3436ae24810612b05addb1e89'/>
<id>36c5100e859d93b3436ae24810612b05addb1e89</id>
<content type='text'>
After installing a route to the kernel, user space receives an
acknowledgment, which means the route was installed in the kernel, but not
necessarily in hardware.

The asynchronous nature of route installation in hardware can lead to a
routing daemon advertising a route before it was actually installed in
hardware. This can result in packet loss or mis-routed packets until the
route is installed in hardware.

To avoid such cases, previous patch set added the ability to emit
RTM_NEWROUTE notifications whenever RTM_F_OFFLOAD/RTM_F_TRAP flags
are changed, this behavior is controlled by sysctl.

With the above mentioned behavior, it is possible to know from user-space
if the route was offloaded, but if the offload fails there is no indication
to user-space. Following a failure, a routing daemon will wait indefinitely
for a notification that will never come.

This patch adds an "offload_failed" indication to IPv4 routes, so that
users will have better visibility into the offload process.

'struct fib_alias', and 'struct fib_rt_info' are extended with new field
that indicates if route offload failed. Note that the new field is added
using unused bit and therefore there is no need to increase structs size.

Signed-off-by: Amit Cohen &lt;amcohen@nvidia.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After installing a route to the kernel, user space receives an
acknowledgment, which means the route was installed in the kernel, but not
necessarily in hardware.

The asynchronous nature of route installation in hardware can lead to a
routing daemon advertising a route before it was actually installed in
hardware. This can result in packet loss or mis-routed packets until the
route is installed in hardware.

To avoid such cases, previous patch set added the ability to emit
RTM_NEWROUTE notifications whenever RTM_F_OFFLOAD/RTM_F_TRAP flags
are changed, this behavior is controlled by sysctl.

With the above mentioned behavior, it is possible to know from user-space
if the route was offloaded, but if the offload fails there is no indication
to user-space. Following a failure, a routing daemon will wait indefinitely
for a notification that will never come.

This patch adds an "offload_failed" indication to IPv4 routes, so that
users will have better visibility into the offload process.

'struct fib_alias', and 'struct fib_rt_info' are extended with new field
that indicates if route offload failed. Note that the new field is added
using unused bit and therefore there is no need to increase structs size.

Signed-off-by: Amit Cohen &lt;amcohen@nvidia.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: Do not call fib6_info_hw_flags_set() when IPv6 is disabled</title>
<updated>2021-02-03T01:45:59+00:00</updated>
<author>
<name>Amit Cohen</name>
<email>amcohen@nvidia.com</email>
</author>
<published>2021-02-01T19:47:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=efc42879ec9ea85d5d17019536f2f8c5da455498'/>
<id>efc42879ec9ea85d5d17019536f2f8c5da455498</id>
<content type='text'>
With the next patch mlxsw and netdevsim will fail in compilation if
CONFIG_IPV6 is disabled.

Do not call fib6_info_hw_flags_set() when IPv6 is disabled.

Signed-off-by: Amit Cohen &lt;amcohen@nvidia.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@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>
With the next patch mlxsw and netdevsim will fail in compilation if
CONFIG_IPV6 is disabled.

Do not call fib6_info_hw_flags_set() when IPv6 is disabled.

Signed-off-by: Amit Cohen &lt;amcohen@nvidia.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: Pass 'net' struct as first argument to fib6_info_hw_flags_set()</title>
<updated>2021-02-03T01:45:59+00:00</updated>
<author>
<name>Amit Cohen</name>
<email>amcohen@nvidia.com</email>
</author>
<published>2021-02-01T19:47:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fbaca8f895a6855b0b442227bc21da2d4cf77a01'/>
<id>fbaca8f895a6855b0b442227bc21da2d4cf77a01</id>
<content type='text'>
The next patch will emit notification when hardware flags are changed,
in case that fib_notify_on_flag_change sysctl is set to 1.

To know sysctl values, net struct is needed.
This change is consistent with the IPv4 version, which gets 'net' struct
as its first argument.

Currently, the only callers of this function are mlxsw and netdevsim.
Patch the callers to pass net.

Signed-off-by: Amit Cohen &lt;amcohen@nvidia.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Reviewed-by: David Ahern &lt;dsahern@kernel.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>
The next patch will emit notification when hardware flags are changed,
in case that fib_notify_on_flag_change sysctl is set to 1.

To know sysctl values, net struct is needed.
This change is consistent with the IPv4 version, which gets 'net' struct
as its first argument.

Currently, the only callers of this function are mlxsw and netdevsim.
Patch the callers to pass net.

Signed-off-by: Amit Cohen &lt;amcohen@nvidia.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Reviewed-by: David Ahern &lt;dsahern@kernel.org&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netdevsim: fib: Perform the route programming in a non-atomic context</title>
<updated>2021-02-03T01:45:58+00:00</updated>
<author>
<name>Amit Cohen</name>
<email>amcohen@nvidia.com</email>
</author>
<published>2021-02-01T19:47:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0ae3eb7b4611207e140e9772398b9f88b72d6839'/>
<id>0ae3eb7b4611207e140e9772398b9f88b72d6839</id>
<content type='text'>
Currently, netdevsim implements dummy FIB offload and marks notified
routes with RTM_F_TRAP flag. netdevsim does not defer route notifications
to a work queue because it does not need to program any hardware.

Given that netdevsim's purpose is to both give an example implementation
and allow developers to test their code, align netdevsim to a "real"
hardware device driver like mlxsw and have it also perform the route
"programming" in a non-atomic context.

It will be used to test route flags notifications which will be added in
the next patches.

The following changes are needed when route handling is performed in WQ:
- Handle the accounting in the main context, to be able to return an
  error for adding route when all the routes are used.
  For FIB_EVENT_ENTRY_REPLACE increase the counter before scheduling
  the delayed work, and in case that this event replaces an existing route,
  decrease the counter as part of the delayed work.

- For IPv6, cannot use fen6_info-&gt;rt-&gt;fib6_siblings list because it
  might be changed during handling the delayed work.
  Save an array with the nexthops as part of fib6_event struct, and take
  a reference for each nexthop to prevent them from being freed while
  event is queued.

- Change GFP_ATOMIC allocations to GFP_KERNEL.

- Use single work item that is handling a list of ordered routes.
  Handling routes must be processed in the order they were submitted to
  avoid logical errors that could lead to unexpected failures.

Signed-off-by: Amit Cohen &lt;amcohen@nvidia.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Acked-by: David Ahern &lt;dsahern@kernel.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>
Currently, netdevsim implements dummy FIB offload and marks notified
routes with RTM_F_TRAP flag. netdevsim does not defer route notifications
to a work queue because it does not need to program any hardware.

Given that netdevsim's purpose is to both give an example implementation
and allow developers to test their code, align netdevsim to a "real"
hardware device driver like mlxsw and have it also perform the route
"programming" in a non-atomic context.

It will be used to test route flags notifications which will be added in
the next patches.

The following changes are needed when route handling is performed in WQ:
- Handle the accounting in the main context, to be able to return an
  error for adding route when all the routes are used.
  For FIB_EVENT_ENTRY_REPLACE increase the counter before scheduling
  the delayed work, and in case that this event replaces an existing route,
  decrease the counter as part of the delayed work.

- For IPv6, cannot use fen6_info-&gt;rt-&gt;fib6_siblings list because it
  might be changed during handling the delayed work.
  Save an array with the nexthops as part of fib6_event struct, and take
  a reference for each nexthop to prevent them from being freed while
  event is queued.

- Change GFP_ATOMIC allocations to GFP_KERNEL.

- Use single work item that is handling a list of ordered routes.
  Handling routes must be processed in the order they were submitted to
  avoid logical errors that could lead to unexpected failures.

Signed-off-by: Amit Cohen &lt;amcohen@nvidia.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Acked-by: David Ahern &lt;dsahern@kernel.org&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netdevsim: fib: Convert the current occupancy to an atomic variable</title>
<updated>2021-02-03T01:45:58+00:00</updated>
<author>
<name>Amit Cohen</name>
<email>amcohen@nvidia.com</email>
</author>
<published>2021-02-01T19:47:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9e635a21cae0650a8d1ba200888bd09a51ac4847'/>
<id>9e635a21cae0650a8d1ba200888bd09a51ac4847</id>
<content type='text'>
When route is added/deleted, the appropriate counter is increased/decreased
to maintain number of routes.

User can limit the number of routes and then according to the appropriate
counter, adding more routes than the limitation is forbidden.

Currently, there is one lock which protects hashtable, list and accounting.

Handling the counters will be performed from both atomic context and
non-atomic context, while the hashtable and the list will be used only from
non-atomic context and therefore will be protected by a separate lock.

Protect accounting by using an atomic variable, so lock is not needed.

v2:
* Use atomic64_sub() in nsim_nexthop_account()'s error path

Signed-off-by: Amit Cohen &lt;amcohen@nvidia.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Reviewed-by: David Ahern &lt;dsahern@kernel.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>
When route is added/deleted, the appropriate counter is increased/decreased
to maintain number of routes.

User can limit the number of routes and then according to the appropriate
counter, adding more routes than the limitation is forbidden.

Currently, there is one lock which protects hashtable, list and accounting.

Handling the counters will be performed from both atomic context and
non-atomic context, while the hashtable and the list will be used only from
non-atomic context and therefore will be protected by a separate lock.

Protect accounting by using an atomic variable, so lock is not needed.

v2:
* Use atomic64_sub() in nsim_nexthop_account()'s error path

Signed-off-by: Amit Cohen &lt;amcohen@nvidia.com&gt;
Signed-off-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Reviewed-by: David Ahern &lt;dsahern@kernel.org&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
