diff mbox series

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

Message ID 20220221034214.2237097-1-marmarek@invisiblethingslab.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [1/2] Revert "xen-netback: remove 'hotplug-status' once it has served its purpose" | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang fail Errors and warnings before: 18 this patch: 7
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 7 this patch: 6
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Marek Marczykowski-Górecki Feb. 21, 2022, 3:42 a.m. UTC
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(-)

Comments

kernel test robot Feb. 21, 2022, 9:10 a.m. UTC | #1
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
diff mbox series

Patch

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);
 }