Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/gve/gve_sysctl.c
| /*- | /*- | ||||
| * SPDX-License-Identifier: BSD-3-Clause | * SPDX-License-Identifier: BSD-3-Clause | ||||
| * | * | ||||
| * Copyright (c) 2023 Google LLC | * Copyright (c) 2023-2024 Google LLC | ||||
| * | * | ||||
| * Redistribution and use in source and binary forms, with or without modification, | * Redistribution and use in source and binary forms, with or without modification, | ||||
| * are permitted provided that the following conditions are met: | * are permitted provided that the following conditions are met: | ||||
| * | * | ||||
| * 1. Redistributions of source code must retain the above copyright notice, this | * 1. Redistributions of source code must retain the above copyright notice, this | ||||
| * list of conditions and the following disclaimer. | * list of conditions and the following disclaimer. | ||||
| * | * | ||||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | * 2. Redistributions in binary form must reproduce the above copyright notice, | ||||
| Show All 12 Lines | |||||
| * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||||
| * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||||
| * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||||
| * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||||
| * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
| */ | */ | ||||
| #include "gve.h" | #include "gve.h" | ||||
| static SYSCTL_NODE(_hw, OID_AUTO, gve, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, | |||||
| "GVE driver parameters"); | |||||
| bool gve_disable_hw_lro = false; | |||||
| SYSCTL_BOOL(_hw_gve, OID_AUTO, disable_hw_lro, CTLFLAG_RDTUN, | |||||
| &gve_disable_hw_lro, 0, "Controls if hardware LRO is used.\n"); | |||||
markj: sysctl descriptions shouldn't end with periods or newlines. | |||||
| char gve_queue_format[8]; | |||||
| SYSCTL_STRING(_hw_gve, OID_AUTO, queue_format, CTLFLAG_RD, | |||||
| &gve_queue_format, 0, "Queue format being used by the iface.\n"); | |||||
| char gve_version[8]; | |||||
| SYSCTL_STRING(_hw_gve, OID_AUTO, driver_version, CTLFLAG_RD, | |||||
| &gve_version, 0, "Driver version.\n"); | |||||
| static void | static void | ||||
| gve_setup_rxq_sysctl(struct sysctl_ctx_list *ctx, | gve_setup_rxq_sysctl(struct sysctl_ctx_list *ctx, | ||||
| struct sysctl_oid_list *child, struct gve_rx_ring *rxq) | struct sysctl_oid_list *child, struct gve_rx_ring *rxq) | ||||
| { | { | ||||
| struct sysctl_oid *node; | struct sysctl_oid *node; | ||||
| struct sysctl_oid_list *list; | struct sysctl_oid_list *list; | ||||
| struct gve_rxq_stats *stats; | struct gve_rxq_stats *stats; | ||||
| char namebuf[16]; | char namebuf[16]; | ||||
| Show All 26 Lines | gve_setup_rxq_sysctl(struct sysctl_ctx_list *ctx, | ||||
| SYSCTL_ADD_COUNTER_U64(ctx, list, OID_AUTO, | SYSCTL_ADD_COUNTER_U64(ctx, list, OID_AUTO, | ||||
| "rx_dropped_pkt_desc_err", CTLFLAG_RD, | "rx_dropped_pkt_desc_err", CTLFLAG_RD, | ||||
| &stats->rx_dropped_pkt_desc_err, | &stats->rx_dropped_pkt_desc_err, | ||||
| "Packets dropped due to descriptor error"); | "Packets dropped due to descriptor error"); | ||||
| SYSCTL_ADD_COUNTER_U64(ctx, list, OID_AUTO, | SYSCTL_ADD_COUNTER_U64(ctx, list, OID_AUTO, | ||||
| "rx_dropped_pkt_mbuf_alloc_fail", CTLFLAG_RD, | "rx_dropped_pkt_mbuf_alloc_fail", CTLFLAG_RD, | ||||
| &stats->rx_dropped_pkt_mbuf_alloc_fail, | &stats->rx_dropped_pkt_mbuf_alloc_fail, | ||||
| "Packets dropped due to failed mbuf allocation"); | "Packets dropped due to failed mbuf allocation"); | ||||
| SYSCTL_ADD_COUNTER_U64(ctx, list, OID_AUTO, | |||||
| "rx_mbuf_dmamap_err", CTLFLAG_RD, | |||||
| &stats->rx_mbuf_dmamap_err, | |||||
| "Number of rx mbufs which couldnt be dma mapped"); | |||||
| SYSCTL_ADD_COUNTER_U64(ctx, list, OID_AUTO, | |||||
| "rx_mbuf_mclget_null", CTLFLAG_RD, | |||||
| &stats->rx_mbuf_mclget_null, | |||||
| "Number of times when there were no cluster mbufs"); | |||||
| SYSCTL_ADD_U32(ctx, list, OID_AUTO, | SYSCTL_ADD_U32(ctx, list, OID_AUTO, | ||||
| "rx_completed_desc", CTLFLAG_RD, | "rx_completed_desc", CTLFLAG_RD, | ||||
| &rxq->cnt, 0, "Number of descriptors completed"); | &rxq->cnt, 0, "Number of descriptors completed"); | ||||
| SYSCTL_ADD_U32(ctx, list, OID_AUTO, | SYSCTL_ADD_U32(ctx, list, OID_AUTO, | ||||
| "num_desc_posted", CTLFLAG_RD, | "num_desc_posted", CTLFLAG_RD, | ||||
| &rxq->fill_cnt, rxq->fill_cnt, | &rxq->fill_cnt, rxq->fill_cnt, | ||||
| "Toal number of descriptors posted"); | "Toal number of descriptors posted"); | ||||
| } | } | ||||
| Show All 36 Lines | gve_setup_txq_sysctl(struct sysctl_ctx_list *ctx, | ||||
| SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, | SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, | ||||
| "tx_dropped_pkt_nospace_bufring", CTLFLAG_RD, | "tx_dropped_pkt_nospace_bufring", CTLFLAG_RD, | ||||
| &stats->tx_dropped_pkt_nospace_bufring, | &stats->tx_dropped_pkt_nospace_bufring, | ||||
| "Packets dropped due to no space in br ring"); | "Packets dropped due to no space in br ring"); | ||||
| SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, | SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, | ||||
| "tx_dropped_pkt_vlan", CTLFLAG_RD, | "tx_dropped_pkt_vlan", CTLFLAG_RD, | ||||
| &stats->tx_dropped_pkt_vlan, | &stats->tx_dropped_pkt_vlan, | ||||
| "Dropped VLAN packets"); | "Dropped VLAN packets"); | ||||
| SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, | |||||
| "tx_delayed_pkt_nospace_descring", CTLFLAG_RD, | |||||
| &stats->tx_delayed_pkt_nospace_descring, | |||||
| "Packets delayed due to no space in desc ring"); | |||||
| SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, | |||||
| "tx_delayed_pkt_nospace_compring", CTLFLAG_RD, | |||||
| &stats->tx_delayed_pkt_nospace_compring, | |||||
| "Packets delayed due to no space in comp ring"); | |||||
| SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, | |||||
| "tx_delayed_pkt_tsoerr", CTLFLAG_RD, | |||||
| &stats->tx_delayed_pkt_tsoerr, | |||||
| "TSO packets delayed due to err in prep errors"); | |||||
| SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, | |||||
| "tx_mbuf_collpase", CTLFLAG_RD, | |||||
| &stats->tx_mbuf_collapse, | |||||
| "tx mbufs that had to be collpased"); | |||||
| SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, | |||||
| "tx_mbuf_defrag", CTLFLAG_RD, | |||||
| &stats->tx_mbuf_defrag, | |||||
| "tx mbufs that had to be defragged"); | |||||
| SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, | |||||
| "tx_mbuf_defrag_err", CTLFLAG_RD, | |||||
| &stats->tx_mbuf_defrag_err, | |||||
| "tx mbufs that failed defrag"); | |||||
| SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, | |||||
| "tx_mbuf_dmamap_enomem_err", CTLFLAG_RD, | |||||
| &stats->tx_mbuf_dmamap_enomem_err, | |||||
| "tx mbufs that could not be dma-mapped due to low mem"); | |||||
| SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, | |||||
| "tx_mbuf_dmamap_err", CTLFLAG_RD, | |||||
| &stats->tx_mbuf_dmamap_err, | |||||
| "tx mbufs that could not be dma-mapped"); | |||||
| } | } | ||||
| static void | static void | ||||
| gve_setup_queue_stat_sysctl(struct sysctl_ctx_list *ctx, struct sysctl_oid_list *child, | gve_setup_queue_stat_sysctl(struct sysctl_ctx_list *ctx, struct sysctl_oid_list *child, | ||||
| struct gve_priv *priv) | struct gve_priv *priv) | ||||
| { | { | ||||
| int i; | int i; | ||||
| ▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | SYSCTL_ADD_U32(ctx, admin_list, OID_AUTO, "adminq_create_rx_queue_cnt", | ||||
| CTLFLAG_RD, &priv->adminq_create_rx_queue_cnt, 0, | CTLFLAG_RD, &priv->adminq_create_rx_queue_cnt, 0, | ||||
| "adminq_create_rx_queue_cnt"); | "adminq_create_rx_queue_cnt"); | ||||
| SYSCTL_ADD_U32(ctx, admin_list, OID_AUTO, "adminq_destroy_tx_queue_cnt", | SYSCTL_ADD_U32(ctx, admin_list, OID_AUTO, "adminq_destroy_tx_queue_cnt", | ||||
| CTLFLAG_RD, &priv->adminq_destroy_tx_queue_cnt, 0, | CTLFLAG_RD, &priv->adminq_destroy_tx_queue_cnt, 0, | ||||
| "adminq_destroy_tx_queue_cnt"); | "adminq_destroy_tx_queue_cnt"); | ||||
| SYSCTL_ADD_U32(ctx, admin_list, OID_AUTO, "adminq_destroy_rx_queue_cnt", | SYSCTL_ADD_U32(ctx, admin_list, OID_AUTO, "adminq_destroy_rx_queue_cnt", | ||||
| CTLFLAG_RD, &priv->adminq_destroy_rx_queue_cnt, 0, | CTLFLAG_RD, &priv->adminq_destroy_rx_queue_cnt, 0, | ||||
| "adminq_destroy_rx_queue_cnt"); | "adminq_destroy_rx_queue_cnt"); | ||||
| SYSCTL_ADD_U32(ctx, admin_list, OID_AUTO, "adminq_get_ptype_map_cnt", | |||||
| CTLFLAG_RD, &priv->adminq_get_ptype_map_cnt, 0, | |||||
| "adminq_get_ptype_map_cnt"); | |||||
| SYSCTL_ADD_U32(ctx, admin_list, OID_AUTO, | SYSCTL_ADD_U32(ctx, admin_list, OID_AUTO, | ||||
| "adminq_dcfg_device_resources_cnt", CTLFLAG_RD, | "adminq_dcfg_device_resources_cnt", CTLFLAG_RD, | ||||
| &priv->adminq_dcfg_device_resources_cnt, 0, | &priv->adminq_dcfg_device_resources_cnt, 0, | ||||
| "adminq_dcfg_device_resources_cnt"); | "adminq_dcfg_device_resources_cnt"); | ||||
| SYSCTL_ADD_U32(ctx, admin_list, OID_AUTO, | SYSCTL_ADD_U32(ctx, admin_list, OID_AUTO, | ||||
| "adminq_set_driver_parameter_cnt", CTLFLAG_RD, | "adminq_set_driver_parameter_cnt", CTLFLAG_RD, | ||||
| &priv->adminq_set_driver_parameter_cnt, 0, | &priv->adminq_set_driver_parameter_cnt, 0, | ||||
| "adminq_set_driver_parameter_cnt"); | "adminq_set_driver_parameter_cnt"); | ||||
| ▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines | |||||
sysctl descriptions shouldn't end with periods or newlines.