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-11-15 13:18:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/powerpc-utils (Old)
 and      /work/SRC/openSUSE:Factory/.powerpc-utils.new.1597 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "powerpc-utils"

Tue Nov 15 13:18:28 2022 rev:131 rq:1035690 version:1.3.10

Changes:
--------
--- /work/SRC/openSUSE:Factory/powerpc-utils/powerpc-utils.changes      
2022-10-10 18:44:02.322801005 +0200
+++ /work/SRC/openSUSE:Factory/.powerpc-utils.new.1597/powerpc-utils.changes    
2022-11-15 13:21:12.180731853 +0100
@@ -1,0 +2,7 @@
+Mon Nov 14 15:24:35 UTC 2022 - Michal Suchanek <[email protected]>
+
+- NVMf boot support (bsc#1205351 ltc#200481)
+  + bootlist-Add-install-boot-support-for-nvmf-devices.patch
+  + ofpathname-Fix-several-issues-in-nvmf-boot-install-s.patch
+
+-------------------------------------------------------------------

New:
----
  bootlist-Add-install-boot-support-for-nvmf-devices.patch
  ofpathname-Fix-several-issues-in-nvmf-boot-install-s.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ powerpc-utils.spec ++++++
--- /var/tmp/diff_new_pack.tV4Swh/_old  2022-11-15 13:21:12.800735054 +0100
+++ /var/tmp/diff_new_pack.tV4Swh/_new  2022-11-15 13:21:12.808735095 +0100
@@ -31,6 +31,8 @@
 Patch4:         libvirt-service-dep.patch
 Patch5:         lsslot-Explicity-declare-that-lmb_address-be-display.patch
 Patch6:         lsslot-Fix-lsslot-c-mem-output-when-using-4GB-LMB-si.patch
+Patch7:         bootlist-Add-install-boot-support-for-nvmf-devices.patch
+Patch8:         ofpathname-Fix-several-issues-in-nvmf-boot-install-s.patch
 BuildRequires:  autoconf
 BuildRequires:  automake
 BuildRequires:  libnuma-devel

++++++ bootlist-Add-install-boot-support-for-nvmf-devices.patch ++++++
>From c015807d5bef0ebdeaf99883793173f2b636e740 Mon Sep 17 00:00:00 2001
From: Wen Xiong <[email protected]>
Date: Wed, 15 Jun 2022 13:05:18 -0500
Subject: [PATCH] bootlist: Add install/boot support for nvmf devices

Patch-mainline: accepted, expected in 1.3.11
Git-commit: c015807d5bef0ebdeaf99883793173f2b636e740

This patch adds the boot/installation support for nvme-over-fc devices.
It can set nvmf device as boot device in both of logical device name
and open firmware device path name.

Signed-off-by: Wen Xiong <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
---
 scripts/bootlist | 86 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 85 insertions(+), 1 deletion(-)

diff --git a/scripts/bootlist b/scripts/bootlist
index b5cfbd9..1929f65 100755
--- a/scripts/bootlist
+++ b/scripts/bootlist
@@ -22,6 +22,7 @@
 
 OFPATHNAME=/usr/sbin/ofpathname
 NVRAM=/usr/sbin/nvram
+FIND=/usr/bin/find
 PSERIES_PLATFORM=$(dirname $0)/pseries_platform
 
 #
@@ -288,6 +289,63 @@ dm_to_part()
         done
 }
 
+# is_nvmf_device
+# Check to see if this is a nvmf device
+#
+is_nvmf_device()
+{
+       local res
+
+       res=`$FIND /sys/devices/virtual/nvme-fabrics -name $1 2>/dev/null`
+       if [[ ${#res} = 0 ]]; then
+               echo "no"
+       else
+               echo "yes"
+       fi
+}
+
+# get_link
+# return the directory path that a link points to.
+# The only parameter is the link name.
+#
+get_link()
+{
+       local ln_name=$1;
+
+       echo `ls -l $ln_name 2>/dev/null | awk -F"->" '{print $2}'`
+}
+
+add_nvmf()
+{
+       local DEVNAME=$1
+
+       ctrl_name=$DEVNAME
+       local startctr=$ctr
+
+       local dir
+       for dir in `$FIND /sys/devices/virtual/nvme-fabrics -name 
"$ctrl_name"`; do
+               cd $dir
+               link=`get_link "device"`
+               cd $link
+               for slave in $PWD/*; do
+                       slavedev=${slave##*/}
+                       if [[ "$slavedev" == nvme[0-9]* ]] ; then
+                               cd $slave
+                               res=`$FIND . -name "${ctrl_name}*"`
+                               if [[ ${#res} != 0 ]]; then
+                                       LOGICAL_NAMES[$ctr]=${slavedev}
+                                       ctr=$[$ctr + 1]
+                               fi
+                       fi
+               done
+       done
+
+       if [[ "$startctr" = "$ctr" ]] ; then
+               LOGICAL_NAMES[$ctr]=$1
+               ctr=$[$ctr + 1]
+       fi
+}
+
 add_logical()
 {
     local DEVNAME=$1
@@ -432,7 +490,30 @@ while [[ -n $1 ]]; do
        exit -1
     else
         # add this element to the array
-       add_logical $1
+        if [[ "$1" == *"dm-"* ]] ; then
+            add_logical $1
+        else
+            if [[ "$1" == *"nvme-of"* ]]; then
+                ctrl_name=`get_logical_device_name $1`
+            else
+               ctrl_name=$1
+               ctrl_name=${ctrl_name##*/}
+            fi
+            ctrl_name="${ctrl_name%n[0-9]*}"
+            is_nvmf=$(is_nvmf_device $ctrl_name)
+            if [[ $is_nvmf = "yes" ]]; then
+               if [[ "$1" == *"nvme-of"* ]]; then
+                       master_of_path=$1
+               else
+                       master_of_path=`get_of_device_name $1`
+               fi
+                namespace_base=${master_of_path##*/}
+                DEVTYPE="nvme-of"
+                add_nvmf $ctrl_name
+            else
+                add_logical $1
+            fi
+        fi
     fi
 
     shift
@@ -453,6 +534,9 @@ if [[ ${#LOGICAL_NAMES[*]} -ne 0 ]]; then
         if [[ -z ${OF_DEVPATH[$ctr]} ]]; then
            # See if this is an OF pathname
            OF_DEVPATH[$ctr]=`get_of_device_name ${LOGICAL_NAMES[$ctr]}`
+           if [[ $DEVTYPE = "nvme-of" ]]; then
+                   OF_DEVPATH[$ctr]=${OF_DEVPATH[$ctr]}/$namespace_base
+           fi
        else
            OF_DEVPATH[$ctr]=${LOGICAL_NAMES[$ctr]}
         fi
-- 
2.38.0


++++++ ofpathname-Fix-several-issues-in-nvmf-boot-install-s.patch ++++++
>From 2fbd7c1ff428e534d80f60e03501d625ab594eca Mon Sep 17 00:00:00 2001
From: Wen Xiong <[email protected]>
Date: Wed, 15 Jun 2022 13:05:51 -0500
Subject: [PATCH] ofpathname: Fix several issues in nvmf boot/install support

Patch-mainline: accepted, expected in 1.3.11
Git-commit: 2fbd7c1ff428e534d80f60e03501d625ab594eca

This patch fixes several issues in boot/install over nvme-over-fc
device support.

- change cntlid to ffff
- add devnisd from sysfs
- add subsysnqn

Signed-off-by: Wen Xiong <[email protected]>
Signed-off-by: Tyrel Datwyler <[email protected]>
---
 scripts/ofpathname | 38 +++++++++++++++++++++++++-------------
 1 file changed, 25 insertions(+), 13 deletions(-)

diff --git a/scripts/ofpathname b/scripts/ofpathname
index b1d6b09..33d7702 100755
--- a/scripts/ofpathname
+++ b/scripts/ofpathname
@@ -773,8 +773,7 @@ l2of_nvmf()
             t_wwpn="${t_wwpn#0x}"
             t_wwpn="${t_wwpn%,*}"
             nqn=`$CAT $PWD/subsysnqn`
-            cntlid_dec=`$CAT $PWD/cntlid`
-            cntlid=`echo "obase=16; $cntlid_dec" |bc`
+            cntlid=`echo ffff`
             if [[ -n $h_wwpn ]]; then
                 for f in `$FIND /sys/devices -name "port_name"`; do
                     sys_wwpn=`$CAT $f 2>/dev/null`
@@ -808,6 +807,9 @@ l2of_nvmf()
         if [[ ${#res} = 0 ]]; then
             OF_PATH=""
         else
+            goto_dir $res
+            devnsid=`$CAT $PWD/nsid | tr -d '\000'`
+            devnsid=`echo "obase=16; $devnsid" |bc`
             OF_PATH="$OF_PATH/namespace@$devnsid"
         fi
     fi
@@ -818,6 +820,8 @@ l2of_nvmf()
         if [[ ${#res} = 0 ]]; then
             OF_PATH=""
         else
+            goto_dir $res
+            devpart=`$CAT $PWD/partition | tr -d '\000'`
             OF_PATH="${OF_PATH}:${devpart}"
         fi
     fi
@@ -1826,8 +1830,7 @@ of2l_nvmf()
     ctrl_name=`echo $DEVNAME | cut -d "/" -f 5`
     OF_WWPN=${ctrl_name%,*}
     OF_WWPN=${OF_WWPN#*@}
-    of_cntlid=${ctrl_name%%:*}
-    of_cntlid=${of_cntlid#*,}
+    OF_NQN=`echo $ctrl_name | cut -d "=" -f 2`
     # set partition number only if ':' is present
     case "${nsid_part}" in
     *:*)
@@ -1835,6 +1838,7 @@ of2l_nvmf()
         ;;
     esac
     local dir
+    local found=0
 
     for dir in `$FIND /sys/devices/virtual/nvme-fabrics -name "nvme[0-9]*"`; do
         cd $dir
@@ -1844,10 +1848,9 @@ of2l_nvmf()
             t_wwpn="${t_wwpn%,*}"
             h_wwpn=`$CAT $PWD/address | cut  -f 5 -d "-"`
             h_wwpn="${h_wwpn#0x}"
-            cntlid_dec=`$CAT $PWD/cntlid 2>/dev/null`
-            cntlid=`echo "obase=16; $cntlid_dec" |bc`
+            nqn=`$CAT $PWD/subsysnqn`
             if [[ $t_wwpn = $OF_WWPN ]] && \
-                [[ $cntlid == $of_cntlid ]]; then
+                [[ $nqn == $OF_NQN ]]; then
                 for f in `$FIND /sys/devices -name "port_name"`; do
                     sys_wwpn=`$CAT $f 2>/dev/null`
                     sys_wwpn="${sys_wwpn#0x}"
@@ -1871,14 +1874,23 @@ of2l_nvmf()
             fi
         fi
     done
+
     if [[ -n $LOGICAL_DEVNAME ]] && \
        [[ -n $nsid ]]; then
-        res=`$FIND /sys/devices/virtual -name ${LOGICAL_DEVNAME}n${nsid}`
-        if [[ ${#res} = 0 ]]; then
-            LOGICAL_DEVNAME=''
-        else
-            LOGICAL_DEVNAME="${LOGICAL_DEVNAME}n${nsid}"
-        fi
+        for dir in `$FIND /sys/block -name "${LOGICAL_DEVNAME}n[0-9]*"`; do
+            cd $dir
+
+            local devnsid=`$CAT ./nsid 2>/dev/null`
+            devnsid=`echo "obase=16; $devnsid" |bc`
+            if [[ $devnsid = $nsid ]]; then
+                found=1
+                LOGICAL_DEVNAME="${dir##*/}"
+                break
+            fi
+        done
+        if [[ $found -eq 0 ]]; then
+            LOGICAL_DEVNAME=""
+         fi
     fi
 
     if [[ -n $LOGICAL_DEVNAME ]] && \
-- 
2.38.0

Reply via email to