MAC address table is allocated during octeontx device create and
same is used to maintain list of MAC address associated to port.
This table is not getting freed niether in case of error nor during
graceful shutdown of port.
Patch fixes memory required memory for both the cases as mentioned.
Fixes:
f18b146c498d ("net/octeontx: create ethdev ports")
Cc: stable@dpdk.org
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Harman Kalra <hkalra@marvell.com>
rte_free(txq);
}
+ /* Free MAC address table */
+ rte_free(dev->data->mac_addrs);
+ dev->data->mac_addrs = NULL;
+
dev->tx_pkt_burst = NULL;
dev->rx_pkt_burst = NULL;
}
octeontx_log_err("eth_dev->port_id (%d) is diff to orig (%d)",
data->port_id, nic->port_id);
res = -EINVAL;
- goto err;
+ goto free_mac_addrs;
}
/* Update port_id mac to eth_dev */
rte_eth_dev_probing_finish(eth_dev);
return data->port_id;
+free_mac_addrs:
+ rte_free(data->mac_addrs);
err:
if (nic)
octeontx_port_close(nic);