From 7029da5c36f2d3cf6bb6c81bf551229f416399e8 Mon Sep 17 00:00:00 2001 From: Pawel Biernacki Date: Wed, 26 Feb 2020 14:26:36 +0000 Subject: Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- sys/dev/nge/if_nge.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'sys/dev/nge') diff --git a/sys/dev/nge/if_nge.c b/sys/dev/nge/if_nge.c index fe1e29e8d47d..c099896d7bc8 100644 --- a/sys/dev/nge/if_nge.c +++ b/sys/dev/nge/if_nge.c @@ -2652,8 +2652,8 @@ nge_sysctl_node(struct nge_softc *sc) ctx = device_get_sysctl_ctx(sc->nge_dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->nge_dev)); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_holdoff", - CTLTYPE_INT | CTLFLAG_RW, &sc->nge_int_holdoff, 0, - sysctl_hw_nge_int_holdoff, "I", "NGE interrupt moderation"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->nge_int_holdoff, + 0, sysctl_hw_nge_int_holdoff, "I", "NGE interrupt moderation"); /* Pull in device tunables. */ sc->nge_int_holdoff = NGE_INT_HOLDOFF_DEFAULT; error = resource_int_value(device_get_name(sc->nge_dev), @@ -2671,13 +2671,13 @@ nge_sysctl_node(struct nge_softc *sc) } stats = &sc->nge_stats; - tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, - NULL, "NGE statistics"); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "NGE statistics"); parent = SYSCTL_CHILDREN(tree); /* Rx statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, - NULL, "Rx MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Rx MAC statistics"); child = SYSCTL_CHILDREN(tree); NGE_SYSCTL_STAT_ADD32(ctx, child, "pkts_errs", &stats->rx_pkts_errs, @@ -2701,8 +2701,8 @@ nge_sysctl_node(struct nge_softc *sc) &stats->rx_pause, "Pause frames"); /* Tx statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, - NULL, "Tx MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Tx MAC statistics"); child = SYSCTL_CHILDREN(tree); NGE_SYSCTL_STAT_ADD32(ctx, child, "pause", &stats->tx_pause, "Pause frames"); -- cgit v1.3