octeontx2-pf: Fix resource leakage in VF driver unbind
authorHariprasad Kelam <hkelam@marvell.com>
Mon, 9 Jan 2023 06:13:25 +0000 (11:43 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:58:31 +0000 (11:58 +0100)
[ Upstream commit 53da7aec32982f5ee775b69dce06d63992ce4af3 ]

resources allocated like mcam entries to support the Ntuple feature
and hash tables for the tc feature are not getting freed in driver
unbind. This patch fixes the issue.

Fixes: 2da489432747 ("octeontx2-pf: devlink params support to set mcam entry count")
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Link: https://lore.kernel.org/r/20230109061325.21395-1-hkelam@marvell.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c

index 86653bb..7f8ffbf 100644 (file)
@@ -758,6 +758,8 @@ static void otx2vf_remove(struct pci_dev *pdev)
        if (vf->otx2_wq)
                destroy_workqueue(vf->otx2_wq);
        otx2_ptp_destroy(vf);
+       otx2_mcam_flow_del(vf);
+       otx2_shutdown_tc(vf);
        otx2vf_disable_mbox_intr(vf);
        otx2_detach_resources(&vf->mbox);
        if (test_bit(CN10K_LMTST, &vf->hw.cap_flag))