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

Function ngbe_dev_tx_queue_stop

dpdk/drivers/net/ngbe/ngbe_rxtx.c:3234–3281  ·  view source on GitHub ↗

* Stop Transmit Units for specified queue. */

Source from the content-addressed store, hash-verified

3232 * Stop Transmit Units for specified queue.
3233 */
3234int
3235ngbe_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)
3236{
3237 struct ngbe_hw *hw = ngbe_dev_hw(dev);
3238 struct ngbe_tx_queue *txq;
3239 uint32_t txdctl;
3240 uint32_t txtdh, txtdt;
3241 int poll_ms;
3242
3243 PMD_INIT_FUNC_TRACE();
3244
3245 txq = dev->data->tx_queues[tx_queue_id];
3246
3247 /* Wait until Tx queue is empty */
3248 poll_ms = RTE_NGBE_REGISTER_POLL_WAIT_10_MS;
3249 do {
3250 rte_delay_us(RTE_NGBE_WAIT_100_US);
3251 txtdh = rd32(hw, NGBE_TXRP(txq->reg_idx));
3252 txtdt = rd32(hw, NGBE_TXWP(txq->reg_idx));
3253 } while (--poll_ms && (txtdh != txtdt));
3254 if (poll_ms == 0)
3255 PMD_INIT_LOG(ERR, "Tx Queue %d is not empty when stopping.",
3256 tx_queue_id);
3257
3258 ngbe_dev_save_tx_queue(hw, txq->reg_idx);
3259 wr32m(hw, NGBE_TXCFG(txq->reg_idx), NGBE_TXCFG_ENA, 0);
3260
3261 /* Wait until Tx Enable bit clear */
3262 poll_ms = RTE_NGBE_REGISTER_POLL_WAIT_10_MS;
3263 do {
3264 rte_delay_ms(1);
3265 txdctl = rd32(hw, NGBE_TXCFG(txq->reg_idx));
3266 } while (--poll_ms && (txdctl & NGBE_TXCFG_ENA));
3267 if (poll_ms == 0)
3268 PMD_INIT_LOG(ERR, "Could not disable Tx Queue %d",
3269 tx_queue_id);
3270
3271 rte_delay_us(RTE_NGBE_WAIT_100_US);
3272 ngbe_dev_store_tx_queue(hw, txq->reg_idx);
3273
3274 if (txq->ops != NULL) {
3275 txq->ops->release_mbufs(txq);
3276 txq->ops->reset(txq);
3277 }
3278 dev->data->tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED;
3279
3280 return 0;
3281}
3282
3283void
3284ngbe_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,

Callers

nothing calls this directly

Calls 7

ngbe_dev_hwFunction · 0.85
ngbe_dev_save_tx_queueFunction · 0.85
rte_delay_msFunction · 0.85
ngbe_dev_store_tx_queueFunction · 0.85
rd32Function · 0.50
wr32mFunction · 0.50
resetMethod · 0.45

Tested by

no test coverage detected