Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/t4_main.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 1,328 Lines • ▼ Show 20 Lines | #endif | ||||
s->niq = s->nrxq + 1; /* 1 extra for firmware event queue */ | s->niq = s->nrxq + 1; /* 1 extra for firmware event queue */ | ||||
#if defined(TCP_OFFLOAD) || defined(RATELIMIT) | #if defined(TCP_OFFLOAD) || defined(RATELIMIT) | ||||
if (is_offload(sc) || is_ethoffload(sc)) { | if (is_offload(sc) || is_ethoffload(sc)) { | ||||
s->nofldtxq = nports * iaq.nofldtxq; | s->nofldtxq = nports * iaq.nofldtxq; | ||||
if (num_vis > 1) | if (num_vis > 1) | ||||
s->nofldtxq += nports * (num_vis - 1) * iaq.nofldtxq_vi; | s->nofldtxq += nports * (num_vis - 1) * iaq.nofldtxq_vi; | ||||
s->neq += s->nofldtxq; | s->neq += s->nofldtxq; | ||||
s->ofld_txq = malloc(s->nofldtxq * sizeof(struct sge_wrq), | s->ofld_txq = malloc(s->nofldtxq * sizeof(struct sge_ofld_txq), | ||||
jhb: Using 'sizeof(*s->ofld_txq)' here instead of the type would perhaps have been more future proof. | |||||
M_CXGBE, M_ZERO | M_WAITOK); | M_CXGBE, M_ZERO | M_WAITOK); | ||||
} | } | ||||
#endif | #endif | ||||
#ifdef TCP_OFFLOAD | #ifdef TCP_OFFLOAD | ||||
if (is_offload(sc)) { | if (is_offload(sc)) { | ||||
s->nofldrxq = nports * iaq.nofldrxq; | s->nofldrxq = nports * iaq.nofldrxq; | ||||
if (num_vis > 1) | if (num_vis > 1) | ||||
s->nofldrxq += nports * (num_vis - 1) * iaq.nofldrxq_vi; | s->nofldrxq += nports * (num_vis - 1) * iaq.nofldrxq_vi; | ||||
▲ Show 20 Lines • Show All 4,752 Lines • ▼ Show 20 Lines | vi_full_uninit(struct vi_info *vi) | ||||
struct adapter *sc = pi->adapter; | struct adapter *sc = pi->adapter; | ||||
int i; | int i; | ||||
struct sge_rxq *rxq; | struct sge_rxq *rxq; | ||||
struct sge_txq *txq; | struct sge_txq *txq; | ||||
#ifdef TCP_OFFLOAD | #ifdef TCP_OFFLOAD | ||||
struct sge_ofld_rxq *ofld_rxq; | struct sge_ofld_rxq *ofld_rxq; | ||||
#endif | #endif | ||||
#if defined(TCP_OFFLOAD) || defined(RATELIMIT) | #if defined(TCP_OFFLOAD) || defined(RATELIMIT) | ||||
struct sge_wrq *ofld_txq; | struct sge_ofld_txq *ofld_txq; | ||||
#endif | #endif | ||||
if (vi->flags & VI_INIT_DONE) { | if (vi->flags & VI_INIT_DONE) { | ||||
/* Need to quiesce queues. */ | /* Need to quiesce queues. */ | ||||
/* XXX: Only for the first VI? */ | /* XXX: Only for the first VI? */ | ||||
if (IS_MAIN_VI(vi) && !(sc->flags & IS_VF)) | if (IS_MAIN_VI(vi) && !(sc->flags & IS_VF)) | ||||
quiesce_wrq(sc, &sc->sge.ctrlq[pi->port_id]); | quiesce_wrq(sc, &sc->sge.ctrlq[pi->port_id]); | ||||
for_each_txq(vi, i, txq) { | for_each_txq(vi, i, txq) { | ||||
quiesce_txq(sc, txq); | quiesce_txq(sc, txq); | ||||
} | } | ||||
#if defined(TCP_OFFLOAD) || defined(RATELIMIT) | #if defined(TCP_OFFLOAD) || defined(RATELIMIT) | ||||
for_each_ofld_txq(vi, i, ofld_txq) { | for_each_ofld_txq(vi, i, ofld_txq) { | ||||
quiesce_wrq(sc, ofld_txq); | quiesce_wrq(sc, &ofld_txq->wrq); | ||||
} | } | ||||
#endif | #endif | ||||
for_each_rxq(vi, i, rxq) { | for_each_rxq(vi, i, rxq) { | ||||
quiesce_iq(sc, &rxq->iq); | quiesce_iq(sc, &rxq->iq); | ||||
quiesce_fl(sc, &rxq->fl); | quiesce_fl(sc, &rxq->fl); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 4,535 Lines • ▼ Show 20 Lines | |||||
clear_stats(struct adapter *sc, u_int port_id) | clear_stats(struct adapter *sc, u_int port_id) | ||||
{ | { | ||||
int i, v, chan_map; | int i, v, chan_map; | ||||
struct port_info *pi; | struct port_info *pi; | ||||
struct vi_info *vi; | struct vi_info *vi; | ||||
struct sge_rxq *rxq; | struct sge_rxq *rxq; | ||||
struct sge_txq *txq; | struct sge_txq *txq; | ||||
struct sge_wrq *wrq; | struct sge_wrq *wrq; | ||||
#if defined(TCP_OFFLOAD) || defined(RATELIMIT) | |||||
struct sge_ofld_txq *ofld_txq; | |||||
#endif | |||||
#ifdef TCP_OFFLOAD | #ifdef TCP_OFFLOAD | ||||
struct sge_ofld_rxq *ofld_rxq; | struct sge_ofld_rxq *ofld_rxq; | ||||
#endif | #endif | ||||
if (port_id >= sc->params.nports) | if (port_id >= sc->params.nports) | ||||
return (EINVAL); | return (EINVAL); | ||||
pi = sc->port[port_id]; | pi = sc->port[port_id]; | ||||
if (pi == NULL) | if (pi == NULL) | ||||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | #endif | ||||
txq->kern_tls_fin = 0; | txq->kern_tls_fin = 0; | ||||
txq->kern_tls_fin_short = 0; | txq->kern_tls_fin_short = 0; | ||||
txq->kern_tls_cbc = 0; | txq->kern_tls_cbc = 0; | ||||
txq->kern_tls_gcm = 0; | txq->kern_tls_gcm = 0; | ||||
mp_ring_reset_stats(txq->r); | mp_ring_reset_stats(txq->r); | ||||
} | } | ||||
#if defined(TCP_OFFLOAD) || defined(RATELIMIT) | #if defined(TCP_OFFLOAD) || defined(RATELIMIT) | ||||
for_each_ofld_txq(vi, i, wrq) { | for_each_ofld_txq(vi, i, ofld_txq) { | ||||
wrq->tx_wrs_direct = 0; | ofld_txq->wrq.tx_wrs_direct = 0; | ||||
wrq->tx_wrs_copied = 0; | ofld_txq->wrq.tx_wrs_copied = 0; | ||||
} | } | ||||
#endif | #endif | ||||
#ifdef TCP_OFFLOAD | #ifdef TCP_OFFLOAD | ||||
for_each_ofld_rxq(vi, i, ofld_rxq) { | for_each_ofld_rxq(vi, i, ofld_rxq) { | ||||
ofld_rxq->fl.cl_allocated = 0; | ofld_rxq->fl.cl_allocated = 0; | ||||
ofld_rxq->fl.cl_recycled = 0; | ofld_rxq->fl.cl_recycled = 0; | ||||
ofld_rxq->fl.cl_fast_recycled = 0; | ofld_rxq->fl.cl_fast_recycled = 0; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,140 Lines • Show Last 20 Lines |
Using 'sizeof(*s->ofld_txq)' here instead of the type would perhaps have been more future proof.