Hi Stephen,
On 07/02/2023 23:46, Stephen Rothwell wrote:
> Hi all,
>
> Today's linux-next merge of the net-next tree got a conflict in:
>
> net/devlink/leftover.c (net/core/devlink.c in the net tree)
>
> between commit:
>
> 565b4824c39f ("devlink: change port event netdev notifier from per-net to global")
>
> from the net tree and commits:
>
> f05bd8ebeb69 ("devlink: move code to a dedicated directory")
> 687125b5799c ("devlink: split out core code")
>
> from the net-next tree.
>
> I fixed it up (I used the latter version of this file and applied the
> following merge fix up) and can carry the fix as necessary.
Thank you for the fix!
I also had the same conflicts on MPTCP side when merging mptcp-next with
-net and I used the same resolution:
Tested-by: Matthieu Baerts <matthieu.baerts@xxxxxxxxxxxx>
I was just a bit confused because I didn't see the modifications in
net/devlink/leftover.c -- devlink_port_netdevice_event() function -- in
the patch you attached but I saw them on linux-next. I guess that's
because you used the latter version of this file.
Just in case it would help the net maintainers, I attached to this email
the modification I had on my side which looks the same as Jiri's
original patch but using the new paths.
Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
diff --git a/net/devlink/core.c b/net/devlink/core.c
index aeffd1b8206d..a4f47dafb864 100644
--- a/net/devlink/core.c
+++ b/net/devlink/core.c
@@ -205,7 +205,7 @@ struct devlink *devlink_alloc_ns(const struct devlink_ops *ops,
goto err_xa_alloc;
devlink->netdevice_nb.notifier_call = devlink_port_netdevice_event;
- ret = register_netdevice_notifier_net(net, &devlink->netdevice_nb);
+ ret = register_netdevice_notifier(&devlink->netdevice_nb);
if (ret)
goto err_register_netdevice_notifier;
@@ -266,8 +266,7 @@ void devlink_free(struct devlink *devlink)
xa_destroy(&devlink->snapshot_ids);
xa_destroy(&devlink->ports);
- WARN_ON_ONCE(unregister_netdevice_notifier_net(devlink_net(devlink),
- &devlink->netdevice_nb));
+ WARN_ON_ONCE(unregister_netdevice_notifier(&devlink->netdevice_nb));
xa_erase(&devlinks, devlink->index);
diff --git a/net/devlink/leftover.c b/net/devlink/leftover.c
index 9d6373603340..f05ab093d231 100644
--- a/net/devlink/leftover.c
+++ b/net/devlink/leftover.c
@@ -8430,6 +8430,8 @@ int devlink_port_netdevice_event(struct notifier_block *nb,
break;
case NETDEV_REGISTER:
case NETDEV_CHANGENAME:
+ if (devlink_net(devlink) != dev_net(netdev))
+ return NOTIFY_OK;
/* Set the netdev on top of previously set type. Note this
* event happens also during net namespace change so here
* we take into account netdev pointer appearing in this
@@ -8439,6 +8441,8 @@ int devlink_port_netdevice_event(struct notifier_block *nb,
netdev);
break;
case NETDEV_UNREGISTER:
+ if (devlink_net(devlink) != dev_net(netdev))
+ return NOTIFY_OK;
/* Clear netdev pointer, but not the type. This event happens
* also during net namespace change so we need to clear
* pointer to netdev that is going to another net namespace.