From nobody Thu Dec 02 18:46:57 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2CEEB18A8554; Thu, 2 Dec 2021 18:46:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J4lL951W4z3qBS; Thu, 2 Dec 2021 18:46:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83B5D22809; Thu, 2 Dec 2021 18:46:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B2IkvZe068556; Thu, 2 Dec 2021 18:46:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B2Ikv3P068555; Thu, 2 Dec 2021 18:46:57 GMT (envelope-from git) Date: Thu, 2 Dec 2021 18:46:57 GMT Message-Id: <202112021846.1B2Ikv3P068555@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bryan Drewery Subject: git: 8f82dc8dd3ff - main - hyperv: Flag hn and storvsc statistics with CTLFLAG_STATS. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdrewery X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f82dc8dd3ffad550725f87ae69c0ad10fedf443 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638470817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GmfvVFvXZym/ZNFxBJckH9nwPHHyi7ReW7t/MMx0kY4=; b=Zu3R50dFd2zYudt6MDevWPkaW5M3jHxjN+ZO5+9R3GpKEArsPgEr6yxSa6uUW73I0PeKQw belhC/Iw+97+/ujEzJaDsuTj/QA3r+TNF3ZAN8nMcfoFcnovDTAiJsX+3ZkJZw5k/bklwC GLxY0mp0HzoX3e747HqbZZrCP8ONIcb7NIVDEh9Y2F1a1VI8j9o4oG0F5lWpF6bdNEQ1FX J2sPENhDUgUsY28z2IXIq/Xe1bntt+FnWmGqMDo9W0o+1JmJzKAFuJYTNILdtgPTaGeWnc BMWTwhnbnpBjGEAoeZUfH1stupjxzaHG2i89CDB0cyj4kz+9NxifFh8YhygTOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638470817; a=rsa-sha256; cv=none; b=gSl5wFIVeJ5rsTaXIOOubzMbGLnCdX7Up6qzHTwZ/WnQAkIb3fM5BiUdXZ3P4zj2Ft98h5 2a8PgzxYl/wf2VOva2D1tZsPILm0GE70L5OnvxtqGAZc8dsf28jeekKDJON20IzvNN9eqB VYekmjWvBGpTE9LZvmFcaR5K8dBn0DW2nbOF67+JtEUVaHYUOemHAF7kqJODJQCIEhzmhY sNwbAOatuto23Q6gGlEYxkHWJLjl8jkZrQTCfi62yhMINEw1ol5OnuoUsDlrXQKjyfL4zh tubWYL50HxpPFbcqvaCTUFG6LVaTeyIyHqYUurEu/RzVpqtkDlrxyij1uXCriA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bdrewery: URL: https://cgit.FreeBSD.org/src/commit/?id=8f82dc8dd3ffad550725f87ae69c0ad10fedf443 commit 8f82dc8dd3ffad550725f87ae69c0ad10fedf443 Author: Don Morris AuthorDate: 2021-04-30 18:33:00 +0000 Commit: Bryan Drewery CommitDate: 2021-12-02 18:46:36 +0000 hyperv: Flag hn and storvsc statistics with CTLFLAG_STATS. Reviewed by: vangyzen, whu, bdrewery Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D30060 --- sys/dev/hyperv/netvsc/if_hn.c | 49 ++++++++++++++----------- sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c | 15 +++++--- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c index d562a937ecad..de464662c2ef 100644 --- a/sys/dev/hyperv/netvsc/if_hn.c +++ b/sys/dev/hyperv/netvsc/if_hn.c @@ -5055,21 +5055,25 @@ hn_create_rx_data(struct hn_softc *sc, int ring_cnt) if (rxr->hn_rx_sysctl_tree != NULL) { SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(rxr->hn_rx_sysctl_tree), - OID_AUTO, "packets", CTLFLAG_RW, - &rxr->hn_pkts, "# of packets received"); + OID_AUTO, "packets", + CTLFLAG_RW | CTLFLAG_STATS, &rxr->hn_pkts, + "# of packets received"); SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(rxr->hn_rx_sysctl_tree), - OID_AUTO, "rss_pkts", CTLFLAG_RW, + OID_AUTO, "rss_pkts", + CTLFLAG_RW | CTLFLAG_STATS, &rxr->hn_rss_pkts, "# of packets w/ RSS info received"); SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(rxr->hn_rx_sysctl_tree), - OID_AUTO, "rsc_pkts", CTLFLAG_RW, + OID_AUTO, "rsc_pkts", + CTLFLAG_RW | CTLFLAG_STATS, &rxr->hn_rsc_pkts, "# of RSC packets received"); SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(rxr->hn_rx_sysctl_tree), - OID_AUTO, "rsc_drop", CTLFLAG_RW, + OID_AUTO, "rsc_drop", + CTLFLAG_RW | CTLFLAG_STATS, &rxr->hn_rsc_drop, "# of RSC fragments dropped"); SYSCTL_ADD_INT(ctx, @@ -5082,7 +5086,7 @@ hn_create_rx_data(struct hn_softc *sc, int ring_cnt) } SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_queued", - CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, + CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_STATS , sc, __offsetof(struct hn_rx_ring, hn_lro.lro_queued), #if __FreeBSD_version < 1100095 hn_rx_stat_int_sysctl, @@ -5091,7 +5095,7 @@ hn_create_rx_data(struct hn_softc *sc, int ring_cnt) #endif "LU", "LRO queued"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_flushed", - CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, + CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_STATS , sc, __offsetof(struct hn_rx_ring, hn_lro.lro_flushed), #if __FreeBSD_version < 1100095 hn_rx_stat_int_sysctl, @@ -5100,7 +5104,7 @@ hn_create_rx_data(struct hn_softc *sc, int ring_cnt) #endif "LU", "LRO flushed"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_tried", - CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_STATS , sc, __offsetof(struct hn_rx_ring, hn_lro_tried), hn_rx_stat_ulong_sysctl, "LU", "# of LRO tries"); #if __FreeBSD_version >= 1100099 @@ -5129,15 +5133,15 @@ hn_create_rx_data(struct hn_softc *sc, int ring_cnt) "Trust ip packet verification on host side, " "when csum info is missing"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "csum_ip", - CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_STATS , sc, __offsetof(struct hn_rx_ring, hn_csum_ip), hn_rx_stat_ulong_sysctl, "LU", "RXCSUM IP"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "csum_tcp", - CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_STATS , sc, __offsetof(struct hn_rx_ring, hn_csum_tcp), hn_rx_stat_ulong_sysctl, "LU", "RXCSUM TCP"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "csum_udp", - CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_STATS , sc, __offsetof(struct hn_rx_ring, hn_csum_udp), hn_rx_stat_ulong_sysctl, "LU", "RXCSUM UDP"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "csum_trusted", @@ -5146,11 +5150,11 @@ hn_create_rx_data(struct hn_softc *sc, int ring_cnt) hn_rx_stat_ulong_sysctl, "LU", "# of packets that we trust host's csum verification"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "small_pkts", - CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_STATS , sc, __offsetof(struct hn_rx_ring, hn_small_pkts), hn_rx_stat_ulong_sysctl, "LU", "# of small packets received"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_ack_failed", - CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_STATS , sc, __offsetof(struct hn_rx_ring, hn_ack_failed), hn_rx_stat_ulong_sysctl, "LU", "# of RXBUF ack failures"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "rx_ring_cnt", @@ -5391,10 +5395,11 @@ hn_tx_ring_create(struct hn_softc *sc, int id) "over active"); } SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "packets", - CTLFLAG_RW, &txr->hn_pkts, + CTLFLAG_RW | CTLFLAG_STATS, &txr->hn_pkts, "# of packets transmitted"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "sends", - CTLFLAG_RW, &txr->hn_sends, "# of sends"); + CTLFLAG_RW | CTLFLAG_STATS, &txr->hn_sends, + "# of sends"); } } @@ -5517,32 +5522,32 @@ hn_create_tx_data(struct hn_softc *sc, int ring_cnt) } SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "no_txdescs", - CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_STATS, sc, __offsetof(struct hn_tx_ring, hn_no_txdescs), hn_tx_stat_ulong_sysctl, "LU", "# of times short of TX descs"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "send_failed", - CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_STATS, sc, __offsetof(struct hn_tx_ring, hn_send_failed), hn_tx_stat_ulong_sysctl, "LU", "# of hyper-v sending failure"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "txdma_failed", - CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_STATS, sc, __offsetof(struct hn_tx_ring, hn_txdma_failed), hn_tx_stat_ulong_sysctl, "LU", "# of TX DMA failure"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "agg_flush_failed", - CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_STATS, sc, __offsetof(struct hn_tx_ring, hn_flush_failed), hn_tx_stat_ulong_sysctl, "LU", "# of packet transmission aggregation flush failure"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_collapsed", - CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_STATS, sc, __offsetof(struct hn_tx_ring, hn_tx_collapsed), hn_tx_stat_ulong_sysctl, "LU", "# of TX mbuf collapsed"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_chimney", - CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_STATS, sc, __offsetof(struct hn_tx_ring, hn_tx_chimney), hn_tx_stat_ulong_sysctl, "LU", "# of chimney send"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_chimney_tried", - CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_STATS, sc, __offsetof(struct hn_tx_ring, hn_tx_chimney_tried), hn_tx_stat_ulong_sysctl, "LU", "# of chimney send tries"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "txdesc_cnt", diff --git a/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c b/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c index 702308e26a1d..13e52ec1b6db 100644 --- a/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c +++ b/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c @@ -1006,12 +1006,15 @@ storvsc_sysctl(device_t dev) ctx = device_get_sysctl_ctx(dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "data_bio_cnt", CTLFLAG_RW, - &sc->sysctl_data.data_bio_cnt, "# of bio data block"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "data_vaddr_cnt", CTLFLAG_RW, - &sc->sysctl_data.data_vaddr_cnt, "# of vaddr data block"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "data_sg_cnt", CTLFLAG_RW, - &sc->sysctl_data.data_sg_cnt, "# of sg data block"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "data_bio_cnt", + CTLFLAG_RW | CTLFLAG_STATS, &sc->sysctl_data.data_bio_cnt, + "# of bio data block"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "data_vaddr_cnt", + CTLFLAG_RW | CTLFLAG_STATS, &sc->sysctl_data.data_vaddr_cnt, + "# of vaddr data block"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "data_sg_cnt", + CTLFLAG_RW | CTLFLAG_STATS, &sc->sysctl_data.data_sg_cnt, + "# of sg data block"); /* dev.storvsc.UNIT.channel */ ch_tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "channel",