From patchwork Thu Nov 16 15:53:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Ghosh X-Patchwork-Id: 13458076 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="f8VsnTiO" Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2BF61730; Thu, 16 Nov 2023 07:53:49 -0800 (PST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AGFYo1n026432; Thu, 16 Nov 2023 07:53:43 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=JeKDzoMiZqT1iDVG+sGjuWO4Gjc5/5UniKLk0NXFhQE=; b=f8VsnTiOUOozfhawlZm7Oxbp8pN9fAdVdYehLpR1QiRtWohvyvLeFCur+eWLPljmj191 s42NMMqCLhbdCb+nhFmXObEv+evGq7LTRSb+beTl93+2pLDlwGH4WABOdlmqb4021Wzm /fsLy9cj+mvhnEB5VtwFLbypPoVRwPxjEqw2JyPb1luzNkCq5Kfa0BG7h/Lwz9qerolG pI5CDd+RYlTqzkElBpOD85+PggApccAGDO7IABiWSuzT3/zg/7+aw9ko2VDagXXGnYEl d79Iol6hAEUNLGpWFOfISRMqGl8h+oz4iEk4g1K2ykmhA/l4PdHN3s/yw+b51By/j7SY Ig== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3udgkah705-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 16 Nov 2023 07:53:42 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 16 Nov 2023 07:53:41 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Thu, 16 Nov 2023 07:53:41 -0800 Received: from localhost.localdomain (unknown [10.28.36.166]) by maili.marvell.com (Postfix) with ESMTP id 03F733F705C; Thu, 16 Nov 2023 07:53:36 -0800 (PST) From: Suman Ghosh To: , , , , , , , , , , , , CC: Suman Ghosh Subject: [net PATCH] octeontx2-pf: Fix memory leak during interface down Date: Thu, 16 Nov 2023 21:23:34 +0530 Message-ID: <20231116155334.3277905-1-sumang@marvell.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: lP9ZmLzL8t5JUo74U3Vd9m-hrpj7uFkq X-Proofpoint-GUID: lP9ZmLzL8t5JUo74U3Vd9m-hrpj7uFkq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-16_16,2023-11-16_01,2023-05-22_02 X-Patchwork-Delegate: kuba@kernel.org During 'ifconfig down' one RSS memory was not getting freed. This patch fixes the same. Fixes: f12098ce9b43 ("octeontx2-pf: Clear RSS enable flag on interace down") Signed-off-by: Suman Ghosh --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c index 91b99fd70361..ba95ac913274 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c @@ -1934,6 +1934,8 @@ int otx2_stop(struct net_device *netdev) /* Clear RSS enable flag */ rss = &pf->hw.rss_info; rss->enable = false; + if (!netif_is_rxfh_configured(netdev)) + kfree(rss->rss_ctx[DEFAULT_RSS_CONTEXT_GROUP]); /* Cleanup Queue IRQ */ vec = pci_irq_vector(pf->pdev,