MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sfc_rx_qstart

Function sfc_rx_qstart

dpdk/drivers/net/sfc/sfc_rx.c:790–892  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

788}
789
790int
791sfc_rx_qstart(struct sfc_adapter *sa, sfc_sw_index_t sw_index)
792{
793 struct sfc_adapter_shared *sas = sfc_sa2shared(sa);
794 sfc_ethdev_qid_t ethdev_qid;
795 struct sfc_rxq_info *rxq_info;
796 struct sfc_rxq *rxq;
797 struct sfc_evq *evq;
798 efx_rx_prefix_layout_t pinfo;
799 int rc;
800
801 SFC_ASSERT(sw_index < sfc_sa2shared(sa)->rxq_count);
802 ethdev_qid = sfc_ethdev_rx_qid_by_rxq_sw_index(sas, sw_index);
803
804 sfc_log_init(sa, "RxQ %d (internal %u)", ethdev_qid, sw_index);
805
806 rxq_info = &sfc_sa2shared(sa)->rxq_info[sw_index];
807 SFC_ASSERT(rxq_info->state == SFC_RXQ_INITIALIZED);
808
809 rxq = &sa->rxq_ctrl[sw_index];
810 evq = rxq->evq;
811
812 rc = sfc_ev_qstart(evq, sfc_evq_sw_index_by_rxq_sw_index(sa, sw_index));
813 if (rc != 0)
814 goto fail_ev_qstart;
815
816 switch (rxq_info->type) {
817 case EFX_RXQ_TYPE_DEFAULT:
818 rc = efx_rx_qcreate(sa->nic, rxq->hw_index, 0, rxq_info->type,
819 rxq->buf_size,
820 &rxq->mem, rxq_info->entries, 0 /* not used on EF10 */,
821 rxq_info->type_flags, evq->common, &rxq->common);
822 break;
823 case EFX_RXQ_TYPE_ES_SUPER_BUFFER: {
824 struct rte_mempool *mp = rxq_info->refill_mb_pool;
825 struct rte_mempool_info mp_info;
826
827 rc = rte_mempool_ops_get_info(mp, &mp_info);
828 if (rc != 0) {
829 /* Positive errno is used in the driver */
830 rc = -rc;
831 goto fail_mp_get_info;
832 }
833 if (mp_info.contig_block_size <= 0) {
834 rc = EINVAL;
835 goto fail_bad_contig_block_size;
836 }
837 rc = efx_rx_qcreate_es_super_buffer(sa->nic, rxq->hw_index, 0,
838 mp_info.contig_block_size, rxq->buf_size,
839 mp->header_size + mp->elt_size + mp->trailer_size,
840 sa->rxd_wait_timeout_ns,
841 &rxq->mem, rxq_info->entries, rxq_info->type_flags,
842 evq->common, &rxq->common);
843 break;
844 }
845 default:
846 rc = ENOTSUP;
847 }

Callers 4

sfc_ev_qpollFunction · 0.85
sfc_repr_proxy_rxq_startFunction · 0.85
sfc_rx_startFunction · 0.85
sfc_rx_queue_startFunction · 0.85

Calls 13

sfc_sa2sharedFunction · 0.85
sfc_ev_qstartFunction · 0.85
efx_rx_qcreateFunction · 0.85
rte_mempool_ops_get_infoFunction · 0.85
efx_rx_prefix_get_layoutFunction · 0.85
efx_rx_qenableFunction · 0.85
sfc_rx_qflushFunction · 0.85
efx_rx_qdestroyFunction · 0.85

Tested by

no test coverage detected