freebsd-dev/sys/dev/netmap
Vincenzo Maffione 16f224b5f8 netmap: vtnet: fix races in vtnet_netmap_reg()
The nm_register callback needs to call nm_set_native_flags()
or nm_clear_native_flags() once the device has been stopped.
However, in the current implementation this is not true,
as the device is stopped by vtnet_init_locked(). This causes
race conditions where the driver crashes as soon as it
dequeues netmap buffers assuming they are mbufs (or the other
way around).
To fix the issue, we extend vtnet_init_locked() with a second
argument that, if not zero, will set/clear the netmap flags.
This results in a huge simplification of the nm_register
callback itself.
Also, use netmap_reset() to check if a ring is going to be
re-initialized in netmap mode.

MFC after:	1 week
2020-06-14 20:47:31 +00:00
..
if_ptnet.c Use NET_TASK_INIT() and NET_GROUPTASK_INIT() for drivers that process 2020-02-11 18:57:07 +00:00
if_re_netmap.h
if_vtnet_netmap.h netmap: vtnet: fix races in vtnet_netmap_reg() 2020-06-14 20:47:31 +00:00
netmap_bdg.c add valectl to the system commands 2019-10-31 21:01:34 +00:00
netmap_bdg.h netmap: align codebase to the current upstream (760279cfb2730a585) 2018-12-05 11:57:16 +00:00
netmap_freebsd.c Make page busy state deterministic on free. Pages must be xbusy when 2019-12-22 06:56:44 +00:00
netmap_generic.c netmap: enter NET_EPOCH on generic txsync 2019-10-28 19:00:27 +00:00
netmap_kern.h netmap: introduce netmap_kring_on() 2020-06-11 20:35:28 +00:00
netmap_kloop.c netmap: import changes from upstream (SHA 137f537eae513) 2019-09-01 14:47:41 +00:00
netmap_legacy.c netmap: minor misc improvements 2019-10-20 14:15:45 +00:00
netmap_mbq.c
netmap_mbq.h
netmap_mem2.c netmap_mem_unmap: fix NULL pointer dereference 2020-01-26 21:34:46 +00:00
netmap_mem2.h netmap: align codebase to the current upstream (760279cfb2730a585) 2018-12-05 11:57:16 +00:00
netmap_monitor.c netmap: refactor logging macros and pipes 2019-02-05 12:10:48 +00:00
netmap_null.c netmap: refactor logging macros and pipes 2019-02-05 12:10:48 +00:00
netmap_offloadings.c netmap: refactor logging macros and pipes 2019-02-05 12:10:48 +00:00
netmap_pipe.c netmap: refactor logging macros and pipes 2019-02-05 12:10:48 +00:00
netmap_vale.c netmap: vale: fix disabled logs 2020-06-03 05:49:19 +00:00
netmap.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00