* Install interrupt handler. * * @param priv * Pointer to private structure. * * @return * 0 on success, negative errno value otherwise and rte_errno is set. */
| 285 | * 0 on success, negative errno value otherwise and rte_errno is set. |
| 286 | */ |
| 287 | int |
| 288 | mlx4_intr_install(struct mlx4_priv *priv) |
| 289 | { |
| 290 | const struct rte_eth_intr_conf *const intr_conf = |
| 291 | Ð_DEV(priv)->data->dev_conf.intr_conf; |
| 292 | int rc; |
| 293 | |
| 294 | mlx4_intr_uninstall(priv); |
| 295 | if (intr_conf->lsc | intr_conf->rmv) { |
| 296 | if (rte_intr_fd_set(priv->intr_handle, priv->ctx->async_fd)) |
| 297 | return -rte_errno; |
| 298 | |
| 299 | rc = rte_intr_callback_register(priv->intr_handle, |
| 300 | (void (*)(void *)) |
| 301 | mlx4_interrupt_handler, |
| 302 | priv); |
| 303 | if (rc < 0) { |
| 304 | rte_errno = -rc; |
| 305 | goto error; |
| 306 | } |
| 307 | } |
| 308 | return 0; |
| 309 | error: |
| 310 | mlx4_intr_uninstall(priv); |
| 311 | return -rte_errno; |
| 312 | } |
| 313 | |
| 314 | /** |
| 315 | * DPDK callback for Rx queue interrupt disable. |
no test coverage detected