Lines Matching +full:txrx +full:-

1 /* SPDX-License-Identifier: BSD-3-Clause */
60 * iflib txrx method declarations
82 (((struct ice_32b_rx_flex_desc_nic *)desc)->field)
123 * _ice_ift_txd_encap - prepare Tx descriptors for a packet
132 * Return 0 on success, non-zero error code on failure.
137 int nsegs = pi->ipi_nsegs;
138 bus_dma_segment_t *segs = pi->ipi_segs;
144 i = pi->ipi_pidx;
147 if (pi->ipi_csum_flags & ICE_CSUM_OFFLOAD) {
149 if (pi->ipi_csum_flags & CSUM_TSO) {
156 if (pi->ipi_mflags & M_VLANTAG)
159 mask = txq->desc_count - 1;
163 txd = &txq->tx_base[i];
166 txd->buf_addr = htole64(segs[j].ds_addr);
167 txd->cmd_type_offset_bsz =
172 | ((u64)htole16(pi->ipi_vtag) << ICE_TXD_QW1_L2TAG1_S));
174 txq->stats.tx_bytes += seglen;
181 txd->cmd_type_offset_bsz |=
185 txq->tx_rsq[txq->tx_rs_pidx] = pidx_last;
186 txq->tx_rs_pidx = (txq->tx_rs_pidx+1) & mask;
187 MPASS(txq->tx_rs_pidx != txq->tx_rs_cidx);
189 pi->ipi_new_pidx = i;
191 ++txq->stats.tx_packets;
196 * ice_ift_txd_encap - prepare Tx descriptors for a packet
205 * Return 0 on success, non-zero error code on failure.
211 struct ice_tx_queue *txq = &sc->pf_vsi.tx_queues[pi->ipi_qsidx];
217 * ice_ift_txd_flush - Flush Tx descriptors to hardware
229 struct ice_tx_queue *txq = &sc->pf_vsi.tx_queues[txqid];
230 struct ice_hw *hw = &sc->hw;
232 wr32(hw, txq->tail, pidx);
236 * _ice_ift_txd_credits_update - cleanup Tx descriptors
257 rs_cidx = txq->tx_rs_cidx;
258 if (rs_cidx == txq->tx_rs_pidx)
260 cur = txq->tx_rsq[rs_cidx];
262 is_done = ice_is_tx_desc_done(&txq->tx_base[cur]);
269 prev = txq->tx_cidx_processed;
270 ntxd = txq->desc_count;
273 delta = (int32_t)cur - (int32_t)prev;
279 rs_cidx = (rs_cidx + 1) & (ntxd-1);
280 if (rs_cidx == txq->tx_rs_pidx)
282 cur = txq->tx_rsq[rs_cidx];
284 is_done = ice_is_tx_desc_done(&txq->tx_base[cur]);
287 txq->tx_rs_cidx = rs_cidx;
288 txq->tx_cidx_processed = prev;
294 * ice_ift_txd_credits_update - cleanup PF VSI Tx descriptors
308 struct ice_tx_queue *txq = &sc->pf_vsi.tx_queues[txqid];
314 * _ice_ift_rxd_available - Return number of available Rx packets
329 nrxd = rxq->desc_count;
331 for (cnt = 0, i = pidx; cnt < nrxd - 1 && cnt < budget;) {
332 rxd = &rxq->rx_base[i];
333 status0 = le16toh(rxd->wb.status_error0);
347 * ice_ift_rxd_available - Return number of available Rx packets
360 struct ice_rx_queue *rxq = &sc->pf_vsi.rx_queues[rxqid];
366 * ice_ift_rxd_pkt_get - Called by iflib to send data to upper layer
377 struct ice_rx_queue *rxq = &sc->pf_vsi.rx_queues[ri->iri_qsidx];
383 * _ice_ift_rxd_pkt_get - Called by iflib to send data to upper layer
400 cidx = ri->iri_cidx;
406 cur = &rxq->rx_base[cidx];
407 status0 = le16toh(cur->wb.status_error0);
408 plen = le16toh(cur->wb.pkt_len) &
414 ri->iri_len += plen;
416 cur->wb.status_error0 = 0;
419 ri->iri_frags[i].irf_flid = 0;
420 ri->iri_frags[i].irf_idx = cidx;
421 ri->iri_frags[i].irf_len = plen;
422 if (++cidx == rxq->desc_count)
433 rxq->stats.desc_errs++;
439 ri->iri_vtag = le16toh(cur->wb.l2tag1);
440 ri->iri_flags |= M_VLANTAG;
444 rxq->stats.rx_packets++;
445 rxq->stats.rx_bytes += ri->iri_len;
448 ptype = le16toh(cur->wb.ptype_flex_flags0) &
450 if ((if_getcapenable(ri->iri_ifp) & IFCAP_RXCSUM) != 0)
451 ice_rx_checksum(rxq, &ri->iri_csum_flags,
452 &ri->iri_csum_data, status0, ptype);
455 ri->iri_flowid = le32toh(RX_FLEX_NIC(&cur->wb, rss_hash));
456 ri->iri_rsstype = ice_ptype_to_hash(ptype);
457 ri->iri_nfrags = i;
462 * ice_ift_rxd_refill - Prepare Rx descriptors for re-use by hardware
478 paddrs = iru->iru_paddrs;
479 pidx = iru->iru_pidx;
480 qsidx = iru->iru_qsidx;
481 count = iru->iru_count;
483 rxq = &(sc->pf_vsi.rx_queues[qsidx]);
489 * _ice_ift_rxd_refill - Prepare Rx descriptors for re-use by hardware
496 * addresses to the descriptors, preparing them for re-use by the hardware.
506 rxq->rx_base[next_pidx].read.pkt_addr = htole64(paddrs[i]);
507 if (++next_pidx == (uint32_t)rxq->desc_count)
513 * ice_ift_rxd_flush - Flush Rx descriptors to hardware
527 struct ice_rx_queue *rxq = &sc->pf_vsi.rx_queues[rxqid];
533 * _ice_ift_rxd_flush - Flush Rx descriptors to hardware
544 wr32(&sc->hw, rxq->tail, pidx);
548 * ice_ift_queue_select - Select queue index to transmit packet on
563 struct ice_vsi *vsi = &sc->pf_vsi;
570 struct ifnet *ifp = (struct ifnet *)iflib_get_ifp(sc->ctx);
575 if (!ice_test_state(&sc->state, ICE_STATE_MULTIPLE_TCS)) {
578 return (m->m_pkthdr.flowid % sc->pf_vsi.num_tx_queues);
586 local_dcbx_cfg = &sc->hw.port_info->qos_cfg.local_dcbx_cfg;
589 if ((local_dcbx_cfg->pfc_mode == ICE_QOS_MODE_DSCP) &&
590 (pi->ipi_flags & (IPI_TX_IPV4 | IPI_TX_IPV6))) {
591 u8 dscp_val = pi->ipi_ip_tos >> 2;
592 tc = local_dcbx_cfg->dscp_map[dscp_val];
595 if (m->m_flags & M_VLANTAG) { /* ICE_QOS_MODE_VLAN */
596 up = EVL_PRIOFTAG(m->m_pkthdr.ether_vtag);
597 tc = local_dcbx_cfg->etscfg.prio_table[up];
600 tc_base_queue = vsi->tc_info[tc].qoffset;
601 tc_qcount = vsi->tc_info[tc].qcount_tx;
604 return ((m->m_pkthdr.flowid % tc_qcount) + tc_base_queue);
610 * ice_ift_txd_credits_update_subif - cleanup subinterface VSI Tx descriptors
624 struct ice_softc *sc = mif->back;
625 struct ice_tx_queue *txq = &mif->vsi->tx_queues[txqid];
631 * ice_ift_txd_encap_subif - prepare Tx descriptors for a packet
644 struct ice_tx_queue *txq = &mif->vsi->tx_queues[pi->ipi_qsidx];
650 * ice_ift_txd_flush_subif - Flush Tx descriptors to hardware
657 * pointer to iflib for use with non-main-PF VSI TX queues.
663 struct ice_tx_queue *txq = &mif->vsi->tx_queues[txqid];
664 struct ice_hw *hw = &mif->back->hw;
666 wr32(hw, txq->tail, pidx);
670 * ice_ift_rxd_available_subif - Return number of available Rx packets
685 struct ice_rx_queue *rxq = &mif->vsi->rx_queues[rxqid];
691 * ice_ift_rxd_pkt_get_subif - Called by iflib to send data to upper layer
702 struct ice_rx_queue *rxq = &mif->vsi->rx_queues[ri->iri_qsidx];
708 * ice_ift_rxd_refill_subif - Prepare Rx descriptors for re-use by hardware
719 struct ice_rx_queue *rxq = &mif->vsi->rx_queues[iru->iru_qsidx];
725 paddrs = iru->iru_paddrs;
726 pidx = iru->iru_pidx;
727 count = iru->iru_count;
733 * ice_ift_rxd_flush_subif - Flush Rx descriptors to hardware
747 struct ice_rx_queue *rxq = &mif->vsi->rx_queues[rxqid];
749 _ice_ift_rxd_flush(mif->back, rxq, pidx);