Subject: [PATCH 1/2] Revert "xen-netback: remove 'hotplug-status' once it has served its purpose"

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/[email protected]/T/#u

Cc: [email protected]
Signed-off-by: Marek Marczykowski-Górecki <[email protected]>
---
Cc: Michael Brown <[email protected]>
---
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


2022-02-21 12:57:04

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 1/2] Revert "xen-netback: remove 'hotplug-status' once it has served its purpose"

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/[email protected]/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 <[email protected]>

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/[email protected]