aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ena
diff options
context:
space:
mode:
authorPawel Biernacki <kaktus@FreeBSD.org>2020-02-26 14:26:36 +0000
committerPawel Biernacki <kaktus@FreeBSD.org>2020-02-26 14:26:36 +0000
commit7029da5c36f2d3cf6bb6c81bf551229f416399e8 (patch)
tree53cae9da1371117a3ac21d0d0f3f030a692807ae /sys/dev/ena
parentd7313dc6f5fcab29946951936597772dfff6a4be (diff)
downloadsrc-7029da5c36f2d3cf6bb6c81bf551229f416399e8.tar.gz
src-7029da5c36f2d3cf6bb6c81bf551229f416399e8.zip
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718
Notes
Notes: svn path=/head/; revision=358333
Diffstat (limited to 'sys/dev/ena')
-rw-r--r--sys/dev/ena/ena_sysctl.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c
index 97c8007deea4..0272837027c2 100644
--- a/sys/dev/ena/ena_sysctl.c
+++ b/sys/dev/ena/ena_sysctl.c
@@ -38,7 +38,8 @@ static void ena_sysctl_add_tuneables(struct ena_adapter *);
static int ena_sysctl_buf_ring_size(SYSCTL_HANDLER_ARGS);
static int ena_sysctl_rx_queue_size(SYSCTL_HANDLER_ARGS);
-static SYSCTL_NODE(_hw, OID_AUTO, ena, CTLFLAG_RD, 0, "ENA driver parameters");
+static SYSCTL_NODE(_hw, OID_AUTO, ena, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
+ "ENA driver parameters");
/*
* Logging level for changing verbosity of the output
@@ -150,12 +151,12 @@ ena_sysctl_add_stats(struct ena_adapter *adapter)
snprintf(namebuf, QUEUE_NAME_LEN, "queue%d", i);
queue_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO,
- namebuf, CTLFLAG_RD, NULL, "Queue Name");
+ namebuf, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Queue Name");
queue_list = SYSCTL_CHILDREN(queue_node);
/* TX specific stats */
tx_node = SYSCTL_ADD_NODE(ctx, queue_list, OID_AUTO,
- "tx_ring", CTLFLAG_RD, NULL, "TX ring");
+ "tx_ring", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "TX ring");
tx_list = SYSCTL_CHILDREN(tx_node);
tx_stats = &tx_ring->tx_stats;
@@ -203,7 +204,7 @@ ena_sysctl_add_stats(struct ena_adapter *adapter)
/* RX specific stats */
rx_node = SYSCTL_ADD_NODE(ctx, queue_list, OID_AUTO,
- "rx_ring", CTLFLAG_RD, NULL, "RX ring");
+ "rx_ring", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "RX ring");
rx_list = SYSCTL_CHILDREN(rx_node);
rx_stats = &rx_ring->rx_stats;
@@ -242,7 +243,7 @@ ena_sysctl_add_stats(struct ena_adapter *adapter)
/* Stats read from device */
hw_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "hw_stats",
- CTLFLAG_RD, NULL, "Statistics from hardware");
+ CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Statistics from hardware");
hw_list = SYSCTL_CHILDREN(hw_node);
SYSCTL_ADD_COUNTER_U64(ctx, hw_list, OID_AUTO, "rx_packets", CTLFLAG_RD,
@@ -258,7 +259,7 @@ ena_sysctl_add_stats(struct ena_adapter *adapter)
/* ENA Admin queue stats */
admin_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "admin_stats",
- CTLFLAG_RD, NULL, "ENA Admin Queue statistics");
+ CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "ENA Admin Queue statistics");
admin_list = SYSCTL_CHILDREN(admin_node);
SYSCTL_ADD_U32(ctx, admin_list, OID_AUTO, "aborted_cmd", CTLFLAG_RD,
@@ -289,15 +290,15 @@ ena_sysctl_add_tuneables(struct ena_adapter *adapter)
child = SYSCTL_CHILDREN(tree);
/* Tuneable number of buffers in the buf-ring (drbr) */
- SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "buf_ring_size", CTLTYPE_INT |
- CTLFLAG_RW, adapter, 0, ena_sysctl_buf_ring_size, "I",
- "Size of the bufring");
+ SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "buf_ring_size",
+ CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, adapter, 0,
+ ena_sysctl_buf_ring_size, "I", "Size of the bufring");
/* Tuneable number of Rx ring size */
- SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_queue_size", CTLTYPE_INT |
- CTLFLAG_RW, adapter, 0, ena_sysctl_rx_queue_size, "I",
- "Size of the Rx ring. The size should be a power of 2. "
- "Max value is 8K");
+ SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_queue_size",
+ CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, adapter, 0,
+ ena_sysctl_rx_queue_size, "I", "Size of the Rx ring. "
+ "The size should be a power of 2. Max value is 8K");
}