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

Function nfp_net_start

dpdk/drivers/net/nfp/nfp_ethdev.c:44–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44static int
45nfp_net_start(struct rte_eth_dev *dev)
46{
47 int ret;
48 uint16_t i;
49 struct nfp_hw *hw;
50 uint32_t new_ctrl;
51 uint32_t update = 0;
52 uint32_t cap_extend;
53 uint32_t intr_vector;
54 uint32_t ctrl_extend = 0;
55 struct nfp_net_hw *net_hw;
56 struct nfp_pf_dev *pf_dev;
57 struct rte_eth_rxmode *rxmode;
58 struct nfp_app_fw_nic *app_fw_nic;
59 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
60 struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
61
62 net_hw = dev->data->dev_private;
63 pf_dev = net_hw->pf_dev;
64 app_fw_nic = NFP_PRIV_TO_APP_FW_NIC(pf_dev->app_fw_priv);
65 hw = &net_hw->super;
66
67 /* Disabling queues just in case... */
68 nfp_net_disable_queues(dev);
69
70 /* Enabling the required queues in the device */
71 nfp_net_enable_queues(dev);
72
73 /* Check and configure queue intr-vector mapping */
74 if (dev->data->dev_conf.intr_conf.rxq != 0) {
75 if (app_fw_nic->multiport) {
76 PMD_INIT_LOG(ERR, "PMD rx interrupt is not supported "
77 "with NFP multiport PF");
78 return -EINVAL;
79 }
80
81 if (rte_intr_type_get(intr_handle) == RTE_INTR_HANDLE_UIO) {
82 /*
83 * Better not to share LSC with RX interrupts.
84 * Unregistering LSC interrupt handler.
85 */
86 rte_intr_callback_unregister(intr_handle,
87 nfp_net_dev_interrupt_handler, (void *)dev);
88
89 if (dev->data->nb_rx_queues > 1) {
90 PMD_INIT_LOG(ERR, "PMD rx interrupt only "
91 "supports 1 queue with UIO");
92 return -EIO;
93 }
94 }
95
96 intr_vector = dev->data->nb_rx_queues;
97 if (rte_intr_efd_enable(intr_handle, intr_vector) != 0)
98 return -1;
99
100 nfp_configure_rx_interrupt(dev, intr_handle);
101 update = NFP_NET_CFG_UPDATE_MSIX;

Callers

nothing calls this directly

Calls 15

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
nfp_reconfigFunction · 0.85
nfp_ext_reconfigFunction · 0.85
rte_eal_process_typeFunction · 0.85

Tested by

no test coverage detected