diff options
author | arybchik <arybchik@FreeBSD.org> | 2015-03-25 13:42:37 +0000 |
---|---|---|
committer | arybchik <arybchik@FreeBSD.org> | 2015-03-25 13:42:37 +0000 |
commit | 323881a00032fd6557c99f2053689044308f289b (patch) | |
tree | c25fe693f03a70e409fe4474488daddecbbac428 | |
parent | 716ce1ca36a8f58784658302db2e5bd8900df5e1 (diff) | |
download | FreeBSD-src-323881a00032fd6557c99f2053689044308f289b.zip FreeBSD-src-323881a00032fd6557c99f2053689044308f289b.tar.gz |
MFC: 280161
sfxge: move deferred packet list statistics to dedicated node
It is done to structure sysctl and do not mix with Tx queue statistics
to be added.
Sponsored by: Solarflare Communications, Inc.
Approved by: gnn (mentor)
-rw-r--r-- | sys/dev/sfxge/sfxge_tx.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/sys/dev/sfxge/sfxge_tx.c b/sys/dev/sfxge/sfxge_tx.c index 716e64c..8fd7c2b 100644 --- a/sys/dev/sfxge/sfxge_tx.c +++ b/sys/dev/sfxge/sfxge_tx.c @@ -1379,11 +1379,13 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index, enum sfxge_txq_type type, unsigned int evq_index) { char name[16]; + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->dev); struct sysctl_oid *txq_node; struct sfxge_txq *txq; struct sfxge_evq *evq; #ifdef SFXGE_HAVE_MQ struct sfxge_tx_dpl *stdp; + struct sysctl_oid *dpl_node; #endif efsys_mem_t *esmp; unsigned int nmaps; @@ -1432,10 +1434,8 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index, } snprintf(name, sizeof(name), "%u", txq_index); - txq_node = SYSCTL_ADD_NODE( - device_get_sysctl_ctx(sc->dev), - SYSCTL_CHILDREN(sc->txqs_node), - OID_AUTO, name, CTLFLAG_RD, NULL, ""); + txq_node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sc->txqs_node), + OID_AUTO, name, CTLFLAG_RD, NULL, ""); if (txq_node == NULL) { rc = ENOMEM; goto fail_txq_node; @@ -1475,21 +1475,25 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index, SFXGE_TXQ_LOCK_INIT(txq, device_get_nameunit(sc->dev), txq_index); - SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), - SYSCTL_CHILDREN(txq_node), OID_AUTO, - "dpl_get_count", CTLFLAG_RD | CTLFLAG_STATS, + dpl_node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(txq_node), OID_AUTO, + "dpl", CTLFLAG_RD, NULL, + "Deferred packet list statistics"); + if (dpl_node == NULL) { + rc = ENOMEM; + goto fail_dpl_node; + } + + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(dpl_node), OID_AUTO, + "get_count", CTLFLAG_RD | CTLFLAG_STATS, &stdp->std_get_count, 0, ""); - SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), - SYSCTL_CHILDREN(txq_node), OID_AUTO, - "dpl_get_non_tcp_count", CTLFLAG_RD | CTLFLAG_STATS, + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(dpl_node), OID_AUTO, + "get_non_tcp_count", CTLFLAG_RD | CTLFLAG_STATS, &stdp->std_get_non_tcp_count, 0, ""); - SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), - SYSCTL_CHILDREN(txq_node), OID_AUTO, - "dpl_get_hiwat", CTLFLAG_RD | CTLFLAG_STATS, + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(dpl_node), OID_AUTO, + "get_hiwat", CTLFLAG_RD | CTLFLAG_STATS, &stdp->std_get_hiwat, 0, ""); - SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), - SYSCTL_CHILDREN(txq_node), OID_AUTO, - "dpl_put_hiwat", CTLFLAG_RD | CTLFLAG_STATS, + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(dpl_node), OID_AUTO, + "put_hiwat", CTLFLAG_RD | CTLFLAG_STATS, &stdp->std_put_hiwat, 0, ""); #endif @@ -1500,6 +1504,7 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index, return (0); +fail_dpl_node: fail_tx_dpl_put_max: fail_tx_dpl_get_max: fail3: |