svn commit: r309564 - in stable: 10/sys/dev/cxgbe 11/sys/dev/cxgbe
John Baldwin
jhb at FreeBSD.org
Mon Dec 5 22:13:11 UTC 2016
Author: jhb
Date: Mon Dec 5 22:13:09 2016
New Revision: 309564
URL: https://svnweb.freebsd.org/changeset/base/309564
Log:
MFC 306277:
cxgbe(4): Make the location/length of all descriptor rings available in
the sysctl MIB.
Modified:
stable/10/sys/dev/cxgbe/t4_sge.c
Directory Properties:
stable/10/ (props changed)
Changes in other areas also in this revision:
Modified:
stable/11/sys/dev/cxgbe/t4_sge.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/10/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- stable/10/sys/dev/cxgbe/t4_sge.c Mon Dec 5 21:52:10 2016 (r309563)
+++ stable/10/sys/dev/cxgbe/t4_sge.c Mon Dec 5 22:13:09 2016 (r309564)
@@ -176,8 +176,8 @@ static int free_ring(struct adapter *, b
static int alloc_iq_fl(struct vi_info *, struct sge_iq *, struct sge_fl *,
int, int);
static int free_iq_fl(struct vi_info *, struct sge_iq *, struct sge_fl *);
-static void add_fl_sysctls(struct sysctl_ctx_list *, struct sysctl_oid *,
- struct sge_fl *);
+static void add_fl_sysctls(struct adapter *, struct sysctl_ctx_list *,
+ struct sysctl_oid *, struct sge_fl *);
static int alloc_fwq(struct adapter *);
static int free_fwq(struct adapter *);
static int alloc_mgmtq(struct adapter *);
@@ -2869,8 +2869,8 @@ free_iq_fl(struct vi_info *vi, struct sg
}
static void
-add_fl_sysctls(struct sysctl_ctx_list *ctx, struct sysctl_oid *oid,
- struct sge_fl *fl)
+add_fl_sysctls(struct adapter *sc, struct sysctl_ctx_list *ctx,
+ struct sysctl_oid *oid, struct sge_fl *fl)
{
struct sysctl_oid_list *children = SYSCTL_CHILDREN(oid);
@@ -2878,6 +2878,11 @@ add_fl_sysctls(struct sysctl_ctx_list *c
"freelist");
children = SYSCTL_CHILDREN(oid);
+ SYSCTL_ADD_UAUTO(ctx, children, OID_AUTO, "ba", CTLFLAG_RD,
+ &fl->ba, "bus address of descriptor ring");
+ SYSCTL_ADD_INT(ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL,
+ fl->sidx * EQ_ESIZE + sc->params.sge.spg_len,
+ "desc ring size in bytes");
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cntxt_id",
CTLTYPE_INT | CTLFLAG_RD, &fl->cntxt_id, 0, sysctl_uint16, "I",
"SGE context id of the freelist");
@@ -2933,6 +2938,10 @@ alloc_fwq(struct adapter *sc)
NULL, "firmware event queue");
children = SYSCTL_CHILDREN(oid);
+ SYSCTL_ADD_UAUTO(&sc->ctx, children, OID_AUTO, "ba", CTLFLAG_RD,
+ &fwq->ba, "bus address of descriptor ring");
+ SYSCTL_ADD_INT(&sc->ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL,
+ fwq->qsize * IQ_ESIZE, "descriptor ring size in bytes");
SYSCTL_ADD_PROC(&sc->ctx, children, OID_AUTO, "abs_id",
CTLTYPE_INT | CTLFLAG_RD, &fwq->abs_id, 0, sysctl_uint16, "I",
"absolute id of the queue");
@@ -3044,6 +3053,10 @@ alloc_rxq(struct vi_info *vi, struct sge
NULL, "rx queue");
children = SYSCTL_CHILDREN(oid);
+ SYSCTL_ADD_UAUTO(&vi->ctx, children, OID_AUTO, "ba", CTLFLAG_RD,
+ &rxq->iq.ba, "bus address of descriptor ring");
+ SYSCTL_ADD_INT(&vi->ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL,
+ rxq->iq.qsize * IQ_ESIZE, "descriptor ring size in bytes");
SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "abs_id",
CTLTYPE_INT | CTLFLAG_RD, &rxq->iq.abs_id, 0, sysctl_uint16, "I",
"absolute id of the queue");
@@ -3065,7 +3078,7 @@ alloc_rxq(struct vi_info *vi, struct sge
CTLFLAG_RD, &rxq->vlan_extraction,
"# of times hardware extracted 802.1Q tag");
- add_fl_sysctls(&vi->ctx, oid, &rxq->fl);
+ add_fl_sysctls(sc, &vi->ctx, oid, &rxq->fl);
return (rc);
}
@@ -3094,12 +3107,13 @@ static int
alloc_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq *ofld_rxq,
int intr_idx, int idx, struct sysctl_oid *oid)
{
+ struct port_info *pi = vi->pi;
int rc;
struct sysctl_oid_list *children;
char name[16];
rc = alloc_iq_fl(vi, &ofld_rxq->iq, &ofld_rxq->fl, intr_idx,
- vi->pi->rx_chan_map);
+ pi->rx_chan_map);
if (rc != 0)
return (rc);
@@ -3110,6 +3124,10 @@ alloc_ofld_rxq(struct vi_info *vi, struc
NULL, "rx queue");
children = SYSCTL_CHILDREN(oid);
+ SYSCTL_ADD_UAUTO(&vi->ctx, children, OID_AUTO, "ba", CTLFLAG_RD,
+ &ofld_rxq->iq.ba, "bus address of descriptor ring");
+ SYSCTL_ADD_INT(&vi->ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL,
+ ofld_rxq->iq.qsize * IQ_ESIZE, "descriptor ring size in bytes");
SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "abs_id",
CTLTYPE_INT | CTLFLAG_RD, &ofld_rxq->iq.abs_id, 0, sysctl_uint16,
"I", "absolute id of the queue");
@@ -3120,7 +3138,7 @@ alloc_ofld_rxq(struct vi_info *vi, struc
CTLTYPE_INT | CTLFLAG_RD, &ofld_rxq->iq.cidx, 0, sysctl_uint16, "I",
"consumer index");
- add_fl_sysctls(&vi->ctx, oid, &ofld_rxq->fl);
+ add_fl_sysctls(pi->adapter, &vi->ctx, oid, &ofld_rxq->fl);
return (rc);
}
@@ -3541,6 +3559,11 @@ alloc_wrq(struct adapter *sc, struct vi_
wrq->nwr_pending = 0;
wrq->ndesc_needed = 0;
+ SYSCTL_ADD_UAUTO(ctx, children, OID_AUTO, "ba", CTLFLAG_RD,
+ &wrq->eq.ba, "bus address of descriptor ring");
+ SYSCTL_ADD_INT(ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL,
+ wrq->eq.sidx * EQ_ESIZE + sc->params.sge.spg_len,
+ "desc ring size in bytes");
SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "cntxt_id", CTLFLAG_RD,
&wrq->eq.cntxt_id, 0, "SGE context id of the queue");
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cidx",
@@ -3549,6 +3572,8 @@ alloc_wrq(struct adapter *sc, struct vi_
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "pidx",
CTLTYPE_INT | CTLFLAG_RD, &wrq->eq.pidx, 0, sysctl_uint16, "I",
"producer index");
+ SYSCTL_ADD_INT(ctx, children, OID_AUTO, "sidx", CTLFLAG_RD, NULL,
+ wrq->eq.sidx, "status page index");
SYSCTL_ADD_UQUAD(ctx, children, OID_AUTO, "tx_wrs_direct", CTLFLAG_RD,
&wrq->tx_wrs_direct, "# of work requests (direct)");
SYSCTL_ADD_UQUAD(ctx, children, OID_AUTO, "tx_wrs_copied", CTLFLAG_RD,
@@ -3628,6 +3653,11 @@ alloc_txq(struct vi_info *vi, struct sge
NULL, "tx queue");
children = SYSCTL_CHILDREN(oid);
+ SYSCTL_ADD_UAUTO(&vi->ctx, children, OID_AUTO, "ba", CTLFLAG_RD,
+ &eq->ba, "bus address of descriptor ring");
+ SYSCTL_ADD_INT(&vi->ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL,
+ eq->sidx * EQ_ESIZE + sc->params.sge.spg_len,
+ "desc ring size in bytes");
SYSCTL_ADD_UINT(&vi->ctx, children, OID_AUTO, "abs_id", CTLFLAG_RD,
&eq->abs_id, 0, "absolute id of the queue");
SYSCTL_ADD_UINT(&vi->ctx, children, OID_AUTO, "cntxt_id", CTLFLAG_RD,
@@ -3638,6 +3668,8 @@ alloc_txq(struct vi_info *vi, struct sge
SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "pidx",
CTLTYPE_INT | CTLFLAG_RD, &eq->pidx, 0, sysctl_uint16, "I",
"producer index");
+ SYSCTL_ADD_INT(&vi->ctx, children, OID_AUTO, "sidx", CTLFLAG_RD, NULL,
+ eq->sidx, "status page index");
SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "tc",
CTLTYPE_INT | CTLFLAG_RW, vi, idx, sysctl_tc, "I",
More information about the svn-src-stable
mailing list