Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package powerpc-utils for openSUSE:Factory checked in at 2022-02-17 00:30:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/powerpc-utils (Old) and /work/SRC/openSUSE:Factory/.powerpc-utils.new.1956 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "powerpc-utils" Thu Feb 17 00:30:13 2022 rev:124 rq:955065 version:1.3.9 Changes: -------- --- /work/SRC/openSUSE:Factory/powerpc-utils/powerpc-utils.changes 2022-01-29 21:01:54.074746977 +0100 +++ /work/SRC/openSUSE:Factory/.powerpc-utils.new.1956/powerpc-utils.changes 2022-02-17 00:30:52.409429753 +0100 @@ -1,0 +2,22 @@ +Mon Feb 7 11:27:38 UTC 2022 - Michal Suchanek <msucha...@suse.com> + +- Fix HNV migration and other HNV issues (bsc#1195404 ltc#196259). + + 0016-functions.suse-fix-suse-wlist-utility-functions.patch + + 0017-functions.suse-don-t-implicitly-set-primary-to-1st-s.patch + + 0018-hcnmgr-add-x-option-to-trace-hcnmgr-script-execution.patch + + 0019-check-platform-service-after-getopts-parsing.patch + + 0020-call-less-intrusive-ifdown-ifup-in-rmdev_wicked.patch + + 0021-call-ifup-instead-ifreload-in-config_vdevice_wicked.patch + + 0022-split-scanhcn-function-into-nm-wicked-variants.patch + + 0023-hcnmgr-merged-scanhcn_wicked-id-fix-and-comments.patch + + 0024-Fix-race-with-udev-renaming-and-hcn-configure.patch + + 0025-hcnmgr-remove-ifcfg-file-dump-from-scanhcn_wicked.patch + + 0026-hcnmgr-move-sourcing-functions.suse-to-wicked-case.patch + + 0027-hcnmgr-extend-suse-os-release-match.patch + +------------------------------------------------------------------- +Wed Feb 2 17:29:51 UTC 2022 - Michal Suchanek <msucha...@suse.com> + +- Install smt.state as config file (bsc#1195413 ltc#193325). + +------------------------------------------------------------------- New: ---- 0016-functions.suse-fix-suse-wlist-utility-functions.patch 0017-functions.suse-don-t-implicitly-set-primary-to-1st-s.patch 0018-hcnmgr-add-x-option-to-trace-hcnmgr-script-execution.patch 0019-check-platform-service-after-getopts-parsing.patch 0020-call-less-intrusive-ifdown-ifup-in-rmdev_wicked.patch 0021-call-ifup-instead-ifreload-in-config_vdevice_wicked.patch 0022-split-scanhcn-function-into-nm-wicked-variants.patch 0023-hcnmgr-merged-scanhcn_wicked-id-fix-and-comments.patch 0024-Fix-race-with-udev-renaming-and-hcn-configure.patch 0025-hcnmgr-remove-ifcfg-file-dump-from-scanhcn_wicked.patch 0026-hcnmgr-move-sourcing-functions.suse-to-wicked-case.patch 0027-hcnmgr-extend-suse-os-release-match.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ powerpc-utils.spec ++++++ --- /var/tmp/diff_new_pack.OLJqiK/_old 2022-02-17 00:30:53.253429608 +0100 +++ /var/tmp/diff_new_pack.OLJqiK/_new 2022-02-17 00:30:53.257429607 +0100 @@ -52,6 +52,18 @@ Patch27: 0013-adjust-sourcing-path-of-the-functions.suse-library.patch Patch28: 0014-Enable-the-network-service-checks.patch Patch29: 0015-add-hcn-init.service.suse-service-covering-wicked.patch +Patch30: 0016-functions.suse-fix-suse-wlist-utility-functions.patch +Patch31: 0017-functions.suse-don-t-implicitly-set-primary-to-1st-s.patch +Patch32: 0018-hcnmgr-add-x-option-to-trace-hcnmgr-script-execution.patch +Patch33: 0019-check-platform-service-after-getopts-parsing.patch +Patch34: 0020-call-less-intrusive-ifdown-ifup-in-rmdev_wicked.patch +Patch35: 0021-call-ifup-instead-ifreload-in-config_vdevice_wicked.patch +Patch36: 0022-split-scanhcn-function-into-nm-wicked-variants.patch +Patch37: 0023-hcnmgr-merged-scanhcn_wicked-id-fix-and-comments.patch +Patch38: 0024-Fix-race-with-udev-renaming-and-hcn-configure.patch +Patch39: 0025-hcnmgr-remove-ifcfg-file-dump-from-scanhcn_wicked.patch +Patch40: 0026-hcnmgr-move-sourcing-functions.suse-to-wicked-case.patch +Patch41: 0027-hcnmgr-extend-suse-os-release-match.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: libnuma-devel @@ -137,7 +149,7 @@ /sbin/lsprop %endif %dir %{_localstatedir}/lib/powerpc-utils -%ghost %{_localstatedir}/lib/powerpc-utils/smt.state +%config(noreplace) %{_localstatedir}/lib/powerpc-utils/smt.state %dir /usr/lib/powerpc-utils /usr/lib/powerpc-utils/functions.suse %{_unitdir}/hcn-init.service ++++++ 0001-Validate-connection-manager.patch ++++++ --- /var/tmp/diff_new_pack.OLJqiK/_old 2022-02-17 00:30:53.281429603 +0100 +++ /var/tmp/diff_new_pack.OLJqiK/_new 2022-02-17 00:30:53.285429602 +0100 @@ -1,7 +1,7 @@ From 8474223e844ecf13606fe9ebab2198838b877947 Mon Sep 17 00:00:00 2001 From: Mingming Cao <m...@linux.vnet.ibm.com> Date: Thu, 13 Jan 2022 06:18:53 -0800 -Subject: [PATCH 01/15] Validate connection manager +Subject: [PATCH 01/27] Validate connection manager Check and validate what OS is on the system and what type of connection manager is used: Wicked or NetworkManager ++++++ 0002-factor-out-NetworkManager-nmcli-code.patch ++++++ --- /var/tmp/diff_new_pack.OLJqiK/_old 2022-02-17 00:30:53.301429600 +0100 +++ /var/tmp/diff_new_pack.OLJqiK/_new 2022-02-17 00:30:53.305429599 +0100 @@ -1,7 +1,7 @@ From 2a46892673bc081da3a8de57a8ff0466d6ec2c25 Mon Sep 17 00:00:00 2001 From: Mingming Cao <m...@linux.vnet.ibm.com> Date: Thu, 13 Jan 2022 06:20:28 -0800 -Subject: [PATCH 02/15] factor out NetworkManager nmcli code +Subject: [PATCH 02/27] factor out NetworkManager nmcli code Signed-off-by: Mingming Cao <m...@linux.vnet.ibm.com> --- ++++++ 0003-Add-new-wicked-functions-from-suse-to-manage-bonding.patch ++++++ --- /var/tmp/diff_new_pack.OLJqiK/_old 2022-02-17 00:30:53.321429596 +0100 +++ /var/tmp/diff_new_pack.OLJqiK/_new 2022-02-17 00:30:53.325429596 +0100 @@ -1,7 +1,7 @@ From aeaf71efb4a761892f566f996d70d60e4233958e Mon Sep 17 00:00:00 2001 From: Mingming Cao <m...@linux.vnet.ibm.com> Date: Thu, 13 Jan 2022 06:22:46 -0800 -Subject: [PATCH 03/15] Add new wicked functions from suse to manage bonding +Subject: [PATCH 03/27] Add new wicked functions from suse to manage bonding interfaces suse specific hcnmgr utilities to manipulate suse ifcfg files ++++++ 0004-Support-wicked-HNV-using-new-wicked-interfaces-for.patch ++++++ --- /var/tmp/diff_new_pack.OLJqiK/_old 2022-02-17 00:30:53.337429594 +0100 +++ /var/tmp/diff_new_pack.OLJqiK/_new 2022-02-17 00:30:53.341429593 +0100 @@ -1,7 +1,7 @@ From ee5dc5c4aa9da2c1c1d975c2d03e6ea8e73cdbd3 Mon Sep 17 00:00:00 2001 From: Mingming Cao <m...@linux.vnet.ibm.com> Date: Thu, 13 Jan 2022 06:24:48 -0800 -Subject: [PATCH 04/15] Support wicked HNV using new wicked interfaces for +Subject: [PATCH 04/27] Support wicked HNV using new wicked interfaces for bonding Signed-off-by: Mingming Cao <m...@linux.vnet.ibm.com> ++++++ 0005-Set-modprobe-bonding-max_bonds-0-option.patch ++++++ --- /var/tmp/diff_new_pack.OLJqiK/_old 2022-02-17 00:30:53.357429590 +0100 +++ /var/tmp/diff_new_pack.OLJqiK/_new 2022-02-17 00:30:53.361429589 +0100 @@ -1,7 +1,7 @@ From 7f4602d7df66aa42c5b269a9cdc5e6c8e1cb30e2 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Mon, 24 Jan 2022 17:50:05 +0100 -Subject: [PATCH 05/15] Set modprobe bonding max_bonds=0 option +Subject: [PATCH 05/27] Set modprobe bonding max_bonds=0 option Avoid bond0 interface creation while module init in the kernel. --- ++++++ 0006-cleanup-hcnmgr-distro-and-service-detection.patch ++++++ --- /var/tmp/diff_new_pack.OLJqiK/_old 2022-02-17 00:30:53.373429587 +0100 +++ /var/tmp/diff_new_pack.OLJqiK/_new 2022-02-17 00:30:53.377429586 +0100 @@ -1,7 +1,7 @@ From 6106b6bbedbe1a90054f8749abc036ce6d299e8e Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Mon, 24 Jan 2022 20:20:35 +0100 -Subject: [PATCH 06/15] cleanup hcnmgr distro and service detection +Subject: [PATCH 06/27] cleanup hcnmgr distro and service detection --- scripts/hcnmgr | 153 ++++++++++++++++++++++++++++++------------------- ++++++ 0007-Remove-wicked-ifup-calls-that-just-run-into-timeouts.patch ++++++ --- /var/tmp/diff_new_pack.OLJqiK/_old 2022-02-17 00:30:53.393429583 +0100 +++ /var/tmp/diff_new_pack.OLJqiK/_new 2022-02-17 00:30:53.397429583 +0100 @@ -1,7 +1,7 @@ From 79a030172b31b07753aee4c9ec38700733dff37f Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Mon, 24 Jan 2022 20:24:12 +0100 -Subject: [PATCH 07/15] Remove wicked ifup calls that just run into timeouts +Subject: [PATCH 07/27] Remove wicked ifup calls that just run into timeouts Setting up a bonding without any slave will never reach an link-up state as the bond can't detect carrier and ++++++ 0008-add-note-about-comma-in-hcnmgr-BONDOPTIONS.patch ++++++ --- /var/tmp/diff_new_pack.OLJqiK/_old 2022-02-17 00:30:53.413429580 +0100 +++ /var/tmp/diff_new_pack.OLJqiK/_new 2022-02-17 00:30:53.421429579 +0100 @@ -1,7 +1,7 @@ From ea4f6a210d8ef27dbfa02e7706f404e638e20e46 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Mon, 24 Jan 2022 20:43:42 +0100 -Subject: [PATCH 08/15] add note about comma in hcnmgr BONDOPTIONS +Subject: [PATCH 08/27] add note about comma in hcnmgr BONDOPTIONS --- scripts/hcnmgr | 5 ++++- ++++++ 0009-Fix-to-call-wicked-ifreload-directly.patch ++++++ --- /var/tmp/diff_new_pack.OLJqiK/_old 2022-02-17 00:30:53.433429577 +0100 +++ /var/tmp/diff_new_pack.OLJqiK/_new 2022-02-17 00:30:53.437429576 +0100 @@ -1,7 +1,7 @@ From c6eb3f4b817d641ce84172566cb9ab308cadbb51 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Wed, 26 Jan 2022 18:26:40 +0100 -Subject: [PATCH 09/15] Fix to call wicked ifreload directly +Subject: [PATCH 09/27] Fix to call wicked ifreload directly The wicked_reload() wrapper function were not working as it were using a function from a not included library. ++++++ 0010-Fix-incorrect-parameters-to-suse_ifcfg_bond_create.patch ++++++ --- /var/tmp/diff_new_pack.OLJqiK/_old 2022-02-17 00:30:53.457429573 +0100 +++ /var/tmp/diff_new_pack.OLJqiK/_new 2022-02-17 00:30:53.461429572 +0100 @@ -1,7 +1,7 @@ From 59b9469dc1496f376dcf659c93db10d38e3fcff9 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Wed, 26 Jan 2022 18:30:12 +0100 -Subject: [PATCH 10/15] Fix incorrect parameters to suse_ifcfg_bond_create +Subject: [PATCH 10/27] Fix incorrect parameters to suse_ifcfg_bond_create --- scripts/hcnmgr | 2 +- ++++++ 0011-Fix-comment-about-setting-primary.patch ++++++ --- /var/tmp/diff_new_pack.OLJqiK/_old 2022-02-17 00:30:53.473429570 +0100 +++ /var/tmp/diff_new_pack.OLJqiK/_new 2022-02-17 00:30:53.473429570 +0100 @@ -1,7 +1,7 @@ From 5428ce5a46cf51d17bfb85db03569b251fd5b0a1 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Wed, 26 Jan 2022 18:34:13 +0100 -Subject: [PATCH 11/15] Fix comment about setting primary +Subject: [PATCH 11/27] Fix comment about setting primary The suse_ifcfg_bond_set_primary adjusts it in the config only (the bond may not exist yet), the following wicked ifreload ++++++ 0012-Description-and-indenting-corrections.patch ++++++ --- /var/tmp/diff_new_pack.OLJqiK/_old 2022-02-17 00:30:53.489429567 +0100 +++ /var/tmp/diff_new_pack.OLJqiK/_new 2022-02-17 00:30:53.489429567 +0100 @@ -1,7 +1,7 @@ From a533e59f09b05c1cb1876b82a6f0498941562864 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Wed, 26 Jan 2022 18:40:08 +0100 -Subject: [PATCH 12/15] Description and indenting corrections +Subject: [PATCH 12/27] Description and indenting corrections --- scripts/functions.suse | 27 ++++++++++++++------------- ++++++ 0013-adjust-sourcing-path-of-the-functions.suse-library.patch ++++++ --- /var/tmp/diff_new_pack.OLJqiK/_old 2022-02-17 00:30:53.509429563 +0100 +++ /var/tmp/diff_new_pack.OLJqiK/_new 2022-02-17 00:30:53.513429563 +0100 @@ -1,7 +1,7 @@ From d8c65364ed7e1b3144b55526dccdff6ce1947c47 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Wed, 26 Jan 2022 18:43:04 +0100 -Subject: [PATCH 13/15] adjust sourcing path of the functions.suse library +Subject: [PATCH 13/27] adjust sourcing path of the functions.suse library Use /usr/lib/powerpc-utils/functions.suse (libexecdir) --- ++++++ 0014-Enable-the-network-service-checks.patch ++++++ --- /var/tmp/diff_new_pack.OLJqiK/_old 2022-02-17 00:30:53.525429561 +0100 +++ /var/tmp/diff_new_pack.OLJqiK/_new 2022-02-17 00:30:53.529429560 +0100 @@ -1,7 +1,7 @@ From 2822ad29d29f9b6e24f0a386c1fd7d99931e249a Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Wed, 26 Jan 2022 18:54:35 +0100 -Subject: [PATCH 14/15] Enable the network service checks +Subject: [PATCH 14/27] Enable the network service checks --- scripts/hcnmgr | 22 +++++++++++++++++++--- ++++++ 0015-add-hcn-init.service.suse-service-covering-wicked.patch ++++++ --- /var/tmp/diff_new_pack.OLJqiK/_old 2022-02-17 00:30:53.537429559 +0100 +++ /var/tmp/diff_new_pack.OLJqiK/_new 2022-02-17 00:30:53.541429558 +0100 @@ -1,7 +1,7 @@ From a831053d868f806a61ee06b88a3ee917a42586b4 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Wed, 26 Jan 2022 22:10:36 +0100 -Subject: [PATCH 15/15] add hcn-init.service.suse service covering wicked +Subject: [PATCH 15/27] add hcn-init.service.suse service covering wicked While hcnmgr -s needs to communicate with NetworkManager and thus the hcn-init.service has to start after it, in wicked ++++++ 0016-functions.suse-fix-suse-wlist-utility-functions.patch ++++++ >From 60a6b2c2d5bca6863ccbe56ec1aefcb37e1722c1 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Mon, 7 Feb 2022 13:34:31 +0100 Subject: [PATCH 16/27] functions.suse: fix suse wlist utility functions --- scripts/functions.suse | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/functions.suse b/scripts/functions.suse index 57a95db..1bd3435 100644 --- a/scripts/functions.suse +++ b/scripts/functions.suse @@ -29,7 +29,7 @@ suse_ifcfg_config_dir="/etc/sysconfig/network" suse_wlist_find() { local item want="$1" ; shift - for item in $* ; do + for item in "$@" ; do [ X"$want" = X"$item" ] && return 0 done return 1 @@ -37,11 +37,11 @@ suse_wlist_find() suse_wlist_uniq() { local item list=() - for item in $* ; do - suse_wlist_find "$item" "$list" && continue + for item in "$@" ; do + suse_wlist_find "$item" "${list[@]}" && continue list+=("$item") done - echo "${list[*]}" + echo "${list[@]}" } suse_ifcfg_unquote() { -- 2.34.1 ++++++ 0017-functions.suse-don-t-implicitly-set-primary-to-1st-s.patch ++++++ >From faf460e7849c9deeed0bf19cf9438bf80f90f8a1 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Mon, 7 Feb 2022 13:38:31 +0100 Subject: [PATCH 17/27] functions.suse: don't implicitly set primary to 1st slave --- scripts/functions.suse | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/functions.suse b/scripts/functions.suse index 1bd3435..06696dd 100644 --- a/scripts/functions.suse +++ b/scripts/functions.suse @@ -115,10 +115,6 @@ suse_ifcfg_bond_master_template() if [ X"${options[*]}" = X ] ; then # default options as used by the hcnmgr options=(mode=active-backup miimon=100 fail_over_mac=follow) - # set 1st slave as primary to inherit the mac from (by default) - if [ X"${slaves[0]}" != X ] ; then - options+=("primary=${slaves[0]}") - fi fi echo "STARTMODE='auto'" @@ -368,8 +364,6 @@ suse_ifcfg_bond_modify() if [ X"$primary" != X ] ; then if suse_wlist_find "$primary" "${nslaves[*]}" ; then noptions+=("primary=$primary") - elif [ X"${nslaves[0]}" != X ] ; then - noptions+=("primary=${nslaves[0]}") fi fi fi -- 2.34.1 ++++++ 0018-hcnmgr-add-x-option-to-trace-hcnmgr-script-execution.patch ++++++ >From 0dfa9a19e87c32f2c68642e87ac06cd4bc821ec1 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Mon, 7 Feb 2022 13:49:58 +0100 Subject: [PATCH 18/27] hcnmgr: add -x option to trace hcnmgr script execution Alternatively, the HCNTRACE can be initialized to -x or -vx. --- scripts/hcnmgr | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/hcnmgr b/scripts/hcnmgr index f8e0c6a..cd5c9a4 100644 --- a/scripts/hcnmgr +++ b/scripts/hcnmgr @@ -31,6 +31,7 @@ PSERIES_PLATFORM=$(dirname "$0")/pseries_platform DT_PATH="/proc/device-tree" HCNMGR="hcnmgr" HCNCMD="" +HCNTRACE="" LOG_FILE="/var/log/hcnmgr" HCN_LOGGING_LEVEL=DEBUG HCNID=0 @@ -68,6 +69,7 @@ usage() { echo "" echo "Optional arguments." echo " -s scan device-tree and configure HCN" + echo " -x trace hcnmgr script execution" echo " -V Display version information and exit" echo " -h Display this help information and exit" echo "" @@ -858,7 +860,7 @@ if ! lsmod | grep -q bonding; then fi #getops for help and version -while getopts "sVhd:" arg; do +while getopts "sxVhd:" arg; do case "$arg" in V) show_version @@ -871,6 +873,9 @@ while getopts "sVhd:" arg; do s) HCNCMD="hcnscan" ;; + x) + HCNTRACE="-x" + ;; d) hcnlog DEBUG "HMC pass log level at $OPTARG" hcnlog DEBUG "$HCNCMD is always log at $HCN_LOGGING_LEVEL level" @@ -885,6 +890,11 @@ done #Log this scripts command line to syslog hcnlog INFO "$HCNCMD $*" +#Enable bash -x or -vx call trace if requested +if [ "X$HCNTRACE" != "X" ] ; then + set "$HCNTRACE" +fi + #Parse the DRC_INDEX and HCN_ID from the arguments for param in "$@"; do if [[ $param =~ ^DRC_INDEX=(.+)$ ]]; then -- 2.34.1 ++++++ 0019-check-platform-service-after-getopts-parsing.patch ++++++ >From ae0c6f88f780fafaa6772bc1dbd18ec18959cc54 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Mon, 7 Feb 2022 13:57:01 +0100 Subject: [PATCH 19/27] check platform/service after getopts parsing --- scripts/hcnmgr | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/scripts/hcnmgr b/scripts/hcnmgr index cd5c9a4..4fa6308 100644 --- a/scripts/hcnmgr +++ b/scripts/hcnmgr @@ -840,25 +840,6 @@ echo "=======================$NOW============================" HCNCMD=$(basename "$0") hcnlog DEBUG "$HCNCMD enter" -#Validate this tool is running on powerpc platform -. "$PSERIES_PLATFORM" -if [ "$platform" != "$PLATFORM_PSERIES_LPAR" ]; then - hcnlog INFO "HNV is only supported on PowerVM LPAR" - hcnlog INFO "$HCNCMD exit" - exit 0 -fi - -#Init the distribution and the network service -check_network_service - -#Validate bonding module is loaded -if ! lsmod | grep -q bonding; then - hcnlog DEBUG "HCNMGR: Bonding module not loaded, load module ..." - if ! modprobe bonding $BOND_MODPROBE_OPTS; then - err $E_NOMODULE - fi -fi - #getops for help and version while getopts "sxVhd:" arg; do case "$arg" in @@ -895,6 +876,25 @@ if [ "X$HCNTRACE" != "X" ] ; then set "$HCNTRACE" fi +#Validate this tool is running on powerpc platform +. "$PSERIES_PLATFORM" +if [ "$platform" != "$PLATFORM_PSERIES_LPAR" ]; then + hcnlog INFO "HNV is only supported on PowerVM LPAR" + hcnlog INFO "$HCNCMD exit" + exit 0 +fi + +#Init the distribution and the network service +check_network_service + +#Validate bonding module is loaded +if ! lsmod | grep -q bonding; then + hcnlog DEBUG "HCNMGR: Bonding module not loaded, load module ..." + if ! modprobe bonding $BOND_MODPROBE_OPTS; then + err $E_NOMODULE + fi +fi + #Parse the DRC_INDEX and HCN_ID from the arguments for param in "$@"; do if [[ $param =~ ^DRC_INDEX=(.+)$ ]]; then -- 2.34.1 ++++++ 0020-call-less-intrusive-ifdown-ifup-in-rmdev_wicked.patch ++++++ >From 5165e9a04c9f9ce0225f00700733e58f36590c3c Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Mon, 7 Feb 2022 14:04:28 +0100 Subject: [PATCH 20/27] call less intrusive ifdown + ifup in rmdev_wicked --- scripts/hcnmgr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/hcnmgr b/scripts/hcnmgr index 4fa6308..b6def58 100644 --- a/scripts/hcnmgr +++ b/scripts/hcnmgr @@ -614,7 +614,8 @@ rmdev_nm() { rmdev_wicked() { hcnlog DEBUG "rmdev_wicked: enter" suse_ifcfg_bond_del_slave "$BONDNAME" "$DEVNAME" - wicked ifreload "$BONDNAME" + wicked ifdown "$DEVNAME" + wicked ifup "$BONDNAME" hcnlog DEBUG "rmdev_wicked: exit" return $E_SUCCESS } -- 2.34.1 ++++++ 0021-call-ifup-instead-ifreload-in-config_vdevice_wicked.patch ++++++ >From dea0d8f2ad4466b518fedf7d474450c398b79fe2 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Mon, 7 Feb 2022 14:05:33 +0100 Subject: [PATCH 21/27] call ifup instead ifreload in config_vdevice_wicked --- scripts/hcnmgr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/hcnmgr b/scripts/hcnmgr index b6def58..cc38a6a 100644 --- a/scripts/hcnmgr +++ b/scripts/hcnmgr @@ -401,7 +401,7 @@ do_config_vdevice_wicked() { if systemctl is-active -q wicked.service ; then # Apply the config changes to wicked hcnlog DEBUG "Bring up the $BONDNAME interface" - wicked ifreload "$BONDNAME" + wicked ifup "$BONDNAME" fi hcnlog DEBUG "do_config_vdevice: exit" -- 2.34.1 ++++++ 0022-split-scanhcn-function-into-nm-wicked-variants.patch ++++++ >From cf91a25dfec11db5bcce3dde3c92331e9d913f0f Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Mon, 7 Feb 2022 14:10:46 +0100 Subject: [PATCH 22/27] split scanhcn function into nm+wicked variants --- scripts/hcnmgr | 112 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 111 insertions(+), 1 deletion(-) diff --git a/scripts/hcnmgr b/scripts/hcnmgr index cc38a6a..a31e096 100644 --- a/scripts/hcnmgr +++ b/scripts/hcnmgr @@ -692,7 +692,7 @@ scanhcn_cleanup_old_hnv_nm() { # ibm,hcn-id, if the hybrid network has not been created, create HCN # (active-backup bonding) for them. # -scanhcn() { +scanhcn_nm() { local HcnIds=() hcnlog DEBUG "scanhcn: on boot scan for hybrid virtual network starts" @@ -773,6 +773,116 @@ scanhcn() { hcnlog DEBUG "scanhcn: scan for hybrid virtual network finished" } +scanhcn_wicked() { + local hcnids=() + local -A hcn_devs hcn_primary + local file dev + + hcnlog DEBUG "scanhcn: on boot scan for hybrid virtual network starts" + + hcnlog DEBUG "search sr_iov device with ibm,hcn-id propterty......" + # Look at pci ethernet devices for SR_IOV VFs with ibm,hcn-id propterty + # join or Create bond for this hcnid if not exist, add SR-IOVs as primary + # slave for this bond accosiated with hcnid, if not already to + for pci_dev in "$DT_PATH"/pci*; do + [ -d "$pci_dev" ] || continue + for dev in "$pci_dev"/ethernet*; do + [ -d "$dev" ] || continue + if [ -e "$dev"/ibm,hcn-id ] && get_dev_hcn "$dev"; then + hcnlog DEBUG "scanhcn found $MODE sr-iov device $DEVNAME with hcnid $HCNID" + # Collect what we have found + hcnids=($(suse_wlist_uniq ${hcnids[*]} $HCNID)) + hcn_devs[$HCNID]=$(suse_wlist_uniq ${hcn_devs[$HCNID]} $DEVNAME) + [ "X$MODE" = "Xprimary" ] && hcn_primary[$HCNID]="$DEVNAME" + fi + done + done + + hcnlog DEBUG "search ibmveth device with ibm,hcn-id propterty......" + # Look at every vNIC device with ibm,hcn-id propterty + # join or create bond for this hcnid if not exist, add vnic device as + # slave for this bond accosiated with hcnid, if not already to + for dev in "$DT_PATH"/vdevice/l-lan*; do + [ -d "$dev" ] || continue + if [ -e "$dev"/ibm,hcn-id ] && get_dev_hcn "$dev"; then + hcnlog DEBUG "scanhcn found $MODE veth device $DEVNAME with hcnid $HCNID" + # Collect what we have found + hcnids=($(suse_wlist_uniq ${hcnids[*]} $HCNID)) + hcn_devs[$HCNID]=$(suse_wlist_uniq ${hcn_devs[$HCNID]} $DEVNAME) + [ "X$MODE" = "Xprimary" ] && hcn_primary[$HCNID]="$DEVNAME" + fi + done + + hcnlog DEBUG "search vnic device with ibm,hcn-id propterty......" + # Look at every vNIC device with ibm,hcn-id propterty + # join or create bond for this hcnid if not exist, add vnic device as + # slave for this bond accosiated with hcnid, if not already to + for dev in "$DT_PATH"/vdevice/vnic*; do + [ -d "$dev" ] || continue + if [ -e "$dev"/ibm,hcn-id ] && get_dev_hcn "$dev"; then + hcnlog DEBUG "scanhcn found $MODE vnic device $DEVNAME with hcnid $HCNID" + # Collect what we have found + hcnids=($(suse_wlist_uniq ${hcnids[*]} $HCNID)) + hcn_devs[$HCNID]=$(suse_wlist_uniq ${hcn_devs[$HCNID]} $DEVNAME) + [ "X$MODE" = "Xprimary" ] && hcn_primary[$HCNID]="$DEVNAME" + fi + done + + # TODO: delete orphan bond$HCNID configs ... test -- can this happen? : + # when the LPAR has been shut down, the configuration changes then, + # e.g. from: bond$HCNID_old { eth0, eth1 } + # into: bond$HCNID_new { eth0, eth2 } + # ^^^^ + # there is still a config for bond$HCNID_old that we need to remove + # (at boot) _before_ we can setup bond$HCNID_new as the new bond is + # (re)using one slave device of the old bond.. + # This requires to know which bond is managed via HCN and we may need + # to mark or remember the hcn managed bonds... + + # (Re)configure all bonds + for hcnid in "${hcnids[@]}" ; do + local bond="bond$hcnid" + local primary="${hcn_primary[$HCNID]}" + local devices="${hcn_devs[$HCNID]}" + + hcnlog INFO "scanhcn configure HCN $bond with devices '$devices'" + if suse_ifcfg_bond_modify "$bond" "$devices" ; then + hcnlog INFO "scanhcn configured bond '$bond' config with devices '$devices'" + else + hcnlog INFO "scanhcn failed to configure bond '$bond' with devices '$devices'" + continue + fi + if suse_ifcfg_bond_set_primary "$bond" "$primary" ; then + hcnlog INFO "scanhcn adjusted bond '$bond' config primary to '$primary'" + else + hcnlog INFO "scanhcn failed to adjust bond '$bond' config primary to '$primary'" + fi + echo "* $bond config:" + cat $(suse_ifcfg_file_name "$bond") + + if systemctl is-active -q wicked.service ; then + hcnlog INFO "scanhcn reloading HCN bonding: $bond" + wicked ifreload "$bond" + else + hcnlog INFO "scanhcn omits HCN bondings reload due to inactive network" + # at boot, hcn-init.service adjusts the configuration and + # the wicked.service starting after sets up the bondings. + fi + done + + hcnlog DEBUG "scanhcn: scan for hybrid virtual network finished" + return $E_SUCCESS +} +scanhcn() { + case $SERVICE in + NetworkManager.service) + scanhcn_nm + ;; + wicked.service) + scanhcn_wicked + ;; + esac +} # function check_network_service # Check what connection manager is used -- 2.34.1 ++++++ 0023-hcnmgr-merged-scanhcn_wicked-id-fix-and-comments.patch ++++++ >From cf6891504c005859d073c73489b49b9f7696a648 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Mon, 7 Feb 2022 15:01:27 +0100 Subject: [PATCH 23/27] hcnmgr: merged scanhcn_wicked id fix and comments from https://github.com/mcao-zz/powerpc-utils/commits/next2 --- scripts/hcnmgr | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/scripts/hcnmgr b/scripts/hcnmgr index a31e096..2d6721d 100644 --- a/scripts/hcnmgr +++ b/scripts/hcnmgr @@ -675,7 +675,7 @@ scanhcn_cleanup_old_hnv_nm() { done } # -# function scanhcn +# function scanhcn_nm # HMC supports adding migratable sr-iov when LPAR is inactive. This allows LPAR # can be migrated when inactive with SR_IOV VFS. It will set the # migratable sr-iov device and it's backup vdevice vnic or veth with @@ -773,6 +773,14 @@ scanhcn_nm() { hcnlog DEBUG "scanhcn: scan for hybrid virtual network finished" } + +# +# function scanhcn_wicked +# +# This function will scan the device-tree to find new SR-IOV vfs and virtual devices +# that has configured as migratable sr-iov device or as backup vdevice during LPAR +# is inactive (or during manual 'hcnmgr -s' call). +# scanhcn_wicked() { local hcnids=() local -A hcn_devs hcn_primary @@ -828,22 +836,21 @@ scanhcn_wicked() { fi done - # TODO: delete orphan bond$HCNID configs ... test -- can this happen? : - # when the LPAR has been shut down, the configuration changes then, + # TODO: when the LPAR has been shut down and the configuration changes then, # e.g. from: bond$HCNID_old { eth0, eth1 } # into: bond$HCNID_new { eth0, eth2 } # ^^^^ # there is still a config for bond$HCNID_old that we need to remove - # (at boot) _before_ we can setup bond$HCNID_new as the new bond is - # (re)using one slave device of the old bond.. + # at LPAR boot _before_ we can setup bond$HCNID_new as the new bond + # is (re)using one slave device of the old bond.. # This requires to know which bond is managed via HCN and we may need # to mark or remember the hcn managed bonds... # (Re)configure all bonds - for hcnid in "${hcnids[@]}" ; do - local bond="bond$hcnid" - local primary="${hcn_primary[$HCNID]}" - local devices="${hcn_devs[$HCNID]}" + for id in "${hcnids[@]}" ; do + local bond="bond$id" + local primary="${hcn_primary[$id]}" + local devices="${hcn_devs[$id]}" hcnlog INFO "scanhcn configure HCN $bond with devices '$devices'" if suse_ifcfg_bond_modify "$bond" "$devices" ; then -- 2.34.1 ++++++ 0024-Fix-race-with-udev-renaming-and-hcn-configure.patch ++++++ >From 65eaf8f906423bd3d6a7b20af0045f89340521b7 Mon Sep 17 00:00:00 2001 From: Mingming Cao <m...@linux.vnet.ibm.com> Date: Sun, 6 Feb 2022 13:42:06 -0800 Subject: [PATCH 24/27] Fix race with udev renaming and hcn configure There is a race window when udev has not finished renaming rules, hcn may enslave an temprory device name into the master bonding configration, instead the final device name. We fix this by moving udev settle before search for device name, so by the time the cfg is called, it is using the correct device name Signed-off-by: Mingming Cao <m...@linux.vnet.ibm.com> --- scripts/hcnmgr | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/scripts/hcnmgr b/scripts/hcnmgr index 2d6721d..705f914 100644 --- a/scripts/hcnmgr +++ b/scripts/hcnmgr @@ -418,14 +418,15 @@ do_config_vdevice() { ;; esac } + # -# function cfghcn +# function cfghcn_nm # Given device DRC_INDEX, configure or create HCN (active-backup bonding) # add device as bonding slave # # $1 DRC_INDEX of the hybrid network device # -cfghcn() { +cfghcn_nm() { local retry=3 hcnlog DEBUG "cfghcn: enter $1" @@ -452,6 +453,51 @@ cfghcn() { return $E_SUCCESS } +# +# function cfghcn_wicked +# Given device DRC_INDEX, configure or create HCN (active-backup bonding) +# add device as bonding slave +# +# $1 DRC_INDEX of the hybrid network device +# +cfghcn_wicked() { + + hcnlog DEBUG "cfghcn wicked: enter $1" + + hcnlog DEBUG "cfg_hcn wicked: wait for udev events complete, udevadm settle" + udevadm settle + search_dev "$1" + + hcnlog DEBUG "cfg_hcn: calling do_confi_vdevice to enslave $DEVNAME to HNV" + do_config_vdevice + + hcnlog DEBUG "cfghcn wicked: exit" + return $E_SUCCESS +} + +# +# function cfghcn +# Given device DRC_INDEX, configure or create HCN (active-backup bonding) +# add device as bonding slave +# +# $1 DRC_INDEX of the hybrid network device +# +cfghcn() { + hcnlog DEBUG "cfghcn: enter $1" + + case $SERVICE in + NetworkManager.service) + cfghcn_nm $1 + ;; + wicked.service) + cfghcn_wicked $1 + ;; + esac + + hcnlog DEBUG "cfghcn: exit" + return $E_SUCCESS +} + rmhcn_nm() { for connection in $(nmcli -f NAME con show | grep "$BONDNAME"); do hcnlog INFO "Delete bonding connection $connection" -- 2.34.1 ++++++ 0025-hcnmgr-remove-ifcfg-file-dump-from-scanhcn_wicked.patch ++++++ >From 992d81054e0479a186315e18ceb3f581fa048171 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Mon, 7 Feb 2022 15:42:30 +0100 Subject: [PATCH 25/27] hcnmgr: remove ifcfg file dump from scanhcn_wicked --- scripts/hcnmgr | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/hcnmgr b/scripts/hcnmgr index 705f914..c7bcd5e 100644 --- a/scripts/hcnmgr +++ b/scripts/hcnmgr @@ -910,8 +910,6 @@ scanhcn_wicked() { else hcnlog INFO "scanhcn failed to adjust bond '$bond' config primary to '$primary'" fi - echo "* $bond config:" - cat $(suse_ifcfg_file_name "$bond") if systemctl is-active -q wicked.service ; then hcnlog INFO "scanhcn reloading HCN bonding: $bond" -- 2.34.1 ++++++ 0026-hcnmgr-move-sourcing-functions.suse-to-wicked-case.patch ++++++ >From faa28462dee0fa9f212b5ea81893c6cc7fb569c7 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Mon, 7 Feb 2022 18:47:55 +0100 Subject: [PATCH 26/27] hcnmgr: move sourcing functions.suse to wicked case --- scripts/hcnmgr | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/hcnmgr b/scripts/hcnmgr index c7bcd5e..839e882 100644 --- a/scripts/hcnmgr +++ b/scripts/hcnmgr @@ -44,7 +44,6 @@ VIO_TYPE="" DISTRO="" SERVICE="" -source /usr/lib/powerpc-utils/functions.suse # Usage statements usage() { @@ -953,6 +952,9 @@ check_network_service() { SERVICE=$(systemctl show -P Id network.service 2>/dev/null) case $SERVICE in wicked.service) + source /usr/lib/powerpc-utils/functions.suse || \ + err $E_EPERM "Unable to source SUSE function library" + if ! wicked --version >/dev/null 2>&1; then err $E_ENETUNREACH "wicked management command not installed" fi -- 2.34.1 ++++++ 0027-hcnmgr-extend-suse-os-release-match.patch ++++++ >From 4e582b71282f67d670f47ee4d3da21cb814b8f30 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <m...@suse.de> Date: Tue, 8 Feb 2022 10:06:19 +0100 Subject: [PATCH 27/27] hcnmgr: extend suse os-release match Extend to use sles|sled|*suse* pattern catching sled, suse-microos and opensuse-(leap|tumbleweed|microos). --- scripts/hcnmgr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/hcnmgr b/scripts/hcnmgr index 839e882..d3c51be 100644 --- a/scripts/hcnmgr +++ b/scripts/hcnmgr @@ -948,7 +948,7 @@ check_network_service() { #Validate distro service CLI packages is installed to manage networking case $DISTRO in - sles) + sles|sled|*suse*) SERVICE=$(systemctl show -P Id network.service 2>/dev/null) case $SERVICE in wicked.service) -- 2.34.1