| 1002 | } |
| 1003 | |
| 1004 | static int ena_queue_start_all(struct rte_eth_dev *dev, |
| 1005 | enum ena_ring_type ring_type) |
| 1006 | { |
| 1007 | struct ena_adapter *adapter = dev->data->dev_private; |
| 1008 | struct ena_ring *queues = NULL; |
| 1009 | int nb_queues; |
| 1010 | int i = 0; |
| 1011 | int rc = 0; |
| 1012 | |
| 1013 | if (ring_type == ENA_RING_TYPE_RX) { |
| 1014 | queues = adapter->rx_ring; |
| 1015 | nb_queues = dev->data->nb_rx_queues; |
| 1016 | } else { |
| 1017 | queues = adapter->tx_ring; |
| 1018 | nb_queues = dev->data->nb_tx_queues; |
| 1019 | } |
| 1020 | for (i = 0; i < nb_queues; i++) { |
| 1021 | if (queues[i].configured) { |
| 1022 | if (ring_type == ENA_RING_TYPE_RX) { |
| 1023 | ena_assert_msg( |
| 1024 | dev->data->rx_queues[i] == &queues[i], |
| 1025 | "Inconsistent state of Rx queues\n"); |
| 1026 | } else { |
| 1027 | ena_assert_msg( |
| 1028 | dev->data->tx_queues[i] == &queues[i], |
| 1029 | "Inconsistent state of Tx queues\n"); |
| 1030 | } |
| 1031 | |
| 1032 | rc = ena_queue_start(dev, &queues[i]); |
| 1033 | |
| 1034 | if (rc) { |
| 1035 | PMD_INIT_LOG(ERR, |
| 1036 | "Failed to start queue[%d] of type(%d)\n", |
| 1037 | i, ring_type); |
| 1038 | goto err; |
| 1039 | } |
| 1040 | } |
| 1041 | } |
| 1042 | |
| 1043 | return 0; |
| 1044 | |
| 1045 | err: |
| 1046 | while (i--) |
| 1047 | if (queues[i].configured) |
| 1048 | ena_queue_stop(&queues[i]); |
| 1049 | |
| 1050 | return rc; |
| 1051 | } |
| 1052 | |
| 1053 | static int |
| 1054 | ena_calc_io_queue_size(struct ena_calc_queue_size_ctx *ctx, |
no test coverage detected