* Stop Transmit Units for specified queue. */
| 3232 | * Stop Transmit Units for specified queue. |
| 3233 | */ |
| 3234 | int |
| 3235 | ngbe_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 | |
| 3283 | void |
| 3284 | ngbe_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, |
nothing calls this directly
no test coverage detected