nm_os_kctx_worker_start() has returned EOPNOTSUPP since b6e66be22bdc,
because enabling and disabling polling crashed the kernel.
nm_os_kctx_worker_stop() asked the kthread to stop and returned, and the
caller then freed the context and the polling state while the kthread
was still using them. Wait in nm_os_kctx_worker_stop() until the
kthread has left its loop, destroy the context's mutex with the context,
and remove the early return. Refuse a CPU that is not present, and
print the kthread's address only with netmap_verbose.
The kthread inherits thread0's kernel priority, is bound to its CPU and
never sleeps, so no user thread bound to that CPU could run: a process
started with cpuset -l 0 waited until polling was switched off, and a
reboot with polling on CPU 0 hung, since kern_reboot() binds to that
CPU. Call maybe_yield() after each pass, so that the kthread runs at a
timeshare priority like other long-running kernel threads.
ctrl-api-test no longer accepts a failure of vale_polling_enable_disable
on FreeBSD, and skips the test on a single CPU, where polling is
refused.
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")