<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/net/netdevsim/netdev.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-02-03T04:48:23Z</updated>
<entry>
<title>drivers: net: turn on XDP features</title>
<updated>2023-02-03T04:48:23Z</updated>
<author>
<name>Marek Majtyka</name>
<email>alardam@gmail.com</email>
</author>
<published>2023-02-01T10:24:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=66c0e13ad236c74ea88c7c1518f3cef7f372e3da'/>
<id>urn:sha1:66c0e13ad236c74ea88c7c1518f3cef7f372e3da</id>
<content type='text'>
A summary of the flags being set for various drivers is given below.
Note that XDP_F_REDIRECT_TARGET and XDP_F_FRAG_TARGET are features
that can be turned off and on at runtime. This means that these flags
may be set and unset under RTNL lock protection by the driver. Hence,
READ_ONCE must be used by code loading the flag value.

Also, these flags are not used for synchronization against the availability
of XDP resources on a device. It is merely a hint, and hence the read
may race with the actual teardown of XDP resources on the device. This
may change in the future, e.g. operations taking a reference on the XDP
resources of the driver, and in turn inhibiting turning off this flag.
However, for now, it can only be used as a hint to check whether device
supports becoming a redirection target.

Turn 'hw-offload' feature flag on for:
 - netronome (nfp)
 - netdevsim.

Turn 'native' and 'zerocopy' features flags on for:
 - intel (i40e, ice, ixgbe, igc)
 - mellanox (mlx5).
 - stmmac
 - netronome (nfp)

Turn 'native' features flags on for:
 - amazon (ena)
 - broadcom (bnxt)
 - freescale (dpaa, dpaa2, enetc)
 - funeth
 - intel (igb)
 - marvell (mvneta, mvpp2, octeontx2)
 - mellanox (mlx4)
 - mtk_eth_soc
 - qlogic (qede)
 - sfc
 - socionext (netsec)
 - ti (cpsw)
 - tap
 - tsnep
 - veth
 - xen
 - virtio_net.

Turn 'basic' (tx, pass, aborted and drop) features flags on for:
 - netronome (nfp)
 - cavium (thunder)
 - hyperv.

Turn 'redirect_target' feature flag on for:
 - amanzon (ena)
 - broadcom (bnxt)
 - freescale (dpaa, dpaa2)
 - intel (i40e, ice, igb, ixgbe)
 - ti (cpsw)
 - marvell (mvneta, mvpp2)
 - sfc
 - socionext (netsec)
 - qlogic (qede)
 - mellanox (mlx5)
 - tap
 - veth
 - virtio_net
 - xen

Reviewed-by: Gerhard Engleder &lt;gerhard@engleder-embedded.com&gt;
Reviewed-by: Simon Horman &lt;simon.horman@corigine.com&gt;
Acked-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Acked-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Co-developed-by: Kumar Kartikeya Dwivedi &lt;memxor@gmail.com&gt;
Signed-off-by: Kumar Kartikeya Dwivedi &lt;memxor@gmail.com&gt;
Co-developed-by: Lorenzo Bianconi &lt;lorenzo@kernel.org&gt;
Signed-off-by: Lorenzo Bianconi &lt;lorenzo@kernel.org&gt;
Signed-off-by: Marek Majtyka &lt;alardam@gmail.com&gt;
Link: https://lore.kernel.org/r/3eca9fafb308462f7edb1f58e451d59209aa07eb.1675245258.git.lorenzo@kernel.org
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: remove unused ndo_get_devlink_port</title>
<updated>2022-11-04T03:48:36Z</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@nvidia.com</email>
</author>
<published>2022-11-02T16:02:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=77df1db80da384c565106321f5934967690da7dd'/>
<id>urn:sha1: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>
</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>net: Remove the obsolte u64_stats_fetch_*_irq() users (drivers).</title>
<updated>2022-10-29T03:13:54Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2022-10-26T13:22:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=068c38ad88ccb09e5e966d4db5cedab0e02b3b95'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>net: Use u64_stats_fetch_begin_irq() for stats fetch.</title>
<updated>2022-08-29T12:02:27Z</updated>
<author>
<name>Sebastian Andrzej Siewior</name>
<email>bigeasy@linutronix.de</email>
</author>
<published>2022-08-25T11:36:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=278d3ba61563ceed3cb248383ced19e14ec7bc1f'/>
<id>urn:sha1:278d3ba61563ceed3cb248383ced19e14ec7bc1f</id>
<content type='text'>
On 32bit-UP u64_stats_fetch_begin() disables only preemption. If the
reader is in preemptible context and the writer side
(u64_stats_update_begin*()) runs in an interrupt context (IRQ or
softirq) then the writer can update the stats during the read operation.
This update remains undetected.

Use u64_stats_fetch_begin_irq() to ensure the stats fetch on 32bit-UP
are not interrupted by a writer. 32bit-SMP remains unaffected by this
change.

Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Catherine Sullivan &lt;csully@google.com&gt;
Cc: David Awogbemila &lt;awogbemila@google.com&gt;
Cc: Dimitris Michailidis &lt;dmichail@fungible.com&gt;
Cc: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Hans Ulli Kroll &lt;ulli.kroll@googlemail.com&gt;
Cc: Jakub Kicinski &lt;kuba@kernel.org&gt;
Cc: Jeroen de Borst &lt;jeroendb@google.com&gt;
Cc: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Cc: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: Paolo Abeni &lt;pabeni@redhat.com&gt;
Cc: Simon Horman &lt;simon.horman@corigine.com&gt;
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: oss-drivers@corigine.com
Cc: stable@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Reviewed-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 vfconfig to nsim_dev</title>
<updated>2021-11-01T13:29:41Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2021-10-30T23:15:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5e388f3dc38c72da2880549e68374c3b6ba7c589'/>
<id>urn:sha1:5e388f3dc38c72da2880549e68374c3b6ba7c589</id>
<content type='text'>
When netdevsim got split into the faux bus vfconfig ended
up in the bus device (think pci_dev) which is strange because
it contains very networky not to say netdevy information.
Move it to nsim_dev, which is the driver "priv" structure
for the device.

To make sure we don't race with probe/remove take
the device lock (much like PCI).

While at it remove the NULL-checking of vfconfigs.
It appears to be pointless.

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: Add multi-queue support</title>
<updated>2021-07-16T18:17:56Z</updated>
<author>
<name>Peilin Ye</name>
<email>peilin.ye@bytedance.com</email>
</author>
<published>2021-07-16T01:52:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d4861fc6be581561d6964700110a4dede54da6a6'/>
<id>urn:sha1:d4861fc6be581561d6964700110a4dede54da6a6</id>
<content type='text'>
Currently netdevsim only supports a single queue per port, which is
insufficient for testing multi-queue TC schedulers e.g. sch_mq.  Extend
the current sysfs interface so that users can create ports with multiple
queues:

$ echo "[ID] [PORT_COUNT] [NUM_QUEUES]" &gt; /sys/bus/netdevsim/new_device

As an example, echoing "2 4 8" creates 4 ports, with 8 queues per port.
Note, this is compatible with the current interface, with default number
of queues set to 1.  For example, echoing "2 4" creates 4 ports with 1
queue per port; echoing "2" simply creates 1 port with 1 queue.

Reviewed-by: Cong Wang &lt;cong.wang@bytedance.com&gt;
Signed-off-by: Peilin Ye &lt;peilin.ye@bytedance.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netdevsim: Implement legacy/switchdev mode for VFs</title>
<updated>2021-06-02T21:08:36Z</updated>
<author>
<name>Dmytro Linkin</name>
<email>dlinkin@nvidia.com</email>
</author>
<published>2021-06-02T12:17:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=160dc373eead2143ea51b7f8e2a6bf1e383f24f8'/>
<id>urn:sha1:160dc373eead2143ea51b7f8e2a6bf1e383f24f8</id>
<content type='text'>
Implement callbacks to set/get eswitch mode value. Add helpers to check
current mode.

Instantiate VFs' net devices and devlink ports on switchdev enabling and
remove them on legacy enabling. Changing number of VFs while in
switchdev mode triggers VFs creation/deletion.

Also disable NDO API callback to set VF rate, since it's legacy API.
Switchdev API to set VF rate will be implemented in one of the next
patches.

Signed-off-by: Dmytro Linkin &lt;dlinkin@nvidia.com&gt;
Reviewed-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netdevsim: Implement VFs</title>
<updated>2021-06-02T21:08:36Z</updated>
<author>
<name>Dmytro Linkin</name>
<email>dlinkin@nvidia.com</email>
</author>
<published>2021-06-02T12:17:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=92ba1f29e6e2f16eb93a0a2c7c01985920b89222'/>
<id>urn:sha1:92ba1f29e6e2f16eb93a0a2c7c01985920b89222</id>
<content type='text'>
Allow creation of netdevsim ports for VFs along with allocations of
corresponding net devices and devlink ports.
Add enums and helpers to distinguish PFs' ports from VFs' ports.

Ports creation/deletion debugfs API intended to be used with physical
ports only.
VFs instantiation will be done in one of the next patches.

Signed-off-by: Dmytro Linkin &lt;dlinkin@nvidia.com&gt;
Reviewed-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netdevsim: init u64 stats for 32bit hardware</title>
<updated>2021-03-04T22:36:26Z</updated>
<author>
<name>Hillf Danton</name>
<email>hdanton@sina.com</email>
</author>
<published>2021-03-04T18:30:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=863a42b289c22df63db62b10fc2c2ffc237e2125'/>
<id>urn:sha1: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>
</entry>
</feed>
