Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/t4_sge.c
Show First 20 Lines • Show All 1,243 Lines • ▼ Show 20 Lines | if (vi->nofldrxq > 0) { | ||||
iqidx = vi->first_rxq + (i % vi->nrxq); | iqidx = vi->first_rxq + (i % vi->nrxq); | ||||
init_eq(sc, &ofld_txq->wrq.eq, EQ_OFLD, vi->qsize_txq, | init_eq(sc, &ofld_txq->wrq.eq, EQ_OFLD, vi->qsize_txq, | ||||
pi->tx_chan, sc->sge.rxq[iqidx].iq.cntxt_id, name); | pi->tx_chan, sc->sge.rxq[iqidx].iq.cntxt_id, name); | ||||
} | } | ||||
rc = alloc_ofld_txq(vi, ofld_txq, i, oid); | rc = alloc_ofld_txq(vi, ofld_txq, i, oid); | ||||
if (rc != 0) | if (rc != 0) | ||||
goto done; | goto done; | ||||
} | } | ||||
jhb: A question here is if we want to have `alloc_ofld_txq` and `free_ofld_txq` helper functions in… | |||||
#endif | #endif | ||||
done: | done: | ||||
if (rc) | if (rc) | ||||
t4_teardown_vi_queues(vi); | t4_teardown_vi_queues(vi); | ||||
return (rc); | return (rc); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 2,692 Lines • ▼ Show 20 Lines | alloc_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq *ofld_rxq, | ||||
children = SYSCTL_CHILDREN(oid); | children = SYSCTL_CHILDREN(oid); | ||||
snprintf(name, sizeof(name), "%d", idx); | snprintf(name, sizeof(name), "%d", idx); | ||||
oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, | oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, | ||||
CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "rx queue"); | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "rx queue"); | ||||
add_iq_sysctls(&vi->ctx, oid, &ofld_rxq->iq); | add_iq_sysctls(&vi->ctx, oid, &ofld_rxq->iq); | ||||
add_fl_sysctls(pi->adapter, &vi->ctx, oid, &ofld_rxq->fl); | add_fl_sysctls(pi->adapter, &vi->ctx, oid, &ofld_rxq->fl); | ||||
SYSCTL_ADD_ULONG(&vi->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, | |||||
"rx_toe_tls_records", CTLFLAG_RD, &ofld_rxq->rx_toe_tls_records, | |||||
"# of TOE TLS records received"); | |||||
SYSCTL_ADD_ULONG(&vi->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, | |||||
"rx_toe_tls_octets", CTLFLAG_RD, &ofld_rxq->rx_toe_tls_octets, | |||||
"# of payload octets in received TOE TLS records"); | |||||
return (rc); | return (rc); | ||||
} | } | ||||
static int | static int | ||||
free_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq *ofld_rxq) | free_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq *ofld_rxq) | ||||
{ | { | ||||
int rc; | int rc; | ||||
▲ Show 20 Lines • Show All 520 Lines • ▼ Show 20 Lines | alloc_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq, int idx, | ||||
char name[16]; | char name[16]; | ||||
int rc; | int rc; | ||||
children = SYSCTL_CHILDREN(oid); | children = SYSCTL_CHILDREN(oid); | ||||
snprintf(name, sizeof(name), "%d", idx); | snprintf(name, sizeof(name), "%d", idx); | ||||
oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, | oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, | ||||
CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "offload tx queue"); | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "offload tx queue"); | ||||
children = SYSCTL_CHILDREN(oid); | |||||
rc = alloc_wrq(sc, vi, &ofld_txq->wrq, oid); | rc = alloc_wrq(sc, vi, &ofld_txq->wrq, oid); | ||||
if (rc != 0) | if (rc != 0) | ||||
return (rc); | return (rc); | ||||
ofld_txq->tx_toe_tls_records = counter_u64_alloc(M_WAITOK); | |||||
ofld_txq->tx_toe_tls_octets = counter_u64_alloc(M_WAITOK); | |||||
SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO, | |||||
"tx_toe_tls_records", CTLFLAG_RD, &ofld_txq->tx_toe_tls_records, | |||||
"# of TOE TLS records transmitted"); | |||||
SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO, | |||||
"tx_toe_tls_octets", CTLFLAG_RD, &ofld_txq->tx_toe_tls_octets, | |||||
"# of payload octets in transmitted TOE TLS records"); | |||||
return (rc); | return (rc); | ||||
} | } | ||||
static int | static int | ||||
free_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq) | free_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq) | ||||
{ | { | ||||
struct adapter *sc = vi->adapter; | struct adapter *sc = vi->adapter; | ||||
int rc; | int rc; | ||||
rc = free_wrq(sc, &ofld_txq->wrq); | rc = free_wrq(sc, &ofld_txq->wrq); | ||||
if (rc != 0) | if (rc != 0) | ||||
return (rc); | return (rc); | ||||
counter_u64_free(ofld_txq->tx_toe_tls_records); | |||||
counter_u64_free(ofld_txq->tx_toe_tls_octets); | |||||
bzero(ofld_txq, sizeof(*ofld_txq)); | bzero(ofld_txq, sizeof(*ofld_txq)); | ||||
return (0); | return (0); | ||||
} | } | ||||
#endif | #endif | ||||
static void | static void | ||||
oneseg_dma_callback(void *arg, bus_dma_segment_t *segs, int nseg, int error) | oneseg_dma_callback(void *arg, bus_dma_segment_t *segs, int nseg, int error) | ||||
▲ Show 20 Lines • Show All 2,038 Lines • Show Last 20 Lines |
A question here is if we want to have alloc_ofld_txq and free_ofld_txq helper functions in t4_sge.c as we currently have for offload RX queues. If so, I would probably go back and do that in the previous commit that introduced struct sge_ofld_txq