]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC 282241:
authorjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 27 May 2015 14:29:39 +0000 (14:29 +0000)
committerjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 27 May 2015 14:29:39 +0000 (14:29 +0000)
commitf92e2364093737b468c1c360a94cb6a21d5b9da7
tree7a4f0a6b1845ae8100d4458047f63018aa569e7f
parent294ec67b175e8fd63c3a6b17c73fb40c481e4cfb
MFC 282241:
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.

Sponsored by: Norse Corp, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@283617 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/dev/virtio/network/if_vtnet.c