aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/virtio
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/virtio
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/virtio')
-rw-r--r--sys/dev/virtio/block/virtio_blk.c5
-rw-r--r--sys/dev/virtio/network/if_vtnet.c7
2 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/virtio/block/virtio_blk.c b/sys/dev/virtio/block/virtio_blk.c
index 94ad4196155f..b7c538254ce1 100644
--- a/sys/dev/virtio/block/virtio_blk.c
+++ b/sys/dev/virtio/block/virtio_blk.c
@@ -1392,8 +1392,9 @@ vtblk_setup_sysctl(struct vtblk_softc *sc)
child = SYSCTL_CHILDREN(tree);
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "writecache_mode",
- CTLTYPE_INT | CTLFLAG_RW, sc, 0, vtblk_write_cache_sysctl,
- "I", "Write cache mode (writethrough (0) or writeback (1))");
+ CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0,
+ vtblk_write_cache_sysctl, "I",
+ "Write cache mode (writethrough (0) or writeback (1))");
}
static int
diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c
index b388e43d92a6..4839e49b0f25 100644
--- a/sys/dev/virtio/network/if_vtnet.c
+++ b/sys/dev/virtio/network/if_vtnet.c
@@ -234,7 +234,8 @@ static int vtnet_tunable_int(struct vtnet_softc *, const char *, int);
DEBUGNET_DEFINE(vtnet);
/* Tunables. */
-static SYSCTL_NODE(_hw, OID_AUTO, vtnet, CTLFLAG_RD, 0, "VNET driver parameters");
+static SYSCTL_NODE(_hw, OID_AUTO, vtnet, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
+ "VNET driver parameters");
static int vtnet_csum_disable = 0;
TUNABLE_INT("hw.vtnet.csum_disable", &vtnet_csum_disable);
SYSCTL_INT(_hw_vtnet, OID_AUTO, csum_disable, CTLFLAG_RDTUN,
@@ -3751,7 +3752,7 @@ vtnet_setup_rxq_sysctl(struct sysctl_ctx_list *ctx,
snprintf(namebuf, sizeof(namebuf), "rxq%d", rxq->vtnrx_id);
node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf,
- CTLFLAG_RD, NULL, "Receive Queue");
+ CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Receive Queue");
list = SYSCTL_CHILDREN(node);
stats = &rxq->vtnrx_stats;
@@ -3784,7 +3785,7 @@ vtnet_setup_txq_sysctl(struct sysctl_ctx_list *ctx,
snprintf(namebuf, sizeof(namebuf), "txq%d", txq->vtntx_id);
node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf,
- CTLFLAG_RD, NULL, "Transmit Queue");
+ CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Transmit Queue");
list = SYSCTL_CHILDREN(node);
stats = &txq->vtntx_stats;