Skip to contentSkip to conversation

net: mana: Use mana_cleanup_port_context() for rxq cleanup

PATCH Applied Shradha Gupta 5 participants 5 messages Jun 14, 2024 – Jun 18, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: mana: Use mana_cleanup_port_context() for rxq cleanup

To cleanup rxqs in port context structures, instead of duplicating the code, use existing function mana_cleanup_port_context() which does the exact cleanup that's needed.

---
 drivers/net/ethernet/microsoft/mana/mana_en.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/microsoft/mana/mana_en.c +2 -4
index b89ad4afd66e..93e526e5dd16 100644
@@ -2529,8 +2529,7 @@ static int mana_init_port(struct net_device *ndev)
 	return 0;
 
 reset_apc:
-	kfree(apc->rxqs);
-	apc->rxqs = NULL;
+	mana_cleanup_port_context(apc);
 	return err;
 }
 
@@ -2787,8 +2786,7 @@ static int mana_probe_port(struct mana_context *ac, int port_idx,
 free_indir:
 	mana_cleanup_indir_table(apc);
 reset_apc:
-	kfree(apc->rxqs);
-	apc->rxqs = NULL;
+	mana_cleanup_port_context(apc);
 free_net:
 	*ndev_storage = NULL;
 	netdev_err(ndev, "Failed to probe vPort %d: %d\n", port_idx, err);
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#3 lore raw
In reply to Shradha Gupta
Quoted 24 lines · Shradha Gupta

To cleanup rxqs in port context structures, instead of duplicating the code, use existing function mana_cleanup_port_context() which does the exact cleanup that's needed.

---
  drivers/net/ethernet/microsoft/mana/mana_en.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/microsoft/mana/mana_en.c +1 -2
index b89ad4afd66e..93e526e5dd16 100644
@@ -2529,8 +2529,7 @@ static int mana_init_port(struct net_device *ndev)
  	return 0;
 
  reset_apc:
-	kfree(apc->rxqs);
-	apc->rxqs = NULL;
+	mana_cleanup_port_context(apc);
  	return err;
  }
 

drivers/net/ethernet/microsoft/mana/mana_en.c static int mana_probe_port(struct mana_context *ac, int port_idx, · line 2792

Quoted 9 lines
drivers/net/ethernet/microsoft/mana/mana_en.c +1 -2
@@ -2787,8 +2786,7 @@ static int mana_probe_port(struct mana_context *ac, int port_idx,
  free_indir:
  	mana_cleanup_indir_table(apc);
  reset_apc:
-	kfree(apc->rxqs);
-	apc->rxqs = NULL;
+	mana_cleanup_port_context(apc);
  free_net:
  	*ndev_storage = NULL;
  	netdev_err(ndev, "Failed to probe vPort %d: %d\n", port_idx, err);

Thanks!

#4 lore raw
In reply to Shradha Gupta
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Fri, 14 Jun 2024 00:19:08 -0700 you wrote:

To cleanup rxqs in port context structures, instead of duplicating the code, use existing function mana_cleanup_port_context() which does the exact cleanup that's needed.

---
 drivers/net/ethernet/microsoft/mana/mana_en.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Here is the summary with links:
- [net-next] net: mana: Use mana_cleanup_port_context() for rxq cleanup

    https://git.kernel.org/netdev/net-next/c/e275e19c918b

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html