hns3_rx_queue_release_mbufs(rxq);
if (rxq->mz)
rte_memzone_free(rxq->mz);
- if (rxq->sw_ring)
- rte_free(rxq->sw_ring);
+ rte_free(rxq->sw_ring);
rte_free(rxq);
}
}
hns3_tx_queue_release_mbufs(txq);
if (txq->mz)
rte_memzone_free(txq->mz);
- if (txq->sw_ring)
- rte_free(txq->sw_ring);
- if (txq->free)
- rte_free(txq->free);
+ rte_free(txq->sw_ring);
+ rte_free(txq->free);
rte_free(txq);
}
}
return hns3_xmit_pkts;
}
-uint16_t
-hns3_dummy_rxtx_burst(void *dpdk_txq __rte_unused,
- struct rte_mbuf **pkts __rte_unused,
- uint16_t pkts_n __rte_unused)
-{
- return 0;
-}
-
static void
hns3_trace_rxtx_function(struct rte_eth_dev *dev)
{
eth_dev->rx_pkt_burst = hns3_get_rx_function(eth_dev);
eth_dev->rx_descriptor_status = hns3_dev_rx_descriptor_status;
eth_dev->tx_pkt_burst = hw->set_link_down ?
- hns3_dummy_rxtx_burst :
+ rte_eth_pkt_burst_dummy :
hns3_get_tx_function(eth_dev, &prep);
eth_dev->tx_pkt_prepare = prep;
eth_dev->tx_descriptor_status = hns3_dev_tx_descriptor_status;
hns3_trace_rxtx_function(eth_dev);
} else {
- eth_dev->rx_pkt_burst = hns3_dummy_rxtx_burst;
- eth_dev->tx_pkt_burst = hns3_dummy_rxtx_burst;
+ eth_dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
+ eth_dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
eth_dev->tx_pkt_prepare = NULL;
}
static int
hns3_tx_done_cleanup_full(struct hns3_tx_queue *txq, uint32_t free_cnt)
{
- uint16_t round_free_cnt;
+ uint16_t round_cnt;
uint32_t idx;
if (free_cnt == 0 || free_cnt > txq->nb_tx_desc)
if (txq->tx_rs_thresh == 0)
return 0;
- round_free_cnt = roundup(free_cnt, txq->tx_rs_thresh);
- for (idx = 0; idx < round_free_cnt; idx += txq->tx_rs_thresh) {
+ round_cnt = rounddown(free_cnt, txq->tx_rs_thresh);
+ for (idx = 0; idx < round_cnt; idx += txq->tx_rs_thresh) {
if (hns3_tx_free_useless_buffer(txq) != 0)
break;
}
- return RTE_MIN(idx, free_cnt);
+ return idx;
}
int
if (dev->tx_pkt_burst == hns3_xmit_pkts)
return hns3_tx_done_cleanup_full(q, free_cnt);
- else if (dev->tx_pkt_burst == hns3_dummy_rxtx_burst)
+ else if (dev->tx_pkt_burst == rte_eth_pkt_burst_dummy)
return 0;
else
return -ENOTSUP;
void
hns3_stop_tx_datapath(struct rte_eth_dev *dev)
{
- dev->tx_pkt_burst = hns3_dummy_rxtx_burst;
+ dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
dev->tx_pkt_prepare = NULL;
hns3_eth_dev_fp_ops_config(dev);