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

Function sfc_tx_qstart

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

Source from the content-addressed store, hash-verified

510}
511
512int
513sfc_tx_qstart(struct sfc_adapter *sa, sfc_sw_index_t sw_index)
514{
515 struct sfc_adapter_shared * const sas = sfc_sa2shared(sa);
516 sfc_ethdev_qid_t ethdev_qid;
517 uint64_t offloads_supported = sfc_tx_get_dev_offload_caps(sa) |
518 sfc_tx_get_queue_offload_caps(sa);
519 struct sfc_txq_info *txq_info;
520 struct sfc_txq *txq;
521 struct sfc_evq *evq;
522 uint16_t flags = 0;
523 unsigned int desc_index;
524 int rc = 0;
525
526 ethdev_qid = sfc_ethdev_tx_qid_by_txq_sw_index(sas, sw_index);
527
528 sfc_log_init(sa, "TxQ = %d (internal %u)", ethdev_qid, sw_index);
529
530 SFC_ASSERT(sw_index < sas->txq_count);
531 txq_info = &sas->txq_info[sw_index];
532
533 SFC_ASSERT(txq_info->state == SFC_TXQ_INITIALIZED);
534
535 txq = &sa->txq_ctrl[sw_index];
536 evq = txq->evq;
537
538 rc = sfc_ev_qstart(evq, sfc_evq_sw_index_by_txq_sw_index(sa, sw_index));
539 if (rc != 0)
540 goto fail_ev_qstart;
541
542 if (txq_info->offloads & RTE_ETH_TX_OFFLOAD_IPV4_CKSUM)
543 flags |= EFX_TXQ_CKSUM_IPV4;
544
545 if (txq_info->offloads & RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM)
546 flags |= EFX_TXQ_CKSUM_INNER_IPV4;
547
548 if ((txq_info->offloads & RTE_ETH_TX_OFFLOAD_TCP_CKSUM) ||
549 (txq_info->offloads & RTE_ETH_TX_OFFLOAD_UDP_CKSUM)) {
550 flags |= EFX_TXQ_CKSUM_TCPUDP;
551
552 if (offloads_supported & RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM)
553 flags |= EFX_TXQ_CKSUM_INNER_TCPUDP;
554 }
555
556 if (txq_info->offloads & (RTE_ETH_TX_OFFLOAD_TCP_TSO |
557 RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO |
558 RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO))
559 flags |= EFX_TXQ_FATSOV2;
560
561 rc = efx_tx_qcreate(sa->nic, txq->hw_index, 0, &txq->mem,
562 txq_info->entries, 0 /* not used on EF10 */,
563 flags, evq->common,
564 &txq->common, &desc_index);
565 if (rc != 0) {
566 if (sa->tso && (rc == ENOSPC))
567 sfc_err(sa, "ran out of TSO contexts");
568
569 goto fail_tx_qcreate;

Callers 3

sfc_ev_qpollFunction · 0.85
sfc_tx_startFunction · 0.85
sfc_tx_queue_startFunction · 0.85

Calls 10

sfc_sa2sharedFunction · 0.85
sfc_ev_qstartFunction · 0.85
efx_tx_qcreateFunction · 0.85
efx_tx_qenableFunction · 0.85
efx_tx_qdestroyFunction · 0.85
sfc_ev_qstopFunction · 0.85

Tested by

no test coverage detected