| 1266 | } |
| 1267 | |
| 1268 | int |
| 1269 | cpfl_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id) |
| 1270 | { |
| 1271 | struct cpfl_vport *cpfl_vport = dev->data->dev_private; |
| 1272 | struct idpf_vport *vport = &cpfl_vport->base; |
| 1273 | struct cpfl_rx_queue *cpfl_rxq; |
| 1274 | struct idpf_rx_queue *rxq; |
| 1275 | int err; |
| 1276 | |
| 1277 | if (rx_queue_id >= dev->data->nb_rx_queues) |
| 1278 | return -EINVAL; |
| 1279 | |
| 1280 | cpfl_rxq = dev->data->rx_queues[rx_queue_id]; |
| 1281 | if (cpfl_rxq->hairpin_info.hairpin_q) |
| 1282 | err = cpfl_switch_hairpin_rxtx_queue(cpfl_vport, |
| 1283 | rx_queue_id - cpfl_vport->nb_data_txq, |
| 1284 | true, false); |
| 1285 | else |
| 1286 | err = idpf_vc_queue_switch(vport, rx_queue_id, true, false); |
| 1287 | if (err != 0) { |
| 1288 | PMD_DRV_LOG(ERR, "Failed to switch RX queue %u off", |
| 1289 | rx_queue_id); |
| 1290 | return err; |
| 1291 | } |
| 1292 | |
| 1293 | rxq = &cpfl_rxq->base; |
| 1294 | rxq->q_started = false; |
| 1295 | if (vport->rxq_model == VIRTCHNL2_QUEUE_MODEL_SINGLE) { |
| 1296 | rxq->ops->release_mbufs(rxq); |
| 1297 | idpf_qc_single_rx_queue_reset(rxq); |
| 1298 | } else { |
| 1299 | rxq->bufq1->ops->release_mbufs(rxq->bufq1); |
| 1300 | if (rxq->bufq2) |
| 1301 | rxq->bufq2->ops->release_mbufs(rxq->bufq2); |
| 1302 | if (cpfl_rxq->hairpin_info.hairpin_q) { |
| 1303 | cpfl_rx_hairpin_descq_reset(rxq); |
| 1304 | cpfl_rx_hairpin_bufq_reset(rxq->bufq1); |
| 1305 | } else { |
| 1306 | idpf_qc_split_rx_queue_reset(rxq); |
| 1307 | } |
| 1308 | } |
| 1309 | if (!cpfl_rxq->hairpin_info.hairpin_q) |
| 1310 | dev->data->rx_queue_state[rx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED; |
| 1311 | |
| 1312 | return 0; |
| 1313 | } |
| 1314 | |
| 1315 | int |
| 1316 | cpfl_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id) |
no test coverage detected