| 179 | } |
| 180 | |
| 181 | static int |
| 182 | mana_dev_start(struct rte_eth_dev *dev) |
| 183 | { |
| 184 | int ret; |
| 185 | struct mana_priv *priv = dev->data->dev_private; |
| 186 | |
| 187 | rte_spinlock_init(&priv->mr_btree_lock); |
| 188 | ret = mana_mr_btree_init(&priv->mr_btree, MANA_MR_BTREE_CACHE_N, |
| 189 | dev->device->numa_node); |
| 190 | if (ret) { |
| 191 | DRV_LOG(ERR, "Failed to init device MR btree %d", ret); |
| 192 | return ret; |
| 193 | } |
| 194 | |
| 195 | ret = mana_start_tx_queues(dev); |
| 196 | if (ret) { |
| 197 | DRV_LOG(ERR, "failed to start tx queues %d", ret); |
| 198 | goto failed_tx; |
| 199 | } |
| 200 | |
| 201 | ret = mana_start_rx_queues(dev); |
| 202 | if (ret) { |
| 203 | DRV_LOG(ERR, "failed to start rx queues %d", ret); |
| 204 | goto failed_rx; |
| 205 | } |
| 206 | |
| 207 | rte_wmb(); |
| 208 | |
| 209 | dev->tx_pkt_burst = mana_tx_burst; |
| 210 | dev->rx_pkt_burst = mana_rx_burst; |
| 211 | |
| 212 | DRV_LOG(INFO, "TX/RX queues have started"); |
| 213 | |
| 214 | /* Enable datapath for secondary processes */ |
| 215 | mana_mp_req_on_rxtx(dev, MANA_MP_REQ_START_RXTX); |
| 216 | |
| 217 | ret = rxq_intr_enable(priv); |
| 218 | if (ret) { |
| 219 | DRV_LOG(ERR, "Failed to enable RX interrupts"); |
| 220 | goto failed_intr; |
| 221 | } |
| 222 | |
| 223 | return 0; |
| 224 | |
| 225 | failed_intr: |
| 226 | mana_stop_rx_queues(dev); |
| 227 | |
| 228 | failed_rx: |
| 229 | mana_stop_tx_queues(dev); |
| 230 | |
| 231 | failed_tx: |
| 232 | mana_mr_btree_free(&priv->mr_btree); |
| 233 | |
| 234 | return ret; |
| 235 | } |
| 236 | |
| 237 | static int |
| 238 | mana_dev_stop(struct rte_eth_dev *dev) |
nothing calls this directly
no test coverage detected