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

Function nfp_netvf_close

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

Reset and stop device. The device can not be restarted. */

Source from the content-addressed store, hash-verified

158
159/* Reset and stop device. The device can not be restarted. */
160static int
161nfp_netvf_close(struct rte_eth_dev *dev)
162{
163 struct nfp_net_hw *net_hw;
164 struct rte_pci_device *pci_dev;
165
166 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
167 return 0;
168
169 net_hw = dev->data->dev_private;
170 pci_dev = RTE_ETH_DEV_TO_PCI(dev);
171
172 rte_free(net_hw->eth_xstats_base);
173
174 /*
175 * We assume that the DPDK application is stopping all the
176 * threads/queues before calling the device close function.
177 */
178 nfp_net_disable_queues(dev);
179
180 /* Clear queues */
181 nfp_net_close_tx_queue(dev);
182 nfp_net_close_rx_queue(dev);
183
184 rte_intr_disable(pci_dev->intr_handle);
185
186 /* Unregister callback func from eal lib */
187 rte_intr_callback_unregister(pci_dev->intr_handle,
188 nfp_net_dev_interrupt_handler, (void *)dev);
189
190 /* Cancel possible impending LSC work here before releasing the port */
191 rte_eal_alarm_cancel(nfp_net_dev_interrupt_delayed_handler, (void *)dev);
192
193 return 0;
194}
195
196/* Initialise and register VF driver with DPDK Application */
197static const struct eth_dev_ops nfp_netvf_eth_dev_ops = {

Callers 1

nfp_vf_pci_uninitFunction · 0.85

Calls 8

rte_eal_process_typeFunction · 0.85
rte_freeFunction · 0.85
nfp_net_disable_queuesFunction · 0.85
nfp_net_close_tx_queueFunction · 0.85
nfp_net_close_rx_queueFunction · 0.85
rte_intr_disableFunction · 0.50
rte_eal_alarm_cancelFunction · 0.50

Tested by

no test coverage detected