From patchwork Fri Nov 17 10:40:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Ghosh X-Patchwork-Id: 166110 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp435262vqn; Fri, 17 Nov 2023 02:41:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IE703mcbuf9vUTEt5gmCk4HDztdkCiIWreTdGm7EvIj4RUkiebC9pRrQ0Du/YR0Ytbpja0N X-Received: by 2002:a17:902:ab52:b0:1c4:56c8:27f8 with SMTP id ij18-20020a170902ab5200b001c456c827f8mr8670641plb.68.1700217688552; Fri, 17 Nov 2023 02:41:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700217688; cv=none; d=google.com; s=arc-20160816; b=TAR/cN8YXuHlXWiXsqf6qsypsn3Ot0NJ36acFWEi7C6gRJ7CwccEAq8MZjocI1DhEP qoY1IuGmjoYJxwLZ0Qa57zfg1I+uaD/USi7nKFmZZfWXxd0+G/alT/e5dW2kWk6LRytq dxlgRCdrt7GtLtO/Rsv5LILxuSJTGAIx/F/jy/7eLXIlW/DM9ZzSOA4AHX5BgYl3oAGc RQMh52jgTB3n93LrYXuE8bILr6k3m5l32xpZrpMRJjiVJG3F2cXAP6FEhMgnmehMXfcN 7uGDr0V3XULR+OiblAx++p7OYKnLhjoW0xI9n/EEs6IfOXWCZzSAbyfyZ2fSUswq9Pr3 178w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=2uIlioN1bFST8jawAO6YLw204IOztiIPTnPD9NbgGbU=; fh=LB7eT8vw2+vB8s433diJLOtRSPEOTPRz4ia3xZipBH0=; b=gLLCjdAOHMwcsoXDcZsmQUHjnAmpbSjZ3Z/AeGuHvxQpj2NBse74HJSTOwiz9wIbET BAQlYkctSY0hpy9ftcTL9NkAutNTmpilKDi/nSRhRyaLULX+4tiocCOia7HmV7R5rIxj +6QBjeuC5TZC27jcv+bvUrmh9IojD2uZse64P+6ruSnwhwDHLp4xqS3Gz50qY/lgJBK0 NlmITGe48/YY047Vl7FOc3yzNaiyrRAa9ufHg4wKA7pW/jlBen1TZ0bGEbJcj1KkF9AQ xbwgyzRR8ZWOPo9DPaL5jioWB/vUVDu11dEeXyethV4HgskBjzjzNIV/2NCOCnmzRfRd 5+3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=CSamzhVQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id j7-20020a170903024700b001c60ee79b6esi1670785plh.0.2023.11.17.02.41.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 02:41:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=CSamzhVQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id E9D3280DCA57; Fri, 17 Nov 2023 02:41:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345802AbjKQKkr (ORCPT + 30 others); Fri, 17 Nov 2023 05:40:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345978AbjKQKkn (ORCPT ); Fri, 17 Nov 2023 05:40:43 -0500 Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AED0127; Fri, 17 Nov 2023 02:40:39 -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 3AH5Yu7S028673; Fri, 17 Nov 2023 02:40:28 -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=2uIlioN1bFST8jawAO6YLw204IOztiIPTnPD9NbgGbU=; b=CSamzhVQH4rrYqXlTY2mWd3f3c/vH1Kn5kG8USM4fROCxNApyThCSrhNR8J4bngx1xTt /znyB18IEbwZn425D371wsA2i66Tusac/wWjUcj1otpOAPv2FrpidFNKRUr34epf4CgD YuJ7VPh+BhAkg1BtCoZRlgbE2tvCIhbHmxniO+gbhRSBIN9dkwJYzhpYr3osCBql8UXE U/qBZmSasubUKCqPcCz5xuajE9Hr+KtT9EloE3YUxOH6yeoq7iKB0CPbojD2bc2/Qb2Z TvUSXYHLgs6dfvsi/VB3xEXOHezpJKBnFHkeKRBsyOpjuHzPmKJrX9T4marMhHdRw6T8 iA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3udvh5hsm4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 17 Nov 2023 02:40:27 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Fri, 17 Nov 2023 02:40:25 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Fri, 17 Nov 2023 02:40:25 -0800 Received: from localhost.localdomain (unknown [10.28.36.166]) by maili.marvell.com (Postfix) with ESMTP id D10F33F7086; Fri, 17 Nov 2023 02:40:21 -0800 (PST) From: Suman Ghosh To: , , , , , , , , , , , , CC: Suman Ghosh Subject: [net PATCH v2] octeontx2-pf: Fix memory leak during interface down Date: Fri, 17 Nov 2023 16:10:18 +0530 Message-ID: <20231117104018.3435212-1-sumang@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-GUID: PgDUBc2lFmwXsOkEXOWDvtjufiqNpFBx X-Proofpoint-ORIG-GUID: PgDUBc2lFmwXsOkEXOWDvtjufiqNpFBx 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-17_09,2023-11-16_01,2023-05-22_02 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 17 Nov 2023 02:41:04 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782736555920979265 X-GMAIL-MSGID: 1782807462528476213 During 'ifconfig down' one RSS memory was not getting freed. This patch fixes the same. Fixes: 81a4362016e7 ("octeontx2-pf: Add RSS multi group support") Signed-off-by: Suman Ghosh Reviewed-by: Simon Horman --- v2 changes: - Updated fixes tag 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,