Page MenuHomeFreeBSD

ena: Reinit netmap adapter struct upon sysctl changes
Needs ReviewPublic

Authored by osamaabb_amazon.com on Tue, Aug 20, 8:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Sep 10, 7:52 PM
Unknown Object (File)
Mon, Sep 9, 2:54 AM
Unknown Object (File)
Sun, Sep 8, 3:40 PM
Unknown Object (File)
Sun, Sep 8, 12:54 AM
Unknown Object (File)
Thu, Sep 5, 8:27 AM
Unknown Object (File)
Sat, Aug 31, 10:58 AM
Unknown Object (File)
Sun, Aug 25, 10:07 AM
Unknown Object (File)
Wed, Aug 21, 1:37 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