MCPcopy Create free account
hub / github.com/F-Stack/f-stack / nfp_configure_rx_interrupt

Function nfp_configure_rx_interrupt

dpdk/drivers/net/nfp/nfp_net_common.c:411–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409}
410
411int
412nfp_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
451uint32_t
452nfp_check_offloads(struct rte_eth_dev *dev)

Callers 2

nfp_netvf_startFunction · 0.85
nfp_net_startFunction · 0.85

Calls 5

rte_intr_vec_list_allocFunction · 0.85
nfp_net_get_hwFunction · 0.85
rte_intr_type_getFunction · 0.85
nn_cfg_writebFunction · 0.85

Tested by

no test coverage detected