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 2021-03-17 20:13:50 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/powerpc-utils (Old) and /work/SRC/openSUSE:Factory/.powerpc-utils.new.2401 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "powerpc-utils" Wed Mar 17 20:13:50 2021 rev:108 rq:879282 version:1.3.8 Changes: -------- --- /work/SRC/openSUSE:Factory/powerpc-utils/powerpc-utils.changes 2021-01-06 19:56:01.829015901 +0100 +++ /work/SRC/openSUSE:Factory/.powerpc-utils.new.2401/powerpc-utils.changes 2021-03-17 20:14:27.878867251 +0100 @@ -1,0 +2,15 @@ +Mon Mar 15 11:46:44 UTC 2021 - Michal Suchanek <[email protected]> + +- ofpathname: Use NVMe controller physical nsid (bsc#1182020 ltc#191360). + + ofpathname-Use-NVMe-controller-physical-nsid.patch + +- HNV fixes (only NetworkManager supported) (jsc#SLE-13837 bsc#1181956 ltc#190722). + + 0001-hcnmgr-Avoid-cleanup-of-bond-interface-at-boot-time-.patch + + 0002-hcnmgr-Wait-for-sysfs-device-ready-when-looking-up-d.patch + + 0003-hcnmgr-Avoid-using-ifcfg-file-for-checking-bonding-i.patch + + 0004-hcnmgr-Avoid-using-xargs-to-process-NM-show-connecti.patch + +- Fix ofpathname race with udev rename (bsc#1183496 ltc#191534). + + powerpc-utils-Fix-ofpathname-race-with-udev-rename.patch + +------------------------------------------------------------------- New: ---- 0001-hcnmgr-Avoid-cleanup-of-bond-interface-at-boot-time-.patch 0002-hcnmgr-Wait-for-sysfs-device-ready-when-looking-up-d.patch 0003-hcnmgr-Avoid-using-ifcfg-file-for-checking-bonding-i.patch 0004-hcnmgr-Avoid-using-xargs-to-process-NM-show-connecti.patch ofpathname-Use-NVMe-controller-physical-nsid.patch powerpc-utils-Fix-ofpathname-race-with-udev-rename.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ powerpc-utils.spec ++++++ --- /var/tmp/diff_new_pack.XIwP7o/_old 2021-03-17 20:14:28.490868087 +0100 +++ /var/tmp/diff_new_pack.XIwP7o/_new 2021-03-17 20:14:28.494868093 +0100 @@ -32,7 +32,13 @@ Patch6: 0002-Disable-vnic-as-backup-vdevice-for-migratable-SR_IOV.patch Patch7: 0003-Clean-up-dead-network-config-interface-after-inactiv.patch Patch8: powerpc-utils-sys_ident-Skip-length-field-from-search.patch +Patch9: 0001-hcnmgr-Avoid-cleanup-of-bond-interface-at-boot-time-.patch +Patch10: 0002-hcnmgr-Wait-for-sysfs-device-ready-when-looking-up-d.patch +Patch11: 0003-hcnmgr-Avoid-using-ifcfg-file-for-checking-bonding-i.patch +Patch12: 0004-hcnmgr-Avoid-using-xargs-to-process-NM-show-connecti.patch Patch14: fix_kexec_service_name_for_suse.patch +Patch15: ofpathname-Use-NVMe-controller-physical-nsid.patch +Patch16: powerpc-utils-Fix-ofpathname-race-with-udev-rename.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: librtas-devel ++++++ 0001-hcnmgr-Avoid-cleanup-of-bond-interface-at-boot-time-.patch ++++++ >From 0b59d4a372aa266caa75f3b6a253b8f5aeaf3802 Mon Sep 17 00:00:00 2001 From: Mingming Cao <[email protected]> Date: Mon, 1 Mar 2021 19:34:29 -0800 Subject: [PATCH 1/4] hcnmgr: Avoid cleanup of bond interface at boot time when no HNV exists References: bsc#1181956 ltc#190722 Upstream: accpeted, expected v1.3.9 Git-commit: 0b59d4a372aa266caa75f3b6a253b8f5aeaf3802 At boot time, hcn scans the device tree and discovers if there was a new HNV being added while lpar was inactive. It also cleans up the old hnv interfaces. This patch avoids cleaning up bonding interface when no HNV network devices exists. Signed-off-by: Mingming Cao <[email protected]> [tyreld: fixup commit log] Signed-off-by: Tyrel Datwyler <[email protected]> --- scripts/hcnmgr | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/hcnmgr b/scripts/hcnmgr index a76505e5dd6a..c95edba1216c 100644 --- a/scripts/hcnmgr +++ b/scripts/hcnmgr @@ -575,7 +575,13 @@ scanhcn() { done fi + if [ ${HcnIds[@]} -eq 0 ]; then + hcnlog DEBUG "scanhcn: scan for hybrid virtual network finished" + return $E_SUCCESS + fi + # Next clean up dead connections left from orgitinal LPAR after inactive miration + # Only do this when the HNV ID array is not empty # list of all HCN ids ids="${HcnIds[*]}" -- 2.26.2 ++++++ 0002-hcnmgr-Wait-for-sysfs-device-ready-when-looking-up-d.patch ++++++ >From d9bcb21179ccfea122f326aca4690afe0f7de0c6 Mon Sep 17 00:00:00 2001 From: Mingming Cao <[email protected]> Date: Mon, 1 Mar 2021 21:34:34 -0800 Subject: [PATCH 2/4] hcnmgr: Wait for sysfs device ready when looking up device name References: bsc#1181956 ltc#190722 Upstream: accpeted, expected v1.3.9 Git-commit: d9bcb21179ccfea122f326aca4690afe0f7de0c6 At the time of calling ofpathname to look up for devicename, wait for sysfs device ready. Otherwise, the OS may be in the middle of device renaming. Signed-off-by: Mingming Cao <[email protected]> [tyreld: fixed up commit log] Signed-off-by: Tyrel Datwyler <[email protected]> --- scripts/hcnmgr | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/hcnmgr b/scripts/hcnmgr index c95edba1216c..0d20e7dab4b6 100644 --- a/scripts/hcnmgr +++ b/scripts/hcnmgr @@ -241,7 +241,10 @@ get_dev_hcn() { # Let's retry a few times. while [ $wait != 0 ]; do if DEVNAME=$(ofpathname -l "$(echo "$1" | sed -e "s/\/proc\/device-tree//")" 2>/dev/null); then - break + if [ -e /sys/class/net/"$DEVNAME" ]; then + hcnlog DEBUG "ofpathname waiting for /sys/class/net device $DEVNAME ready" + break + fi fi hcnlog DEBUG "ofpathname return $?, devname is $DEVNAME rety counter $wait" -- 2.26.2 ++++++ 0003-hcnmgr-Avoid-using-ifcfg-file-for-checking-bonding-i.patch ++++++ >From e25d71be411b610e5e889f8efaaf04b38c2d9ecb Mon Sep 17 00:00:00 2001 From: Mingming Cao <[email protected]> Date: Fri, 12 Mar 2021 13:50:33 -0800 Subject: [PATCH 3/4] hcnmgr: Avoid using ifcfg file for checking bonding interface status References: bsc#1181956 ltc#190722 Upstream: accpeted, expected v1.3.9 Git-commit: e25d71be411b610e5e889f8efaaf04b38c2d9ecb When configuring migratable sr_iov into hybrid network, it checks if there is an existing HNV using the presense of ifcfg file location. This is not preferred as the location can be different on distros. This patch fixes this by using NetworkManager nmcli. Signed-off-by: Mingming Cao <[email protected]> [tyreld: fixed spelling] Signed-off-by: Tyrel Datwyler <[email protected]> --- scripts/hcnmgr | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/hcnmgr b/scripts/hcnmgr index 0d20e7dab4b6..d66b5d1c3ea1 100644 --- a/scripts/hcnmgr +++ b/scripts/hcnmgr @@ -282,8 +282,7 @@ do_config_vdevice() { hcnlog DEBUG "Check if there is bond $BONDNAME with hcn id $HCNID" - hcnlog DEBUG "ifconfig file $IFCONFIG_PATH/ifconfig-$BONDNAME" - if [ ! -e "$IFCONFIG_PATH/ifcfg-$BONDNAME" ]; then + if ! nmcli -f NAME con show --active | grep -q "$BONDNAME\s"; then hcnlog INFO "nmcli con add type bond con-name $BONDNAME ifname $BONDNAME" nmcli con add type bond con-name "$BONDNAME" ifname "$BONDNAME" -- 2.26.2 ++++++ 0004-hcnmgr-Avoid-using-xargs-to-process-NM-show-connecti.patch ++++++ >From 1cb8bd89d6386c60e75c47d4a4452d3f130d5138 Mon Sep 17 00:00:00 2001 From: Mingming Cao <[email protected]> Date: Fri, 12 Mar 2021 14:18:18 -0800 Subject: [PATCH 4/4] hcnmgr: Avoid using xargs to process NM show connections References: bsc#1181956 ltc#190722 Upstream: accpeted, expected v1.3.9 Git-commit: 1cb8bd89d6386c60e75c47d4a4452d3f130d5138 When removing HNV bonding connections xargs can fail to process the output of nmcli show propererly. Instead of piping into xargs fix this by using a loop to check for all related bonding connections and remove them explicitly one by one. Signed-off-by: Mingming Cao <[email protected]> [tyreld: fixed up commit log] Signed-off-by: Tyrel Datwyler <[email protected]> --- scripts/hcnmgr | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/hcnmgr b/scripts/hcnmgr index d66b5d1c3ea1..30d31e7faef5 100644 --- a/scripts/hcnmgr +++ b/scripts/hcnmgr @@ -377,7 +377,10 @@ rmhcn() { fi hcnlog INFO "rmhcn: delete bond $BONDNAME and slaves " - nmcli -f NAME con show | grep "$BONDNAME" | xargs sudo nmcli con delete + for connection in $(nmcli -f NAME con show | grep "$BONDNAME"); do + hcnlog INFO "Delete bonding connection $connection" + nmcli con delete "$connection" + done hcnlog DEBUG "rmhcn: exit" return $E_SUCCESS } -- 2.26.2 ++++++ ofpathname-Use-NVMe-controller-physical-nsid.patch ++++++ >From 628ed06de76d40ce8ee74b055a3004e3cfc2aa0b Mon Sep 17 00:00:00 2001 From: Tyrel Datwyler <[email protected]> Date: Mon, 5 Oct 2020 13:03:45 -0700 Subject: [PATCH] ofpathname: Use NVMe controller physical nsid References: bsc#1182020 ltc#191360 Upstream: accpeted, expected v1.3.9 Git-commit: 628ed06de76d40ce8ee74b055a3004e3cfc2aa0b Linux creates logical block devices of the the form nvmeXnYpZ such that X = the controller, Y = namepsace, and Z = partition. For example: /dev/nvme0n1p1 The Linux namespace numbering scheme for namespaces always starts at 1 and increases monotonically regardless of the actual numbering scheme of the namespaces as seen by the physical NVMe controller. Accordingly, the Open firmware path binding utilizes the namespace id as seen by the controller and not the necessarily the one given in the logical block device name. As such we need to use the "nsid" attribute in the sysfs entry for the logical device to properly map back and forth from OP pathnames. Signed-off-by: Tyrel Datwyler <[email protected]> --- scripts/ofpathname | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/scripts/ofpathname b/scripts/ofpathname index 2ceae250d758..41b8c5c273e5 100755 --- a/scripts/ofpathname +++ b/scripts/ofpathname @@ -659,6 +659,11 @@ l2of_nvme() devspec=`$CAT $PWD/device/devspec | tr -d '\000'` if [[ -n $devspec ]]; then found=1 + if [[ -n $devnsid ]]; then + # Linux logical nsid might not match nvme controller nsid + goto_dir $dir "nsid" + devnsid=`$CAT $PWD/nsid | tr -d '\000'` + fi break fi done @@ -1609,16 +1614,9 @@ of2l_nvme() local dir local link - for dir in `$FIND /sys/block -name "nvme*n$nsid"`; do + for dir in `$FIND /sys/class/nvme -name "nvme[0-9]*"`; do cd $dir - link=`get_link "device"` # points to nvme[0-9]+ (non-namespace) - if [[ -n $link ]]; then - cd $link - else - continue - fi - link=`get_link "device"` # points to pci address dir if [[ -n $link ]]; then cd $link @@ -1635,6 +1633,16 @@ of2l_nvme() fi done + for dir in `$FIND /sys/block -name "${LOGICAL_DEVNAME}n[0-9]*"`; do + cd $dir + + local devnsid=`$CAT ./nsid 2>/dev/null` + if [[ $devnsid = $nsid ]]; then + LOGICAL_DEVNAME="${dir##*/}" + break + fi + done + if [[ -n $LOGICAL_DEVNAME ]] \ && [[ -n $part ]]; then -- 2.26.2 ++++++ powerpc-utils-Fix-ofpathname-race-with-udev-rename.patch ++++++ >From 1be82afccba6f4dc7e41f9ec3ceb36acc7480a94 Mon Sep 17 00:00:00 2001 From: Mingming Cao <[email protected]> Date: Sun, 14 Mar 2021 07:16:23 -0700 Subject: [PATCH] Fix ofpathname race with udev rename References: bsc#1183496 ltc#191534 Upstream: submitted https://github.com/ibm-power-utilities/powerpc-utils/pull/57 Git-commit: 1be82afccba6f4dc7e41f9ec3ceb36acc7480a94 When hcncfgdrc is called to configure an sr-iov or a backend vdice, drmgr has already returned from DR add. However sometimes the two commands happens too fast that the OS has not complete its work to get the device ready. We had to put some wait time to wait for sysfs is ready. However there is still small race window between udev rename and ofpathname lookup which leads to ofpathname grabbed a staled devname while udev is in the middle of rename device to something else. This cause hcncfgdrc failed to enslave the sr-iov or backend vdevice silently. And later causing Live Parition Migration failed due to missing backend slave for primary sr-iov device First we need to catch the failure of enslave vdevice at the time of calling do_config_vdevice to enslave the device, second, in the case of failure waiting for udev settle to complete udev events, then try ofpathename and enslave again. Signed-off-by: Mingming Cao <[email protected]> --- scripts/hcnmgr | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/scripts/hcnmgr b/scripts/hcnmgr index 30d31e7faef5..f80429d6340c 100644 --- a/scripts/hcnmgr +++ b/scripts/hcnmgr @@ -37,6 +37,7 @@ DRC_INDEX=0 DEVNAME="" MODE="" PHYSLOC="" +DEVPATH="" VIO_TYPE="" VNIC_SPT="" @@ -235,6 +236,7 @@ get_dev_hcn() { HCNID=$(xxd -l 4 -p "$dev"/ibm,hcn-id) MODE=$(tr -d '\0' <"$dev"/ibm,hcn-mode) PHYSLOC=$(tr -d '\0' <"$dev"/ibm,loc-code) + DEVPATH=$1 # Get the device name. After migration, it may take some time for # sysfs interface up or OFPATHENAME command to translate to device name. @@ -253,7 +255,7 @@ get_dev_hcn() { ((wait--)) if [[ $wait == 0 ]]; then hcnlog DEBUG "get_dev_hcn: couldn't get dev name" - hcnlog DEBUG "HCNID $HCNID devname $DEVNAME mode $MODE physloc $PHYSLOC" + hcnlog DEBUG "HCNID $HCNID devname $DEVNAME mode $MODE physloc $PHYSLOC DEVPATH $DEVPATH" hcnlog DEBUG "get_dev_hcn: exit" if [[ $HCNCMD == "hcnscan" ]]; then return $E_SUCCESS @@ -328,7 +330,10 @@ do_config_vdevice() { # Add device to the bond hcnlog INFO "nmcli con add type ethernet ifname $DEVNAME master $BONDNAME" - nmcli con add type ethernet con-name "$BONDNAME-$DEVNAME" ifname "$DEVNAME" master "$BONDNAME" + if ! nmcli con add type ethernet con-name "$BONDNAME-$DEVNAME" ifname "$DEVNAME" master "$BONDNAME"; then + hcnlog DEBUG "enslave $DEVNAME failed, /sys/class/net/$DEVNAME might be moved by udev" + return $E_ENODEV + fi hcnlog DEBUG "Bring up the $DEVNAME interface" nmcli con up "$BONDNAME-$DEVNAME" @@ -350,13 +355,33 @@ do_config_vdevice() { # $1 DRC_INDEX of the hybrid network device # cfghcn() { + local retry=3 + hcnlog DEBUG "cfghcn: enter $1" search_dev "$1" if [[ $VIO_TYPE == "VNIC" && $VNIC_SPT == "OFF" ]]; then hcnlog WARN "Backing device $VIO_TYPE for Migratable VF is not supported in hcnmgr version $VERSION" err $E_INVAL_DEV fi - do_config_vdevice + while [ $retry != 0 ]; do + hcnlog DEBUG "cfg_hcn: calling do_confi_vdevice to enslave $DEVNAME to HNV" + if do_config_vdevice; then + break + fi + + hcnlog DEBUG "cfg_hcn: do_confi_vdevice enslave $DEVNAME failed, might race with udev rename" + hcnlog DEBUG "cfg_hcn: wait for udev events complete, udevadm settle" + udevadm settle + + hcnlog DEBUG "cfg_hcn: calling get_dev_hcn retrive device $DEVPATH name again, retry $retry" + get_dev_hcn $DEVPATH + hcnlog DEBUG "cfg_hcn: calling get_dev_hcn get $DEVNAME" + ((retry--)) + if [[ $retry == 0 ]]; then + err $E_ENODEV + fi + done + return $E_SUCCESS } # @@ -414,7 +439,7 @@ qrydev() { hcnlog DEBUG "check if the network interface for this SR_IOV is not up, return success" if ! nmcli -f DEVICE con show --active | grep -q "$DEVNAME"; then hcnlog DEBUG "network connection $BONDNAME-$DEVNAME is inactive or nonexist" - hcnlog DEBUG "HCNID $HCNID devname $DEVNAME mode $MODE physloc $PHYSLOC" + hcnlog DEBUG "HCNID $HCNID devname $DEVNAME mode $MODE physloc $PHYSLOC DEVPATH $DEVPATH" hcnlog DEBUG "qryhcn: exit" # In this case, tell HMC to do rmdev and okay to migrate return $E_SUCCESS @@ -423,7 +448,7 @@ qrydev() { hcnlog DEBUG "check if there is bond for this $HCNID" if [ ! -d "$BOND_PATH" ]; then hcnlog DEBUG "bond $BONDNAME is inactive or nonexist" - hcnlog DEBUG "HCNID $HCNID devname $DEVNAME mode $MODE physloc $PHYSLOC" + hcnlog DEBUG "HCNID $HCNID devname $DEVNAME mode $MODE physloc $PHYSLOC DEVPATH $DEVPATH" # In this case, tell HMC to do rmdev and okay to migrate hcnlog DEBUG "qryhcn: exit" return $E_SUCCESS @@ -440,7 +465,7 @@ qrydev() { done <"$BOND_PATH"/slaves hcnlog DEBUG "Couldn't find active backup device for $DEVNAME" - hcnlog DEBUG "HCNID $HCNID devname $DEVNAME mode $MODE physloc $PHYSLOC" + hcnlog DEBUG "HCNID $HCNID devname $DEVNAME mode $MODE physloc $PHYSLOC DEVPATH $DEVPATH" hcnlog DEBUG "qryhcn: exit" err $E_BUSY } -- 2.26.2
