opnsense-src/sys/dev/xen
Mark Johnston 2e4781cb12 xen/netfront: Decouple XENNET tags from mbuf lifetimes
netmap's generic mode tries to improve performance by minimizing mbuf
allocations.  In service of this goal, it maintains an extra reference
to the mbuf and polls the counter to see if the driver has released its
reference by calling m_freem().  As a result, the extref destructor is
not called when expected by the netfront driver, and mbufs tags are not
freed.

Modify the tx path to release its mbuf tags promptly when reclaiming tx
descriptors.  They are drawn from a fixed-size pool, so otherwise are
quickly exhausted when a netfront interface is in netmap generic mode.

Co-authored by:	royger
MFC after:	2 weeks
Fixes:	dabb3db7a8 ("xen/netfront: deal with mbuf data crossing a page boundary")
Sponsored by:	Cloud Software Group
Sponsored by:	Klara, Inc.
Sponsored by:	Zenarmor
2024-08-02 18:05:37 +00:00
..
balloon xen/dev: remove __unused from driver argument of identify functions 2023-11-28 13:32:57 +01:00
blkback xen/dev: switch to DEVMETHOD_END 2023-11-28 13:31:47 +01:00
blkfront Deprecate contigfree(9) in favour of free(9) 2024-07-26 10:45:01 +00:00
bus xen: introduce a per-arch scratch mapping ranges 2024-07-30 09:39:38 +02:00
console x86/xen: introduce non-hypercall based emergency print 2024-02-22 11:08:03 +01:00
control xen/dev: remove __unused from driver argument of identify functions 2023-11-28 13:32:57 +01:00
cpu sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
debug xen/debug: remove usage of sbuf_{clear,finish}() on drained sbuf 2024-05-09 12:50:08 +02:00
efi sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
evtchn sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
gntdev gntdev: Handle errors from suword32() in gntdev_alloc_gref() 2023-12-25 21:04:01 -05:00
grant_table xen/dev: remove __unused from driver argument of identify functions 2023-11-28 13:32:57 +01:00
netback netpfil: Use accessor functions and named constants for all tcphdr flags 2023-12-25 13:18:01 +01:00
netfront xen/netfront: Decouple XENNET tags from mbuf lifetimes 2024-08-02 18:05:37 +00:00
pcifront newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANY 2024-07-24 22:22:58 -06:00
privcmd sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
timer xen/intr: correct misuses of Xen handle pointer type 2023-11-28 12:51:19 +01:00
xenpci xen/dev: switch to DEVMETHOD_END 2023-11-28 13:31:47 +01:00
xenstore xen/dev: remove __unused from driver argument of identify functions 2023-11-28 13:32:57 +01:00