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

Function sfc_tx_start

dpdk/drivers/net/sfc/sfc_tx.c:689–740  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

687}
688
689int
690sfc_tx_start(struct sfc_adapter *sa)
691{
692 struct sfc_adapter_shared * const sas = sfc_sa2shared(sa);
693 const efx_nic_cfg_t *encp = efx_nic_cfg_get(sa->nic);
694 sfc_sw_index_t sw_index;
695 int rc = 0;
696
697 sfc_log_init(sa, "txq_count = %u (internal %u)",
698 sas->ethdev_txq_count, sas->txq_count);
699
700 if (sa->tso) {
701 if (!encp->enc_fw_assisted_tso_v2_enabled &&
702 !encp->enc_tso_v3_enabled) {
703 sfc_warn(sa, "TSO support was unable to be restored");
704 sa->tso = B_FALSE;
705 sa->tso_encap = B_FALSE;
706 }
707 }
708
709 if (sa->tso_encap && !encp->enc_fw_assisted_tso_v2_encap_enabled &&
710 !encp->enc_tso_v3_enabled) {
711 sfc_warn(sa, "Encapsulated TSO support was unable to be restored");
712 sa->tso_encap = B_FALSE;
713 }
714
715 rc = efx_tx_init(sa->nic);
716 if (rc != 0)
717 goto fail_efx_tx_init;
718
719 for (sw_index = 0; sw_index < sas->txq_count; ++sw_index) {
720 if (sas->txq_info[sw_index].state == SFC_TXQ_INITIALIZED &&
721 (!(sas->txq_info[sw_index].deferred_start) ||
722 sas->txq_info[sw_index].deferred_started)) {
723 rc = sfc_tx_qstart(sa, sw_index);
724 if (rc != 0)
725 goto fail_tx_qstart;
726 }
727 }
728
729 return 0;
730
731fail_tx_qstart:
732 while (sw_index-- > 0)
733 sfc_tx_qstop(sa, sw_index);
734
735 efx_tx_fini(sa->nic);
736
737fail_efx_tx_init:
738 sfc_log_init(sa, "failed (rc = %d)", rc);
739 return rc;
740}
741
742void
743sfc_tx_stop(struct sfc_adapter *sa)

Callers 1

sfc_try_startFunction · 0.85

Calls 6

sfc_sa2sharedFunction · 0.85
efx_nic_cfg_getFunction · 0.85
efx_tx_initFunction · 0.85
sfc_tx_qstartFunction · 0.85
sfc_tx_qstopFunction · 0.85
efx_tx_finiFunction · 0.85

Tested by

no test coverage detected