| 687 | } |
| 688 | |
| 689 | int |
| 690 | sfc_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 | |
| 731 | fail_tx_qstart: |
| 732 | while (sw_index-- > 0) |
| 733 | sfc_tx_qstop(sa, sw_index); |
| 734 | |
| 735 | efx_tx_fini(sa->nic); |
| 736 | |
| 737 | fail_efx_tx_init: |
| 738 | sfc_log_init(sa, "failed (rc = %d)", rc); |
| 739 | return rc; |
| 740 | } |
| 741 | |
| 742 | void |
| 743 | sfc_tx_stop(struct sfc_adapter *sa) |
no test coverage detected