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

Function nfp_netvf_start

dpdk/drivers/net/nfp/nfp_ethdev_vf.c:20–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18#define NFP_VF_DRIVER_NAME net_nfp_vf
19
20static int
21nfp_netvf_start(struct rte_eth_dev *dev)
22{
23 int ret;
24 uint16_t i;
25 struct nfp_hw *hw;
26 uint32_t new_ctrl;
27 uint32_t update = 0;
28 uint32_t intr_vector;
29 struct nfp_net_hw *net_hw;
30 struct rte_eth_conf *dev_conf;
31 struct rte_eth_rxmode *rxmode;
32 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
33 struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
34
35 /* Disabling queues just in case... */
36 nfp_net_disable_queues(dev);
37
38 /* Enabling the required queues in the device */
39 nfp_net_enable_queues(dev);
40
41 /* Check and configure queue intr-vector mapping */
42 if (dev->data->dev_conf.intr_conf.rxq != 0) {
43 if (rte_intr_type_get(intr_handle) == RTE_INTR_HANDLE_UIO) {
44 /*
45 * Better not to share LSC with RX interrupts.
46 * Unregistering LSC interrupt handler.
47 */
48 rte_intr_callback_unregister(intr_handle,
49 nfp_net_dev_interrupt_handler, (void *)dev);
50
51 if (dev->data->nb_rx_queues > 1) {
52 PMD_INIT_LOG(ERR, "PMD rx interrupt only "
53 "supports 1 queue with UIO");
54 return -EIO;
55 }
56 }
57
58 intr_vector = dev->data->nb_rx_queues;
59 if (rte_intr_efd_enable(intr_handle, intr_vector) != 0)
60 return -1;
61
62 nfp_configure_rx_interrupt(dev, intr_handle);
63 update = NFP_NET_CFG_UPDATE_MSIX;
64 }
65
66 rte_intr_enable(intr_handle);
67
68 new_ctrl = nfp_check_offloads(dev);
69
70 /* Writing configuration parameters in the device */
71 net_hw = dev->data->dev_private;
72 hw = &net_hw->super;
73 nfp_net_params_setup(net_hw);
74
75 dev_conf = &dev->data->dev_conf;
76 rxmode = &dev_conf->rxmode;
77

Callers

nothing calls this directly

Calls 14

nfp_net_disable_queuesFunction · 0.85
nfp_net_enable_queuesFunction · 0.85
rte_intr_type_getFunction · 0.85
nfp_check_offloadsFunction · 0.85
nfp_net_params_setupFunction · 0.85
nfp_net_cfg_ctrl_rssFunction · 0.85
nn_cfg_writelFunction · 0.85
nfp_reconfigFunction · 0.85

Tested by

no test coverage detected