diff mbox series

[net] octeontx2-pf: Fix memory leak during interface down

Message ID 20231116155334.3277905-1-sumang@marvell.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net] octeontx2-pf: Fix memory leak during interface down | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 1154 this patch: 1154
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1159 this patch: 1159
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Suman Ghosh Nov. 16, 2023, 3:53 p.m. UTC
During 'ifconfig <netdev> 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 <sumang@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Simon Horman Nov. 16, 2023, 8:50 p.m. UTC | #1
On Thu, Nov 16, 2023 at 09:23:34PM +0530, Suman Ghosh wrote:
> During 'ifconfig <netdev> 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 <sumang@marvell.com>

Hi Suman,

I'm wondering if the fixes tag should refer to the commit
that introduced the allocation that your patch is freeing.

Fixes: 81a4362016e7 ("octeontx2-pf: Add RSS multi group support")

> ---
>  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,
> -- 
> 2.25.1
>
Suman Ghosh Nov. 17, 2023, 10:25 a.m. UTC | #2
>Hi Suman,
>
>I'm wondering if the fixes tag should refer to the commit that introduced
>the allocation that your patch is freeing.
[Suman] Yes, that make sense. I will update in v2.
>
>Fixes: 81a4362016e7 ("octeontx2-pf: Add RSS multi group support")
>
>> ---
>>  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,
>> --
>> 2.25.1
>>
diff mbox series

Patch

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,