summaryrefslogtreecommitdiff
path: root/drivers/net/softnic
diff options
context:
space:
mode:
authorThomas Monjalon <thomas@monjalon.net>2018-10-19 04:07:55 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2018-10-26 22:14:05 +0200
commite16adf08e54d5b1ff3b1116c372bbca279fced9d (patch)
tree7c837a548bafd12bffa9ef8ee74143243f0af6d7 /drivers/net/softnic
parentf6a12685a5ff64188b5191f52fd486465e4919db (diff)
downloaddpdk-e16adf08e54d5b1ff3b1116c372bbca279fced9d.zip
dpdk-e16adf08e54d5b1ff3b1116c372bbca279fced9d.tar.gz
dpdk-e16adf08e54d5b1ff3b1116c372bbca279fced9d.tar.xz
ethdev: free all common data when releasing port
This is a clean-up of common ethdev data freeing. All data freeing are moved to rte_eth_dev_release_port() and done only in case of primary process. It is probably fixing some memory leaks for PMDs which were not freeing all data. Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Diffstat (limited to 'drivers/net/softnic')
-rw-r--r--drivers/net/softnic/rte_eth_softnic.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
index aec6846..4ecfe95 100644
--- a/drivers/net/softnic/rte_eth_softnic.c
+++ b/drivers/net/softnic/rte_eth_softnic.c
@@ -557,7 +557,6 @@ static int
pmd_remove(struct rte_vdev_device *vdev)
{
struct rte_eth_dev *dev = NULL;
- struct pmd_internals *p;
if (!vdev)
return -EINVAL;
@@ -568,12 +567,12 @@ pmd_remove(struct rte_vdev_device *vdev)
dev = rte_eth_dev_allocated(rte_vdev_device_name(vdev));
if (dev == NULL)
return -ENODEV;
- p = dev->data->dev_private;
/* Free device data structures*/
- rte_free(dev->data);
+ pmd_free(dev->data->dev_private);
+ dev->data->dev_private = NULL; /* already freed */
+ dev->data->mac_addrs = NULL; /* statically allocated */
rte_eth_dev_release_port(dev);
- pmd_free(p);
return 0;
}