From nobody Tue Dec 30 09:54:21 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 900FDC54FB9 for ; Thu, 16 Nov 2023 15:54:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345428AbjKPPyO (ORCPT ); Thu, 16 Nov 2023 10:54:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345449AbjKPPx7 (ORCPT ); Thu, 16 Nov 2023 10:53:59 -0500 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 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 =3D &pf->hw.rss_info; rss->enable =3D false; + if (!netif_is_rxfh_configured(netdev)) + kfree(rss->rss_ctx[DEFAULT_RSS_CONTEXT_GROUP]); =20 /* Cleanup Queue IRQ */ vec =3D pci_irq_vector(pf->pdev, --=20 2.25.1