#include "hns3_ethdev.h"
static inline void
-hns3_tx_free_buffers(struct hns3_tx_queue *txq)
+hns3_tx_bulk_free_buffers(struct hns3_tx_queue *txq)
{
struct rte_mbuf **free = txq->free;
struct hns3_entry *tx_entry;
- struct hns3_desc *tx_desc;
struct rte_mbuf *m;
int nb_free = 0;
int i;
- /*
- * All mbufs can be released only when the VLD bits of all
- * descriptors in a batch are cleared.
- */
- tx_desc = &txq->tx_ring[txq->next_to_clean];
- for (i = 0; i < txq->tx_rs_thresh; i++, tx_desc++) {
- if (tx_desc->tx.tp_fe_sc_vld_ra_ri &
- rte_le_to_cpu_16(BIT(HNS3_TXD_VLD_B)))
- return;
- }
-
tx_entry = &txq->sw_ring[txq->next_to_clean];
for (i = 0; i < txq->tx_rs_thresh; i++, tx_entry++) {
m = rte_pktmbuf_prefree_seg(tx_entry->mbuf);
txq->next_to_clean = 0;
}
+static inline void
+hns3_tx_free_buffers(struct hns3_tx_queue *txq)
+{
+ struct hns3_desc *tx_desc;
+ int i;
+
+ /*
+ * All mbufs can be released only when the VLD bits of all
+ * descriptors in a batch are cleared.
+ */
+ tx_desc = &txq->tx_ring[txq->next_to_clean];
+ for (i = 0; i < txq->tx_rs_thresh; i++, tx_desc++) {
+ if (tx_desc->tx.tp_fe_sc_vld_ra_ri &
+ rte_le_to_cpu_16(BIT(HNS3_TXD_VLD_B)))
+ return;
+ }
+
+ hns3_tx_bulk_free_buffers(txq);
+}
+
static inline uint16_t
hns3_rx_reassemble_pkts(struct rte_mbuf **rx_pkts,
uint16_t nb_pkts,