* [PATCH 1/2] Revert "xen-netback: remove 'hotplug-status' once it has served its purpose"
@ 2022-02-21 3:42 Marek Marczykowski-Górecki
2022-02-21 3:42 ` [PATCH 2/2] Revert "xen-netback: Check for hotplug-status existence before watching" Marek Marczykowski-Górecki
2022-02-21 9:10 ` [PATCH 1/2] Revert "xen-netback: remove 'hotplug-status' once it has served its purpose" kernel test robot
0 siblings, 2 replies; 3+ messages in thread
From: Marek Marczykowski-Górecki @ 2022-02-21 3:42 UTC (permalink / raw)
To: linux-kernel
Cc: Marek Marczykowski-Górecki, stable, Michael Brown, Wei Liu,
Paul Durrant, David S. Miller, Jakub Kicinski,
moderated list:XEN NETWORK BACKEND DRIVER,
open list:XEN NETWORK BACKEND DRIVER
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 <marmarek@invisiblethingslab.com>
---
Cc: Michael Brown <mcb30@ipxe.org>
---
drivers/net/xen-netback/xenbus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index d24b7a7993aa..ce0f3035bee8 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -256,6 +256,7 @@ static void backend_disconnect(struct backend_info *be)
unsigned int queue_index;
xen_unregister_watchers(vif);
+ xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status");
#ifdef CONFIG_DEBUG_FS
xenvif_debugfs_delif(vif);
#endif /* CONFIG_DEBUG_FS */
@@ -675,7 +676,6 @@ static void hotplug_status_changed(struct xenbus_watch *watch,
/* Not interested in this watch anymore. */
unregister_hotplug_status_watch(be);
- xenbus_rm(XBT_NIL, be->dev->nodename, "hotplug-status");
}
kfree(str);
}
--
2.31.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] Revert "xen-netback: Check for hotplug-status existence before watching"
2022-02-21 3:42 [PATCH 1/2] Revert "xen-netback: remove 'hotplug-status' once it has served its purpose" Marek Marczykowski-Górecki
@ 2022-02-21 3:42 ` Marek Marczykowski-Górecki
2022-02-21 9:10 ` [PATCH 1/2] Revert "xen-netback: remove 'hotplug-status' once it has served its purpose" kernel test robot
1 sibling, 0 replies; 3+ messages in thread
From: Marek Marczykowski-Górecki @ 2022-02-21 3:42 UTC (permalink / raw)
To: linux-kernel
Cc: Marek Marczykowski-Górecki, stable, Michael Brown, Wei Liu,
Paul Durrant, David S. Miller, Jakub Kicinski,
moderated list:XEN NETWORK BACKEND DRIVER,
open list:XEN NETWORK BACKEND DRIVER
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 <marmarek@invisiblethingslab.com>
---
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 <mcb30@ipxe.org>
---
drivers/net/xen-netback/xenbus.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index ce0f3035bee8..9d7a3a92959f 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -824,15 +824,11 @@ static void connect(struct backend_info *be)
xenvif_carrier_on(be->vif);
unregister_hotplug_status_watch(be);
- if (xenbus_exists(XBT_NIL, dev->nodename, "hotplug-status")) {
- err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch,
- NULL, hotplug_status_changed,
- "%s/%s", dev->nodename,
- "hotplug-status");
- if (err)
- goto err;
+ err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch, NULL,
+ hotplug_status_changed,
+ "%s/%s", dev->nodename, "hotplug-status");
+ if (!err)
be->have_hotplug_status_watch = 1;
- }
netif_tx_wake_all_queues(be->vif->dev);
--
2.31.1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 1/2] Revert "xen-netback: remove 'hotplug-status' once it has served its purpose"
2022-02-21 3:42 [PATCH 1/2] Revert "xen-netback: remove 'hotplug-status' once it has served its purpose" Marek Marczykowski-Górecki
2022-02-21 3:42 ` [PATCH 2/2] Revert "xen-netback: Check for hotplug-status existence before watching" Marek Marczykowski-Górecki
@ 2022-02-21 9:10 ` kernel test robot
1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-02-21 9:10 UTC (permalink / raw)
To: Marek Marczykowski-Górecki, linux-kernel; +Cc: netdev
Hi "Marek,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linux/master]
[also build test ERROR on linus/master v5.17-rc5 next-20220217]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Marek-Marczykowski-G-recki/Revert-xen-netback-remove-hotplug-status-once-it-has-served-its-purpose/20220221-114409
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2c271fe77d52a0555161926c232cd5bc07178b39
config: x86_64-randconfig-a011-20220221 (https://download.01.org/0day-ci/archive/20220221/202202211740.AbFni9u8-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/0605cde993ca8f5f7ab43ae68117d73623edd227
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Marek-Marczykowski-G-recki/Revert-xen-netback-remove-hotplug-status-once-it-has-served-its-purpose/20220221-114409
git checkout 0605cde993ca8f5f7ab43ae68117d73623edd227
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> drivers/net/xen-netback/xenbus.c:259:22: error: use of undeclared identifier 'dev'
xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status");
^
1 error generated.
vim +/dev +259 drivers/net/xen-netback/xenbus.c
249
250 static void backend_disconnect(struct backend_info *be)
251 {
252 struct xenvif *vif = be->vif;
253
254 if (vif) {
255 unsigned int num_queues = vif->num_queues;
256 unsigned int queue_index;
257
258 xen_unregister_watchers(vif);
> 259 xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status");
260 #ifdef CONFIG_DEBUG_FS
261 xenvif_debugfs_delif(vif);
262 #endif /* CONFIG_DEBUG_FS */
263 xenvif_disconnect_data(vif);
264
265 /* At this point some of the handlers may still be active
266 * so we need to have additional synchronization here.
267 */
268 vif->num_queues = 0;
269 synchronize_net();
270
271 for (queue_index = 0; queue_index < num_queues; ++queue_index)
272 xenvif_deinit_queue(&vif->queues[queue_index]);
273
274 vfree(vif->queues);
275 vif->queues = NULL;
276
277 xenvif_disconnect_ctrl(vif);
278 }
279 }
280
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-02-21 9:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-21 3:42 [PATCH 1/2] Revert "xen-netback: remove 'hotplug-status' once it has served its purpose" Marek Marczykowski-Górecki
2022-02-21 3:42 ` [PATCH 2/2] Revert "xen-netback: Check for hotplug-status existence before watching" Marek Marczykowski-Górecki
2022-02-21 9:10 ` [PATCH 1/2] Revert "xen-netback: remove 'hotplug-status' once it has served its purpose" kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®