]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ena: hide sysctl nodes for unused ENA queues
authorMarcin Wojtas <mw@FreeBSD.org>
Mon, 14 Jun 2021 08:57:54 +0000 (10:57 +0200)
committerMarcin Wojtas <mw@FreeBSD.org>
Thu, 24 Jun 2021 14:02:39 +0000 (16:02 +0200)
commit0e7d31f63b9db869c91228d8ed1e984bdee2b931
tree04404c904194d20e7e880ef1dec8dcecd23ef763
parentddec69e6a796283497ebada0569f34bd41bbdf37
ena: hide sysctl nodes for unused ENA queues

IO queue related attributes are registered statically at driver attach
with the rest of the ENA specific sysctl nodes. However, the number of
queues can be changed at runtime via the `ena_sysctl_io_queues_nb`
request, leading to a potential exposure of attributes for non-existing
queues.

Introduce a new `ena_sysctl_update_queue_node_nb` function, which
updates the sysctl nodes after the number of queues is altered.
This happens by either registering or unregistering node specific oids,
based on a delta between the previous and current queue count.

NOTE: All unregistered oids must be registered again before the driver
detach, e.g. by another call to this function.

Submitted by: Artur Rojek <ar@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
sys/dev/ena/ena.c
sys/dev/ena/ena.h
sys/dev/ena/ena_sysctl.c
sys/dev/ena/ena_sysctl.h