From: Marek Marczykowski-Górecki <hidden> Date: 2022-02-22 00:19:05
This reverts commit 1f2565780e9b7218cf92c7630130e82dcc0fe9c2.
The 'hotplug-status' node should not be removed as long as the vif
device remains configured. Otherwise the xen-netback would wait for
re-running the network script even if it was already called (in case of
the frontent re-connecting). But also, it _should_ be removed when the
vif device is destroyed (for example when unbinding the driver) -
otherwise hotplug script would not configure the device whenever it
re-appear.
Moving removal of the 'hotplug-status' node was a workaround for nothing
calling network script after xen-netback module is reloaded. But when
vif interface is re-created (on xen-netback unbind/bind for example),
the script should be called, regardless of who does that - currently
this case is not handled by the toolstack, and requires manual
script call. Keeping hotplug-status=connected to skip the call is wrong
and leads to not configured interface.
More discussion at
https://lore.kernel.org/xen-devel/afedd7cb-a291-e773-8b0d-4db9b291fa98@ipxe.org/T/#u
Cc: stable@vger.kernel.org
Signed-off-by: Marek Marczykowski-Górecki <redacted>
---
Cc: Michael Brown <redacted>
Changes in v2:
- build fix, reported by kernel test robot [off-list ref]
---
drivers/net/xen-netback/xenbus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Marek Marczykowski-Górecki <hidden> Date: 2022-02-22 00:19:16
This reverts commit 2afeec08ab5c86ae21952151f726bfe184f6b23d.
The reasoning in the commit was wrong - the code expected to setup the
watch even if 'hotplug-status' didn't exist. In fact, it relied on the
watch being fired the first time - to check if maybe 'hotplug-status' is
already set to 'connected'. Not registering a watch for non-existing
path (which is the case if hotplug script hasn't been executed yet),
made the backend not waiting for the hotplug script to execute. This in
turns, made the netfront think the interface is fully operational, while
in fact it was not (the vif interface on xen-netback side might not be
configured yet).
This was a workaround for 'hotplug-status' erroneously being removed.
But since that is reverted now, the workaround is not necessary either.
More discussion at
https://lore.kernel.org/xen-devel/afedd7cb-a291-e773-8b0d-4db9b291fa98@ipxe.org/T/#u
Cc: stable@vger.kernel.org
Signed-off-by: Marek Marczykowski-Górecki <redacted>
---
I believe this is the same issue as discussed at
https://lore.kernel.org/xen-devel/20220113111946.GA4133739@dingwall.me.uk/
Cc: James Dingwall <james-xen@dingwall.me.uk
Cc: Michael Brown <redacted>
---
drivers/net/xen-netback/xenbus.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
From: Roger Pau Monné <hidden> Date: 2022-02-22 08:32:01
On Tue, Feb 22, 2022 at 01:18:17AM +0100, Marek Marczykowski-Górecki wrote:
This reverts commit 2afeec08ab5c86ae21952151f726bfe184f6b23d.
The reasoning in the commit was wrong - the code expected to setup the
watch even if 'hotplug-status' didn't exist. In fact, it relied on the
watch being fired the first time - to check if maybe 'hotplug-status' is
already set to 'connected'. Not registering a watch for non-existing
path (which is the case if hotplug script hasn't been executed yet),
made the backend not waiting for the hotplug script to execute. This in
turns, made the netfront think the interface is fully operational, while
in fact it was not (the vif interface on xen-netback side might not be
configured yet).
This was a workaround for 'hotplug-status' erroneously being removed.
But since that is reverted now, the workaround is not necessary either.
More discussion at
https://lore.kernel.org/xen-devel/afedd7cb-a291-e773-8b0d-4db9b291fa98@ipxe.org/T/#u
Cc: stable@vger.kernel.org
Signed-off-by: Marek Marczykowski-Górecki <redacted>
---
I believe this is the same issue as discussed at
https://lore.kernel.org/xen-devel/20220113111946.GA4133739@dingwall.me.uk/
Right - I believe we need to leave that workaround in place in libxl
in order to deal with bogus Linux netbacks?
Thanks, Roger.
From: Marek Marczykowski-Górecki <hidden> Date: 2022-02-22 10:55:53
On Tue, Feb 22, 2022 at 09:31:31AM +0100, Roger Pau Monné wrote:
On Tue, Feb 22, 2022 at 01:18:17AM +0100, Marek Marczykowski-Górecki wrote:
quoted
This reverts commit 2afeec08ab5c86ae21952151f726bfe184f6b23d.
The reasoning in the commit was wrong - the code expected to setup the
watch even if 'hotplug-status' didn't exist. In fact, it relied on the
watch being fired the first time - to check if maybe 'hotplug-status' is
already set to 'connected'. Not registering a watch for non-existing
path (which is the case if hotplug script hasn't been executed yet),
made the backend not waiting for the hotplug script to execute. This in
turns, made the netfront think the interface is fully operational, while
in fact it was not (the vif interface on xen-netback side might not be
configured yet).
This was a workaround for 'hotplug-status' erroneously being removed.
But since that is reverted now, the workaround is not necessary either.
More discussion at
https://lore.kernel.org/xen-devel/afedd7cb-a291-e773-8b0d-4db9b291fa98@ipxe.org/T/#u
Cc: stable@vger.kernel.org
Signed-off-by: Marek Marczykowski-Górecki <redacted>
---
I believe this is the same issue as discussed at
https://lore.kernel.org/xen-devel/20220113111946.GA4133739@dingwall.me.uk/
Right - I believe we need to leave that workaround in place in libxl
in order to deal with bogus Linux netbacks?
I'm afraid so, yes.
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
From: Jakub Kicinski <kuba@kernel.org> Date: 2022-02-24 03:44:32
On Tue, 22 Feb 2022 01:18:16 +0100 Marek Marczykowski-Górecki wrote:
This reverts commit 1f2565780e9b7218cf92c7630130e82dcc0fe9c2.
The 'hotplug-status' node should not be removed as long as the vif
device remains configured. Otherwise the xen-netback would wait for
re-running the network script even if it was already called (in case of
the frontent re-connecting). But also, it _should_ be removed when the
vif device is destroyed (for example when unbinding the driver) -
otherwise hotplug script would not configure the device whenever it
re-appear.
Moving removal of the 'hotplug-status' node was a workaround for nothing
calling network script after xen-netback module is reloaded. But when
vif interface is re-created (on xen-netback unbind/bind for example),
the script should be called, regardless of who does that - currently
this case is not handled by the toolstack, and requires manual
script call. Keeping hotplug-status=connected to skip the call is wrong
and leads to not configured interface.
More discussion at
https://lore.kernel.org/xen-devel/afedd7cb-a291-e773-8b0d-4db9b291fa98@ipxe.org/T/#u
Cc: stable@vger.kernel.org
Signed-off-by: Marek Marczykowski-Górecki <redacted>
From: Durrant, Paul <hidden> Date: 2022-02-24 07:54:21
On 22/02/2022 00:18, Marek Marczykowski-Górecki wrote:
This reverts commit 1f2565780e9b7218cf92c7630130e82dcc0fe9c2.
The 'hotplug-status' node should not be removed as long as the vif
device remains configured. Otherwise the xen-netback would wait for
re-running the network script even if it was already called (in case of
the frontent re-connecting). But also, it _should_ be removed when the
vif device is destroyed (for example when unbinding the driver) -
otherwise hotplug script would not configure the device whenever it
re-appear.
Moving removal of the 'hotplug-status' node was a workaround for nothing
calling network script after xen-netback module is reloaded. But when
vif interface is re-created (on xen-netback unbind/bind for example),
the script should be called, regardless of who does that - currently
this case is not handled by the toolstack, and requires manual
script call. Keeping hotplug-status=connected to skip the call is wrong
and leads to not configured interface.
More discussion at
https://lore.kernel.org/xen-devel/afedd7cb-a291-e773-8b0d-4db9b291fa98@ipxe.org/T/#u
Cc: stable@vger.kernel.org
Signed-off-by: Marek Marczykowski-Górecki <redacted>
From: Durrant, Paul <hidden> Date: 2022-02-24 07:56:25
On 22/02/2022 00:18, Marek Marczykowski-Górecki wrote:
This reverts commit 2afeec08ab5c86ae21952151f726bfe184f6b23d.
The reasoning in the commit was wrong - the code expected to setup the
watch even if 'hotplug-status' didn't exist. In fact, it relied on the
watch being fired the first time - to check if maybe 'hotplug-status' is
already set to 'connected'. Not registering a watch for non-existing
path (which is the case if hotplug script hasn't been executed yet),
made the backend not waiting for the hotplug script to execute. This in
turns, made the netfront think the interface is fully operational, while
in fact it was not (the vif interface on xen-netback side might not be
configured yet).
This was a workaround for 'hotplug-status' erroneously being removed.
But since that is reverted now, the workaround is not necessary either.
More discussion at
https://lore.kernel.org/xen-devel/afedd7cb-a291-e773-8b0d-4db9b291fa98@ipxe.org/T/#u
Cc: stable@vger.kernel.org
Signed-off-by: Marek Marczykowski-Górecki <redacted>
From: Michael Brown <hidden> Date: 2022-02-24 09:09:02
On 24/02/2022 07:56, Durrant, Paul wrote:
On 22/02/2022 00:18, Marek Marczykowski-Górecki wrote:
quoted
This reverts commit 2afeec08ab5c86ae21952151f726bfe184f6b23d.
The reasoning in the commit was wrong - the code expected to setup the
watch even if 'hotplug-status' didn't exist. In fact, it relied on the
watch being fired the first time - to check if maybe 'hotplug-status' is
already set to 'connected'. Not registering a watch for non-existing
path (which is the case if hotplug script hasn't been executed yet),
made the backend not waiting for the hotplug script to execute. This in
turns, made the netfront think the interface is fully operational, while
in fact it was not (the vif interface on xen-netback side might not be
configured yet).
This was a workaround for 'hotplug-status' erroneously being removed.
But since that is reverted now, the workaround is not necessary either.
More discussion at
https://lore.kernel.org/xen-devel/afedd7cb-a291-e773-8b0d-4db9b291fa98@ipxe.org/T/#u
Cc: stable@vger.kernel.org
Signed-off-by: Marek Marczykowski-Górecki
[off-list ref]
Reviewed-by: Paul Durrant <paul@xen.org>
In conjunction with patch 1/2 (which reverts the patch that caused the
original problem):
Reviewed-by: Michael Brown <redacted>
Thanks,
Michael
Hello:
This series was applied to netdev/net.git (master)
by Jakub Kicinski [off-list ref]:
On Tue, 22 Feb 2022 01:18:16 +0100 you wrote:
This reverts commit 1f2565780e9b7218cf92c7630130e82dcc0fe9c2.
The 'hotplug-status' node should not be removed as long as the vif
device remains configured. Otherwise the xen-netback would wait for
re-running the network script even if it was already called (in case of
the frontent re-connecting). But also, it _should_ be removed when the
vif device is destroyed (for example when unbinding the driver) -
otherwise hotplug script would not configure the device whenever it
re-appear.
[...]