[Bug 260667] [vtnet] net driver leaks when detached

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 24 Dec 2021 16:26:32 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260667

            Bug ID: 260667
           Summary: [vtnet] net driver leaks when detached
           Product: Base System
           Version: 13.0-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: ghuckriede@blackberry.com

Overview
--------

'if_vtnet' driver is missing the 'pfil_head_unregister()' during
'vtnet_detach()'.

Included a patch, which assumes the fix for bug #256714 is also applied.


Steps to Reproduce
------------------

Attach and then detach vnet device.
# vmstat -m | grep pfil
         pfil     6     1K        5  128
# devctl attach pci0:0:4:0
virtio_pci1: <VirtIO PCI (legacy) Network adapter> port 0xc020-0xc03f mem
0xfeb92000-0xfeb92fff,0xfe004000-0xfe007fff irq 11 at device 4.0 on pci0
vtnet1: <VirtIO Networking Adapter> on virtio_pci1
pfil: duplicate head "vtnet1"
810.828154 [ 450] vtnet_netmap_attach       vtnet attached txq=1, txd=256
rxq=1, rxd=128
# devctl detach pci0:0:4:0
# vmstat -m | grep pfil
         pfil     7     1K        6  128


Actual Results
--------------

Leaks 'pfil' memory at each detach.



Expected Results
----------------

All memory allocated in attach is freed in the detach.


Build Date & Hardware
---------------------

root@freebsd:~ # uname -a
FreeBSD freebsd 13.0-RELEASE FreeBSD 13.0-RELEASE #0
releng/13.0-n244733-ea31abc261f: Fri Apr  9 04:24:09 UTC 2021    
root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64


Additional Information
----------------------

-- 
You are receiving this mail because:
You are the assignee for the bug.