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

Function sfc_ev_qinit

dpdk/drivers/net/sfc/sfc_ev.c:891–937  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

889}
890
891int
892sfc_ev_qinit(struct sfc_adapter *sa,
893 enum sfc_evq_type type, unsigned int type_index,
894 unsigned int entries, int socket_id, struct sfc_evq **evqp)
895{
896 struct sfc_evq *evq;
897 int rc;
898
899 sfc_log_init(sa, "type=%s type_index=%u",
900 sfc_evq_type2str(type), type_index);
901
902 SFC_ASSERT(rte_is_power_of_2(entries));
903
904 rc = ENOMEM;
905 evq = rte_zmalloc_socket("sfc-evq", sizeof(*evq), RTE_CACHE_LINE_SIZE,
906 socket_id);
907 if (evq == NULL)
908 goto fail_evq_alloc;
909
910 evq->sa = sa;
911 evq->type = type;
912 evq->entries = entries;
913
914 /* Allocate DMA space */
915 rc = sfc_dma_alloc(sa, sfc_evq_type2str(type), type_index,
916 EFX_NIC_DMA_ADDR_EVENT_RING,
917 efx_evq_size(sa->nic, evq->entries, sa->evq_flags),
918 socket_id, &evq->mem);
919 if (rc != 0)
920 goto fail_dma_alloc;
921
922 evq->init_state = SFC_EVQ_INITIALIZED;
923
924 sa->evq_count++;
925
926 *evqp = evq;
927
928 return 0;
929
930fail_dma_alloc:
931 rte_free(evq);
932
933fail_evq_alloc:
934
935 sfc_log_init(sa, "failed %d", rc);
936 return rc;
937}
938
939void
940sfc_ev_qfini(struct sfc_evq *evq)

Callers 3

sfc_ev_attachFunction · 0.85
sfc_tx_qinitFunction · 0.85
sfc_rx_qinitFunction · 0.85

Calls 6

sfc_evq_type2strFunction · 0.85
rte_zmalloc_socketFunction · 0.85
sfc_dma_allocFunction · 0.85
efx_evq_sizeFunction · 0.85
rte_freeFunction · 0.85
rte_is_power_of_2Function · 0.50

Tested by

no test coverage detected