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

Function sfc_ev_qstart

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

Event queue HW index allocation scheme is described in sfc_ev.h. */

Source from the content-addressed store, hash-verified

645
646/* Event queue HW index allocation scheme is described in sfc_ev.h. */
647int
648sfc_ev_qstart(struct sfc_evq *evq, unsigned int hw_index)
649{
650 struct sfc_adapter *sa = evq->sa;
651 efsys_mem_t *esmp;
652 uint32_t evq_flags = sa->evq_flags;
653 uint32_t irq = 0;
654 unsigned int total_delay_us;
655 unsigned int delay_us;
656 int rc;
657
658 sfc_log_init(sa, "hw_index=%u", hw_index);
659
660 esmp = &evq->mem;
661
662 evq->evq_index = hw_index;
663
664 /* Clear all events */
665 (void)memset((void *)esmp->esm_base, 0xff,
666 efx_evq_size(sa->nic, evq->entries, evq_flags));
667
668 if (sa->intr.lsc_intr && hw_index == sa->mgmt_evq_index) {
669 evq_flags |= EFX_EVQ_FLAGS_NOTIFY_INTERRUPT;
670 irq = 0;
671 } else if (sa->intr.rxq_intr && evq->dp_rxq != NULL) {
672 sfc_ethdev_qid_t ethdev_qid;
673
674 ethdev_qid =
675 sfc_ethdev_rx_qid_by_rxq_sw_index(sfc_sa2shared(sa),
676 evq->dp_rxq->dpq.queue_id);
677 if (ethdev_qid != SFC_ETHDEV_QID_INVALID) {
678 evq_flags |= EFX_EVQ_FLAGS_NOTIFY_INTERRUPT;
679 /*
680 * The first interrupt is used for management EvQ
681 * (LSC etc). RxQ interrupts follow it.
682 */
683 irq = 1 + ethdev_qid;
684 } else {
685 evq_flags |= EFX_EVQ_FLAGS_NOTIFY_DISABLED;
686 }
687 } else {
688 evq_flags |= EFX_EVQ_FLAGS_NOTIFY_DISABLED;
689 }
690
691 evq->init_state = SFC_EVQ_STARTING;
692
693 /* Create the common code event queue */
694 rc = efx_ev_qcreate_irq(sa->nic, hw_index, esmp, evq->entries,
695 0 /* unused on EF10 */, 0, evq_flags,
696 irq, &evq->common);
697 if (rc != 0)
698 goto fail_ev_qcreate;
699
700 SFC_ASSERT(evq->dp_rxq == NULL || evq->dp_txq == NULL);
701 if (evq->dp_rxq != 0) {
702 if (strcmp(sa->priv.dp_rx->dp.name,
703 SFC_KVARG_DATAPATH_EFX) == 0)
704 evq->callbacks = &sfc_ev_callbacks_efx_rx;

Callers 3

sfc_ev_startFunction · 0.85
sfc_tx_qstartFunction · 0.85
sfc_rx_qstartFunction · 0.85

Calls 9

memsetFunction · 0.85
efx_evq_sizeFunction · 0.85
sfc_sa2sharedFunction · 0.85
efx_ev_qcreate_irqFunction · 0.85
strcmpFunction · 0.85
sfc_ev_qpollFunction · 0.85
efx_ev_qdestroyFunction · 0.85

Tested by

no test coverage detected