return;
bulks = free_space / RTE_DIM(objs);
+ /* refill_threshold guarantees that bulks is positive */
+ SFC_ASSERT(bulks > 0);
id = added & rxq->ptr_mask;
- while (bulks-- > 0) {
- if (rte_mempool_get_bulk(rxq->refill_mb_pool, objs,
- RTE_DIM(objs)) < 0) {
+ do {
+ if (unlikely(rte_mempool_get_bulk(rxq->refill_mb_pool, objs,
+ RTE_DIM(objs)) < 0)) {
/*
* It is hardly a safe way to increment counter
* from different contexts, but all PMDs do it.
*/
rxq->evq->sa->eth_dev->data->rx_mbuf_alloc_failed +=
RTE_DIM(objs);
+ /* Return if we have posted nothing yet */
+ if (added == rxq->added)
+ return;
+ /* Push posted */
break;
}
efx_rx_qpost(rxq->common, addr, rxq->buf_size,
RTE_DIM(objs), rxq->completed, added);
added += RTE_DIM(objs);
- }
+ } while (--bulks > 0);
- /* Push doorbell if something is posted */
- if (rxq->added != added) {
- rxq->added = added;
- efx_rx_qpush(rxq->common, added, &rxq->pushed);
- }
+ SFC_ASSERT(added != rxq->added);
+ rxq->added = added;
+ efx_rx_qpush(rxq->common, added, &rxq->pushed);
}
static uint64_t
.type = SFC_DP_RX,
.hw_fw_caps = 0,
},
+ .features = SFC_DP_RX_FEAT_SCATTER,
.qcreate = sfc_efx_rx_qcreate,
.qdestroy = sfc_efx_rx_qdestroy,
.qstart = sfc_efx_rx_qstart,
rxq->evq = evq;
rxq->hw_index = sw_index;
- rxq->refill_threshold = rx_conf->rx_free_thresh;
+ rxq->refill_threshold =
+ RTE_MAX(rx_conf->rx_free_thresh, SFC_RX_REFILL_BULK);
rxq->refill_mb_pool = mb_pool;
rc = sfc_dma_alloc(sa, "rxq", sw_index, EFX_RXQ_SIZE(rxq_info->entries),
#endif
info.rxq_entries = rxq_info->entries;
+ info.rxq_hw_ring = rxq->mem.esm_base;
+ info.evq_entries = rxq_info->entries;
+ info.evq_hw_ring = evq->mem.esm_base;
+ info.hw_index = rxq->hw_index;
+ info.mem_bar = sa->mem_bar.esb_base;
rc = sa->dp_rx->qcreate(sa->eth_dev->data->port_id, sw_index,
&SFC_DEV_TO_PCI(sa->eth_dev)->addr,
sfc_dma_free(sa, &rxq->mem);
rte_free(rxq);
+
+ sfc_ev_qfini(sa, sfc_evq_index_by_rxq_sw_index(sa, sw_index));
}
#if EFSYS_OPT_RX_SCALE
rxmode->hw_strip_crc = 1;
}
+ if (rxmode->enable_scatter &&
+ (~sa->dp_rx->features & SFC_DP_RX_FEAT_SCATTER)) {
+ sfc_err(sa, "Rx scatter not supported by %s datapath",
+ sa->dp_rx->dp.name);
+ rc = EINVAL;
+ }
+
if (rxmode->enable_lro) {
sfc_err(sa, "LRO not supported");
rc = EINVAL;