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

Function i40e_tx_queue_release_mbufs

dpdk/drivers/net/i40e/i40e_rxtx.c:2601–2659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2599}
2600
2601void
2602i40e_tx_queue_release_mbufs(struct i40e_tx_queue *txq)
2603{
2604 struct rte_eth_dev *dev;
2605 uint16_t i;
2606
2607 if (!txq || !txq->sw_ring) {
2608 PMD_DRV_LOG(DEBUG, "Pointer to txq or sw_ring is NULL");
2609 return;
2610 }
2611
2612 dev = &rte_eth_devices[txq->port_id];
2613
2614 /**
2615 * vPMD tx will not set sw_ring's mbuf to NULL after free,
2616 * so need to free remains more carefully.
2617 */
2618#ifdef CC_AVX512_SUPPORT
2619 if (dev->tx_pkt_burst == i40e_xmit_pkts_vec_avx512) {
2620 struct i40e_vec_tx_entry *swr = (void *)txq->sw_ring;
2621
2622 i = txq->tx_next_dd - txq->tx_rs_thresh + 1;
2623 if (txq->tx_tail < i) {
2624 for (; i < txq->nb_tx_desc; i++) {
2625 rte_pktmbuf_free_seg(swr[i].mbuf);
2626 swr[i].mbuf = NULL;
2627 }
2628 i = 0;
2629 }
2630 for (; i < txq->tx_tail; i++) {
2631 rte_pktmbuf_free_seg(swr[i].mbuf);
2632 swr[i].mbuf = NULL;
2633 }
2634 return;
2635 }
2636#endif
2637 if (dev->tx_pkt_burst == i40e_xmit_pkts_vec_avx2 ||
2638 dev->tx_pkt_burst == i40e_xmit_pkts_vec) {
2639 i = txq->tx_next_dd - txq->tx_rs_thresh + 1;
2640 if (txq->tx_tail < i) {
2641 for (; i < txq->nb_tx_desc; i++) {
2642 rte_pktmbuf_free_seg(txq->sw_ring[i].mbuf);
2643 txq->sw_ring[i].mbuf = NULL;
2644 }
2645 i = 0;
2646 }
2647 for (; i < txq->tx_tail; i++) {
2648 rte_pktmbuf_free_seg(txq->sw_ring[i].mbuf);
2649 txq->sw_ring[i].mbuf = NULL;
2650 }
2651 } else {
2652 for (i = 0; i < txq->nb_tx_desc; i++) {
2653 if (txq->sw_ring[i].mbuf) {
2654 rte_pktmbuf_free_seg(txq->sw_ring[i].mbuf);
2655 txq->sw_ring[i].mbuf = NULL;
2656 }
2657 }
2658 }

Callers 3

i40e_dev_tx_queue_stopFunction · 0.85
i40e_tx_queue_releaseFunction · 0.85
i40e_dev_clear_queuesFunction · 0.85

Calls 1

rte_pktmbuf_free_segFunction · 0.85

Tested by

no test coverage detected