Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/bnxt/bnxt_txrx.c
Context not available. | |||||
uint8_t flid; | uint8_t flid; | ||||
uint64_t *paddrs; | uint64_t *paddrs; | ||||
caddr_t *vaddrs; | caddr_t *vaddrs; | ||||
qidx_t *frag_idxs; | |||||
rxqid = iru->iru_qsidx; | rxqid = iru->iru_qsidx; | ||||
count = iru->iru_count; | count = iru->iru_count; | ||||
Context not available. | |||||
flid = iru->iru_flidx; | flid = iru->iru_flidx; | ||||
vaddrs = iru->iru_vaddrs; | vaddrs = iru->iru_vaddrs; | ||||
paddrs = iru->iru_paddrs; | paddrs = iru->iru_paddrs; | ||||
frag_idxs = iru->iru_idxs; | |||||
erj: What's this new field for? Are other drivers supposed to use it for things? | |||||
Not Done Inline ActionsDriver really need this only when it can receive out-of-order completions, otherwise not needed. bhargava.marreddy_broadcom.com: Driver really need this only when it can receive out-of-order completions, otherwise not needed. | |||||
if (flid == 0) { | if (flid == 0) { | ||||
rx_ring = &softc->rx_rings[rxqid]; | rx_ring = &softc->rx_rings[rxqid]; | ||||
Context not available. | |||||
rxbd[pidx].flags_type = htole16(type); | rxbd[pidx].flags_type = htole16(type); | ||||
rxbd[pidx].len = htole16(len); | rxbd[pidx].len = htole16(len); | ||||
/* No need to byte-swap the opaque value */ | /* No need to byte-swap the opaque value */ | ||||
rxbd[pidx].opaque = ((rxqid & 0xff) << 24) | (flid << 16) | rxbd[pidx].opaque = (((rxqid & 0xff) << 24) | (flid << 16) | ||||
| pidx; | | (frag_idxs[i])); | ||||
rxbd[pidx].addr = htole64(paddrs[i]); | rxbd[pidx].addr = htole64(paddrs[i]); | ||||
if (++pidx == rx_ring->ring_size) | if (++pidx == rx_ring->ring_size) | ||||
pidx = 0; | pidx = 0; | ||||
Context not available. | |||||
struct bnxt_softc *softc = (struct bnxt_softc *)sc; | struct bnxt_softc *softc = (struct bnxt_softc *)sc; | ||||
struct bnxt_cp_ring *cpr = &softc->rx_cp_rings[rxqid]; | struct bnxt_cp_ring *cpr = &softc->rx_cp_rings[rxqid]; | ||||
struct rx_pkt_cmpl *rcp; | struct rx_pkt_cmpl *rcp; | ||||
struct rx_tpa_start_cmpl *rtpa; | |||||
struct rx_tpa_end_cmpl *rtpae; | struct rx_tpa_end_cmpl *rtpae; | ||||
struct cmpl_base *cmp = (struct cmpl_base *)cpr->ring.vaddr; | struct cmpl_base *cmp = (struct cmpl_base *)cpr->ring.vaddr; | ||||
int avail = 0; | int avail = 0; | ||||
Context not available. | |||||
uint8_t ags; | uint8_t ags; | ||||
int i; | int i; | ||||
uint16_t type; | uint16_t type; | ||||
uint8_t agg_id; | |||||
for (;;) { | for (;;) { | ||||
NEXT_CP_CONS_V(&cpr->ring, cons, v_bit); | NEXT_CP_CONS_V(&cpr->ring, cons, v_bit); | ||||
Context not available. | |||||
avail++; | avail++; | ||||
break; | break; | ||||
case CMPL_BASE_TYPE_RX_TPA_START: | case CMPL_BASE_TYPE_RX_TPA_START: | ||||
rtpa = (void *)&cmp[cons]; | |||||
agg_id = (rtpa->agg_id & | |||||
RX_TPA_START_CMPL_AGG_ID_MASK) >> | |||||
RX_TPA_START_CMPL_AGG_ID_SFT; | |||||
softc->tpa_start[agg_id].low = *rtpa; | |||||
NEXT_CP_CONS_V(&cpr->ring, cons, v_bit); | NEXT_CP_CONS_V(&cpr->ring, cons, v_bit); | ||||
CMPL_PREFETCH_NEXT(cpr, cons); | CMPL_PREFETCH_NEXT(cpr, cons); | ||||
if (!CMP_VALID(&cmp[cons], v_bit)) | if (!CMP_VALID(&cmp[cons], v_bit)) | ||||
goto cmpl_invalid; | goto cmpl_invalid; | ||||
softc->tpa_start[agg_id].high = | |||||
((struct rx_tpa_start_cmpl_hi *)cmp)[cons]; | |||||
break; | break; | ||||
case CMPL_BASE_TYPE_RX_AGG: | case CMPL_BASE_TYPE_RX_AGG: | ||||
break; | break; | ||||
Context not available. | |||||
/* Get the agg_id */ | /* Get the agg_id */ | ||||
agg_id = (agend->agg_id & RX_TPA_END_CMPL_AGG_ID_MASK) >> | agg_id = (agend->agg_id & RX_TPA_END_CMPL_AGG_ID_MASK) >> | ||||
RX_TPA_END_CMPL_AGG_ID_SFT; | RX_TPA_END_CMPL_AGG_ID_SFT; | ||||
tpas = &softc->tpa_start[agg_id]; | tpas = &(softc->rx_rings[ri->iri_qsidx].tpa_start[agg_id]); | ||||
/* Extract from the first 16-byte BD */ | /* Extract from the first 16-byte BD */ | ||||
if (le16toh(tpas->low.flags_type) & RX_TPA_START_CMPL_FLAGS_RSS_VALID) { | if (le16toh(tpas->low.flags_type) & RX_TPA_START_CMPL_FLAGS_RSS_VALID) { | ||||
Context not available. | |||||
RX_TPA_END_CMPL_AGG_BUFS_SFT; | RX_TPA_END_CMPL_AGG_BUFS_SFT; | ||||
ri->iri_nfrags = ags + 1; | ri->iri_nfrags = ags + 1; | ||||
/* No need to byte-swap the opaque value */ | /* No need to byte-swap the opaque value */ | ||||
ri->iri_frags[0].irf_flid = (tpas->low.opaque >> 16) & 0xff; | ri->iri_frags[0].irf_flid = ((tpas->low.opaque >> 16) & 0xff); | ||||
ri->iri_frags[0].irf_idx = tpas->low.opaque & 0xffff; | ri->iri_frags[0].irf_idx = (tpas->low.opaque & 0xffff); | ||||
ri->iri_frags[0].irf_len = le16toh(tpas->low.len); | ri->iri_frags[0].irf_len = le16toh(tpas->low.len); | ||||
ri->iri_len = le16toh(tpas->low.len); | ri->iri_len = le16toh(tpas->low.len); | ||||
Context not available. | |||||
acp = &((struct rx_abuf_cmpl *)cpr->ring.vaddr)[cpr->cons]; | acp = &((struct rx_abuf_cmpl *)cpr->ring.vaddr)[cpr->cons]; | ||||
/* No need to byte-swap the opaque value */ | /* No need to byte-swap the opaque value */ | ||||
ri->iri_frags[i].irf_flid = (acp->opaque >> 16) & 0xff; | ri->iri_frags[i].irf_flid = ((acp->opaque >> 16) & 0xff); | ||||
ri->iri_frags[i].irf_idx = acp->opaque & 0xffff; | ri->iri_frags[i].irf_idx = (acp->opaque & 0xffff); | ||||
ri->iri_frags[i].irf_len = le16toh(acp->len); | ri->iri_frags[i].irf_len = le16toh(acp->len); | ||||
ri->iri_len += le16toh(acp->len); | ri->iri_len += le16toh(acp->len); | ||||
} | } | ||||
Context not available. | |||||
/* And finally, the empty BD at the end... */ | /* And finally, the empty BD at the end... */ | ||||
ri->iri_nfrags++; | ri->iri_nfrags++; | ||||
/* No need to byte-swap the opaque value */ | /* No need to byte-swap the opaque value */ | ||||
ri->iri_frags[i].irf_flid = (agend->opaque >> 16) % 0xff; | ri->iri_frags[i].irf_flid = ((agend->opaque >> 16) & 0xff); | ||||
ri->iri_frags[i].irf_idx = agend->opaque & 0xffff; | ri->iri_frags[i].irf_idx = (agend->opaque & 0xffff); | ||||
ri->iri_frags[i].irf_len = le16toh(agend->len); | ri->iri_frags[i].irf_len = le16toh(agend->len); | ||||
ri->iri_len += le16toh(agend->len); | ri->iri_len += le16toh(agend->len); | ||||
Context not available. | |||||
{ | { | ||||
struct bnxt_softc *softc = (struct bnxt_softc *)sc; | struct bnxt_softc *softc = (struct bnxt_softc *)sc; | ||||
struct bnxt_cp_ring *cpr = &softc->rx_cp_rings[ri->iri_qsidx]; | struct bnxt_cp_ring *cpr = &softc->rx_cp_rings[ri->iri_qsidx]; | ||||
struct cmpl_base *cmp_q = (struct cmpl_base *)cpr->ring.vaddr; | |||||
struct cmpl_base *cmp; | struct cmpl_base *cmp; | ||||
struct rx_tpa_start_cmpl *rtpa; | |||||
uint16_t flags_type; | uint16_t flags_type; | ||||
uint16_t type; | uint16_t type; | ||||
uint8_t agg_id; | |||||
for (;;) { | for (;;) { | ||||
NEXT_CP_CONS_V(&cpr->ring, cpr->cons, cpr->v_bit); | NEXT_CP_CONS_V(&cpr->ring, cpr->cons, cpr->v_bit); | ||||
Context not available. | |||||
case CMPL_BASE_TYPE_RX_TPA_END: | case CMPL_BASE_TYPE_RX_TPA_END: | ||||
return bnxt_pkt_get_tpa(softc, ri, cpr, flags_type); | return bnxt_pkt_get_tpa(softc, ri, cpr, flags_type); | ||||
case CMPL_BASE_TYPE_RX_TPA_START: | case CMPL_BASE_TYPE_RX_TPA_START: | ||||
rtpa = (void *)&cmp_q[cpr->cons]; | |||||
agg_id = (rtpa->agg_id & | |||||
RX_TPA_START_CMPL_AGG_ID_MASK) >> | |||||
RX_TPA_START_CMPL_AGG_ID_SFT; | |||||
softc->rx_rings[ri->iri_qsidx].tpa_start[agg_id].low = *rtpa; | |||||
NEXT_CP_CONS_V(&cpr->ring, cpr->cons, cpr->v_bit); | NEXT_CP_CONS_V(&cpr->ring, cpr->cons, cpr->v_bit); | ||||
ri->iri_cidx = RING_NEXT(&cpr->ring, ri->iri_cidx); | ri->iri_cidx = RING_NEXT(&cpr->ring, ri->iri_cidx); | ||||
CMPL_PREFETCH_NEXT(cpr, cpr->cons); | CMPL_PREFETCH_NEXT(cpr, cpr->cons); | ||||
softc->rx_rings[ri->iri_qsidx].tpa_start[agg_id].high = | |||||
((struct rx_tpa_start_cmpl_hi *)cmp_q)[cpr->cons]; | |||||
break; | break; | ||||
default: | default: | ||||
device_printf(softc->dev, | device_printf(softc->dev, | ||||
Context not available. |
What's this new field for? Are other drivers supposed to use it for things?