| 409 | } |
| 410 | |
| 411 | int |
| 412 | nfp_configure_rx_interrupt(struct rte_eth_dev *dev, |
| 413 | struct rte_intr_handle *intr_handle) |
| 414 | { |
| 415 | uint16_t i; |
| 416 | struct nfp_net_hw *hw; |
| 417 | |
| 418 | if (rte_intr_vec_list_alloc(intr_handle, "intr_vec", |
| 419 | dev->data->nb_rx_queues) != 0) { |
| 420 | PMD_DRV_LOG(ERR, "Failed to allocate %d rx_queues intr_vec", |
| 421 | dev->data->nb_rx_queues); |
| 422 | return -ENOMEM; |
| 423 | } |
| 424 | |
| 425 | hw = nfp_net_get_hw(dev); |
| 426 | |
| 427 | if (rte_intr_type_get(intr_handle) == RTE_INTR_HANDLE_UIO) { |
| 428 | PMD_DRV_LOG(INFO, "VF: enabling RX interrupt with UIO"); |
| 429 | /* UIO just supports one queue and no LSC */ |
| 430 | nn_cfg_writeb(&hw->super, NFP_NET_CFG_RXR_VEC(0), 0); |
| 431 | if (rte_intr_vec_list_index_set(intr_handle, 0, 0) != 0) |
| 432 | return -1; |
| 433 | } else { |
| 434 | PMD_DRV_LOG(INFO, "VF: enabling RX interrupt with VFIO"); |
| 435 | for (i = 0; i < dev->data->nb_rx_queues; i++) { |
| 436 | /* |
| 437 | * The first msix vector is reserved for non |
| 438 | * efd interrupts. |
| 439 | */ |
| 440 | nn_cfg_writeb(&hw->super, NFP_NET_CFG_RXR_VEC(i), i + 1); |
| 441 | if (rte_intr_vec_list_index_set(intr_handle, i, i + 1) != 0) |
| 442 | return -1; |
| 443 | } |
| 444 | } |
| 445 | |
| 446 | /* Avoiding TX interrupts */ |
| 447 | hw->super.ctrl |= NFP_NET_CFG_CTRL_MSIX_TX_OFF; |
| 448 | return 0; |
| 449 | } |
| 450 | |
| 451 | uint32_t |
| 452 | nfp_check_offloads(struct rte_eth_dev *dev) |
no test coverage detected