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

Function eth_ena_xmit_pkts

dpdk/drivers/net/ena/ena_ethdev.c:3177–3218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3175}
3176
3177static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
3178 uint16_t nb_pkts)
3179{
3180 struct ena_ring *tx_ring = (struct ena_ring *)(tx_queue);
3181 int available_desc;
3182 uint16_t sent_idx = 0;
3183
3184#ifdef RTE_ETHDEV_DEBUG_TX
3185 /* Check adapter state */
3186 if (unlikely(tx_ring->adapter->state != ENA_ADAPTER_STATE_RUNNING)) {
3187 PMD_TX_LOG(ALERT,
3188 "Trying to xmit pkts while device is NOT running\n");
3189 return 0;
3190 }
3191#endif
3192
3193 available_desc = ena_com_free_q_entries(tx_ring->ena_com_io_sq);
3194 if (available_desc < tx_ring->tx_free_thresh)
3195 ena_tx_cleanup((void *)tx_ring, 0);
3196
3197 for (sent_idx = 0; sent_idx < nb_pkts; sent_idx++) {
3198 if (ena_xmit_mbuf(tx_ring, tx_pkts[sent_idx]))
3199 break;
3200 tx_ring->pkts_without_db = true;
3201 rte_prefetch0(tx_pkts[ENA_IDX_ADD_MASKED(sent_idx, 4,
3202 tx_ring->size_mask)]);
3203 }
3204
3205 /* If there are ready packets to be xmitted... */
3206 if (likely(tx_ring->pkts_without_db)) {
3207 /* ...let HW do its best :-) */
3208 ena_com_write_sq_doorbell(tx_ring->ena_com_io_sq);
3209 tx_ring->tx_stats.doorbells++;
3210 tx_ring->pkts_without_db = false;
3211 }
3212
3213 tx_ring->tx_stats.available_desc =
3214 ena_com_free_q_entries(tx_ring->ena_com_io_sq);
3215 tx_ring->tx_stats.tx_poll++;
3216
3217 return sent_idx;
3218}
3219
3220static void ena_copy_customer_metrics(struct ena_adapter *adapter, uint64_t *buf,
3221 size_t num_metrics)

Callers

nothing calls this directly

Calls 5

ena_tx_cleanupFunction · 0.85
ena_xmit_mbufFunction · 0.85
ena_com_free_q_entriesFunction · 0.50
rte_prefetch0Function · 0.50

Tested by

no test coverage detected