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

Function cxgbe_dev_close

dpdk/drivers/net/cxgbe/cxgbe_ethdev.c:316–351  ·  view source on GitHub ↗

* Stop device. */

Source from the content-addressed store, hash-verified

314 * Stop device.
315 */
316int cxgbe_dev_close(struct rte_eth_dev *eth_dev)
317{
318 struct port_info *temp_pi, *pi = eth_dev->data->dev_private;
319 struct adapter *adapter = pi->adapter;
320 u8 i;
321
322 CXGBE_FUNC_TRACE();
323
324 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
325 return 0;
326
327 if (!(adapter->flags & FULL_INIT_DONE))
328 return 0;
329
330 if (!pi->viid)
331 return 0;
332
333 cxgbe_down(pi);
334 t4_sge_eth_release_queues(pi);
335 t4_free_vi(adapter, adapter->mbox, adapter->pf, 0, pi->viid);
336 pi->viid = 0;
337
338 /* Free up the adapter-wide resources only after all the ports
339 * under this PF have been closed.
340 */
341 for_each_port(adapter, i) {
342 temp_pi = adap2pinfo(adapter, i);
343 if (temp_pi->viid)
344 return 0;
345 }
346
347 cxgbe_close(adapter);
348 rte_free(adapter);
349
350 return 0;
351}
352
353/* Start the device.
354 * It returns 0 on success.

Callers

nothing calls this directly

Calls 7

rte_eal_process_typeFunction · 0.85
cxgbe_downFunction · 0.85
t4_free_viFunction · 0.85
adap2pinfoFunction · 0.85
cxgbe_closeFunction · 0.85
rte_freeFunction · 0.85

Tested by

no test coverage detected