Skip to contentSkip to conversation

devlink: add missing unregister linecard notification

PATCH Applied Jiri Pirko 4 participants 5 messages Aug 17, 2023 – Aug 24, 2023

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author maintainer
#0 lore raw

PATCH 1/1 devlink: add missing unregister linecard notification

From: Jiri Pirko <[email protected]>

Cited fixes commit introduced linecard notifications for register, however it didn't add them for unregister. Fix that by adding them.

Fixes c246f9b5fd61 ("devlink: add support to create line card and expose to user")
---
 net/devlink/leftover.c | 3 +++
 1 file changed, 3 insertions(+)
net/devlink/leftover.c +3 -0
index c26c63275b0b..e7f76cc58533 100644
@@ -6630,6 +6630,7 @@ void devlink_notify_unregister(struct devlink *devlink)
 	struct devlink_param_item *param_item;
 	struct devlink_trap_item *trap_item;
 	struct devlink_port *devlink_port;
+	struct devlink_linecard *linecard;
 	struct devlink_rate *rate_node;
 	struct devlink_region *region;
 	unsigned long port_index;
@@ -6658,6 +6659,8 @@ void devlink_notify_unregister(struct devlink *devlink)
 
 	xa_for_each(&devlink->ports, port_index, devlink_port)
 		devlink_port_notify(devlink_port, DEVLINK_CMD_PORT_DEL);
+	list_for_each_entry_reverse(linecard, &devlink->linecard_list, list)
+		devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_DEL);
 	devlink_notify(devlink, DEVLINK_CMD_DEL);
 }
 
Signature · 1 line
2.41.0
#2 lore raw
In reply to Jiri Pirko
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

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

Quoted 9 lines · On Thu, 17 Aug 2023 14:52:40 +0200 you wrote:

From: Jiri Pirko <[email protected]>

Cited fixes commit introduced linecard notifications for register, however it didn't add them for unregister. Fix that by adding them.

Fixes c246f9b5fd61 ("devlink: add support to create line card and expose to user")

[...]

Here is the summary with links:
- [net-next] devlink: add missing unregister linecard notification

    https://git.kernel.org/netdev/net/c/2ebbc9752d06

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
author maintainer
#3 lore raw
In reply to Jiri Pirko

Kuba, do you plan to merge net into net-next any time soon? I have another patchset depending on this.

Btw, I aimed this to net-next on purpose, in net it does not make much sense imho.

Thanks!

Quoted 35 lines · Thu, Aug 17, 2023 at 02:52:40PM CEST, [email protected] wrote:

From: Jiri Pirko <[email protected]>

Cited fixes commit introduced linecard notifications for register, however it didn't add them for unregister. Fix that by adding them.

Fixes c246f9b5fd61 ("devlink: add support to create line card and expose to user")

---
net/devlink/leftover.c | 3 +++

1 file changed, 3 insertions(+)
net/devlink/leftover.c +3 -0
index c26c63275b0b..e7f76cc58533 100644
@@ -6630,6 +6630,7 @@ void devlink_notify_unregister(struct devlink *devlink)
 	struct devlink_param_item *param_item;
 	struct devlink_trap_item *trap_item;
 	struct devlink_port *devlink_port;
+	struct devlink_linecard *linecard;
 	struct devlink_rate *rate_node;
 	struct devlink_region *region;
 	unsigned long port_index;
@@ -6658,6 +6659,8 @@ void devlink_notify_unregister(struct devlink *devlink)
 
 	xa_for_each(&devlink->ports, port_index, devlink_port)
 		devlink_port_notify(devlink_port, DEVLINK_CMD_PORT_DEL);
+	list_for_each_entry_reverse(linecard, &devlink->linecard_list, list)
+		devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_DEL);
 	devlink_notify(devlink, DEVLINK_CMD_DEL);
 }
 
Signature · 1 line
2.41.0
maintainer
#4 lore raw

Hi,

Quoted 5 lines · Jiri Pirko

Kuba, do you plan to merge net into net-next any time soon? I have another patchset depending on this.

Btw, I aimed this to net-next on purpose, in net it does not make much sense imho.

That patch has been applied to net.

Today we have sent the PR for -net to Linus. Hopefully it should be merged into vanilla soon, and shortly after that, net will be merged back into net-next.

Usually that happen by the end of the day (european time).

Cheers,

Paolo