freebsd-nq/sys/dev/virtio
John Baldwin 4dc78216f8 Don't free mbufs when stopping an interface in netmap mode.
Currently if you ifconfig down a vtnet interface while it is being used
via netmap, the kernel panics due to trying to treat the cookie values
in the virtio rings as mbufs to be freed. When netmap is enabled, these
cookie values are pointers to something else.

Note that other netmap-aware drivers don't seem to need this as they
store the mbuf pointers in the software rings that mirror the hardware
descriptor rings, and since netmap doesn't touch those, the software
state always has NULL mbuf pointers causing the loops to free mbufs to
not do anything. However, vtnet reuses the same state area for both
netmap and non-netmap mode, so it needs to explicitly avoid looking at
the rings and treating the cookie values as mbufs if netmap is
enabled.

Differential Revision:	https://reviews.freebsd.org/D2348
Reviewed by:	adrian, bryanv, luigi
MFC after:	1 week
Sponsored by:	Norse Corp, Inc.
2015-04-29 17:48:25 +00:00
..
balloon xen/virtio: fix balloon drivers to not mark pages as WIRED 2014-06-25 09:51:08 +00:00
block Do not report stripe size if it is equal to sector size. 2015-04-18 19:37:37 +00:00
console Several minor changes to hopefully complete the VirtIO console driver 2014-11-07 03:36:28 +00:00
mmio Hide virtio features negotiation messages under bootverbose. 2015-03-15 21:00:10 +00:00
network Don't free mbufs when stopping an interface in netmap mode. 2015-04-29 17:48:25 +00:00
pci Hide virtio features negotiation messages under bootverbose. 2015-03-15 21:00:10 +00:00
random Wait for the callout to finish before unloading the module 2014-04-24 05:04:54 +00:00
scsi Prevent overflow issues in timeout processing 2014-11-21 21:01:24 +00:00
virtio_bus_if.m Add virtio bus 'poll' method allowing us to inform backend we are 2014-12-12 11:19:10 +00:00
virtio_config.h Move the VIRTIO_RING_F_* defines out of virtqueue.h into virtio_config.h 2014-06-16 04:25:04 +00:00
virtio_ids.h Split the virtio.h header file into multiple files 2014-06-01 18:16:01 +00:00
virtio_if.m
virtio_ring.h
virtio.c Split the virtio.h header file into multiple files 2014-06-01 18:16:01 +00:00
virtio.h Move the VIRTIO_RING_F_* defines out of virtqueue.h into virtio_config.h 2014-06-16 04:25:04 +00:00
virtqueue.c Add virtio bus 'poll' method allowing us to inform backend we are 2014-12-12 11:19:10 +00:00
virtqueue.h Add accessor to get the number of free descriptors in the virtqueue 2014-07-10 05:26:01 +00:00