Thread (17 messages) 17 messages, 2 authors, 2021-10-08

Re: [dpdk-dev] [RFC V1] examples/l3fwd-power: fix memory leak for rte_pci_device

From: Thomas Monjalon <hidden>
Date: 2021-09-07 08:53:51

07/09/2021 05:41, Huisong Li:
Calling rte_eth_dev_close() will release resources of eth device and close
it. But rte_pci_device struct isn't released when app exit, which will lead
to memory leak.
That's a PMD issue.
When the last port of a PCI device is closed, the device should be freed.
+		/* Retrieve device address in eth device before closing it. */
+		eth_dev = &rte_eth_devices[portid];
You should not access this array, considered internal.
+		rte_dev = eth_dev->device;
 		rte_eth_dev_close(portid);
+		ret = rte_dev_remove(rte_dev);

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help