Page MenuHomeFreeBSD

ena: Reinit netmap adapter struct upon sysctl changes
Needs ReviewPublic

Authored by osamaabb_amazon.com on Aug 20 2024, 8:47 AM.
Tags
None
Referenced Files
F102051056: D46368.diff
Thu, Nov 7, 12:17 AM
Unknown Object (File)
Wed, Oct 30, 10:36 AM
Unknown Object (File)
Oct 3 2024, 3:36 AM
Unknown Object (File)
Oct 2 2024, 10:18 AM
Unknown Object (File)
Sep 19 2024, 12:56 PM
Unknown Object (File)
Sep 19 2024, 5:47 AM
Unknown Object (File)
Sep 18 2024, 6:19 AM
Unknown Object (File)
Sep 17 2024, 3:22 PM
Subscribers

Details

Reviewers
cperciva
Summary

When attaching ENA driver, ena_netmap_attach() is invoked which, in turn
calls netmap_attach which, initializes a struct netmap_adapter,
allocating the struct's netmap_ring and the struct selinfo.

When we change the interface number of queues we need to reinit the
netmap adapter struct as well, so we need to detach it in order to free
the memory allocated by netmap_attach and allocate new memory based on
the new parameters like number of rings, ring size etc...

Without detaching and attaching the netmap interface, if we're to change
the number of queues from 8 to 2 for example and try to enable netmap,
the kernel will panic since the original netmap struct within the
kernel's possession still thinks that the driver has 8 queues which will
eventually cause a non-allocated virtual address access fault.

Approved by: cperciva
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 59097
Build 55984: arc lint + arc unit