update to 1.3.11

This commit is contained in:
Than Ngo 2023-01-24 22:57:38 +01:00
parent 399838aff8
commit 08ee9a5f8d
8 changed files with 15 additions and 383 deletions

1
.gitignore vendored
View File

@ -24,3 +24,4 @@ powerpc-utils-1.2.2.tar.gz
/powerpc-utils-1.3.8.tar.gz
/powerpc-utils-1.3.9.tar.gz
/powerpc-utils-1.3.10.tar.gz
/powerpc-utils-1.3.11.tar.gz

View File

@ -327,13 +327,13 @@ diff -up powerpc-utils-1.3.5/man/update_flash_nv.8.me powerpc-utils-1.3.5/man/up
+.SH SEE ALSO
+update_flash(8).
+
diff -up powerpc-utils-1.3.10/Makefile.am.me powerpc-utils-1.3.10/Makefile.am
--- powerpc-utils-1.3.10/Makefile.am.me 2022-06-03 12:35:01.335312481 +0200
+++ powerpc-utils-1.3.10/Makefile.am 2022-06-03 12:46:42.460763120 +0200
@@ -48,7 +48,17 @@ man_MANS = \
man/vcpustat.8 \
diff -up powerpc-utils-1.3.11/Makefile.am.orig powerpc-utils-1.3.11/Makefile.am
--- powerpc-utils-1.3.11/Makefile.am.orig 2023-01-24 22:20:20.885655802 +0100
+++ powerpc-utils-1.3.11/Makefile.am 2023-01-24 22:22:36.291802414 +0100
@@ -49,7 +49,18 @@ man_MANS = \
man/rtas_dbg.8 \
man/drmgr.8 \
man/drmgr-hooks.8 \
- man/lparnumascore.8
+ man/lparnumascore.8 \
+ man/lsdevinfo.8 \
@ -346,6 +346,7 @@ diff -up powerpc-utils-1.3.10/Makefile.am.me powerpc-utils-1.3.10/Makefile.am
+ man/pseries_platform.8 \
+ man/update_flash_nv.8 \
+ man/hcnmgr.8
+
EXTRA_DIST += $(bin_SCRIPTS) $(sbin_SCRIPTS) $(man_MANS)

View File

@ -1,110 +0,0 @@
commit 2fbd7c1ff428e534d80f60e03501d625ab594eca
Author: Wen Xiong <wenxiong@linux.ibm.com>
Date: Wed Jun 15 13:05:51 2022 -0500
ofpathname: Fix several issues in nvmf boot/install support
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 <wenxiong@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
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 ]] && \

View File

@ -1,98 +0,0 @@
commit b1b9e76de0f3ab1dfcd9426779fa20fd77cd5625
Author: Luciano Chavez <lnx1138@linux.ibm.com>
Date: Wed Aug 24 21:11:32 2022 -0500
lsslot: Fix lsslot -c mem output when using 4GB LMB size
When using a LMB size of 4GB, the output of lsslot -c mem would get
reported incorrectly as:
Dynamic Reconfiguration Memory (LMB size 0x0)
:
DRC Index: 80000001 Address: 100000000
Removable: No Associativity: (index: 1) 0 1 4 9
Section(s):
This patch changes the declaration of the _node_u._smem._lmb_size from
a uint32_t to uint64_t to store the value properly. Any variables that
store the lmb_size are also declared as uint64_t. In addition, we
use the PRIx64 macro in printf statements to properly print the
lmb_size value.
The patch also includes a necessary change to declare the global
variable block_sz_bytes as a uint64_t to fix an infinite loop in
the function get_mem_scns() when the above changes were introduced.
Signed-off-by: Luciano Chavez <lnx1138@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
diff --git a/src/drmgr/drmem.h b/src/drmgr/drmem.h
index db5a47f..48108c5 100644
--- a/src/drmgr/drmem.h
+++ b/src/drmgr/drmem.h
@@ -58,7 +58,7 @@ struct drconf_mem_v2 {
#define LMB_REVERSE_SORT 1
#define LMB_RANDOM_SORT 2
-extern int block_sz_bytes;
+extern uint64_t block_sz_bytes;
struct lmb_list_head *get_lmbs(unsigned int);
void free_lmbs(struct lmb_list_head *);
diff --git a/src/drmgr/drslot_chrp_mem.c b/src/drmgr/drslot_chrp_mem.c
index 3b78723..d37ee80 100644
--- a/src/drmgr/drslot_chrp_mem.c
+++ b/src/drmgr/drslot_chrp_mem.c
@@ -33,7 +33,7 @@
#include "drmem.h"
#include "common_numa.h"
-int block_sz_bytes = 0;
+uint64_t block_sz_bytes = 0;
static char *state_strs[] = {"offline", "online"};
static char *usagestr = "-c mem {-a | -r} {-q <quantity> -p {variable_weight | ent_capacity} | {-q <quantity> | -s [<drc_name> | <drc_index>]}}";
@@ -118,7 +118,7 @@ free_lmbs(struct lmb_list_head *lmb_list)
static int
get_mem_scns(struct dr_node *lmb)
{
- uint32_t lmb_sz = lmb->lmb_size;
+ uint64_t lmb_sz = lmb->lmb_size;
uint64_t phys_addr = lmb->lmb_address;
uint32_t mem_scn;
int rc = 0;
diff --git a/src/drmgr/lsslot.c b/src/drmgr/lsslot.c
index 87f876e..83e9e85 100644
--- a/src/drmgr/lsslot.c
+++ b/src/drmgr/lsslot.c
@@ -741,7 +741,7 @@ int print_drconf_mem(struct lmb_list_head *lmb_list)
if (usr_drc_name)
drc_index = strtol(usr_drc_name, NULL, 0);
- printf("Dynamic Reconfiguration Memory (LMB size 0x%x)\n",
+ printf("Dynamic Reconfiguration Memory (LMB size 0x%"PRIx64")\n",
lmb_list->lmbs->lmb_size);
for (lmb = lmb_list->lmbs; lmb; lmb = lmb->next) {
@@ -808,7 +808,7 @@ int lsslot_chrp_mem(void)
if (lmb_list->drconf_buf) {
print_drconf_mem(lmb_list);
} else {
- printf("lmb size: 0x%x\n", lmb_list->lmbs->lmb_size);
+ printf("lmb size: 0x%"PRIx64"\n", lmb_list->lmbs->lmb_size);
printf("%-20s %-5s %c %s\n", "Memory Node", "Name", 'R',
"Sections");
printf("%-20s %-5s %c %s\n", "-----------", "----", '-',
diff --git a/src/drmgr/ofdt.h b/src/drmgr/ofdt.h
index 26c943a..bd90810 100644
--- a/src/drmgr/ofdt.h
+++ b/src/drmgr/ofdt.h
@@ -94,7 +94,7 @@ struct dr_node {
union {
struct mem_info {
uint64_t _address;
- uint32_t _lmb_size;
+ uint64_t _lmb_size;
uint32_t _lmb_aa_index;
struct mem_scn *_mem_scns;
struct of_node *_of_node;

View File

@ -1,131 +0,0 @@
commit c015807d5bef0ebdeaf99883793173f2b636e740
Author: Wen Xiong <wenxiong@linux.ibm.com>
Date: Wed Jun 15 13:05:18 2022 -0500
bootlist: Add install/boot support for nvmf devices
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 <wenxiong@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
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

View File

@ -1,29 +0,0 @@
commit e1f1deb06d9168a95a381a2236e1d8c693d3d229
Author: Luciano Chavez <lnx1138@linux.ibm.com>
Date: Wed Aug 24 21:17:54 2022 -0500
lsslot: Explicity declare that lmb_address be displayed in hexadecimal
A printf statement used is lsslot.c was specifying the macro PRIu64 to
display the lmb_address. Depending on the compilation, this would
either display as a hexadecimal or decimal value.
This patch replaces PRIu64 with PRIx64 to explicitly declare to print
the value as hexadecimal as that was is normally expected of an address.
Signed-off-by: Luciano Chavez <lnx1138@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
diff --git a/src/drmgr/lsslot.c b/src/drmgr/lsslot.c
index 7ea0f8b..87f876e 100644
--- a/src/drmgr/lsslot.c
+++ b/src/drmgr/lsslot.c
@@ -756,7 +756,7 @@ int print_drconf_mem(struct lmb_list_head *lmb_list)
printf("%s: %s\n", lmb->drc_name,
lmb->is_owned ? "" : "Not Owned");
- printf(" DRC Index: %x Address: %"PRIu64"\n",
+ printf(" DRC Index: %x Address: %"PRIx64"\n",
lmb->drc_index, lmb->lmb_address);
printf(" Removable: %s Associativity: ",
lmb->is_removable ? "Yes" : "No ");

View File

@ -1,20 +1,14 @@
Name: powerpc-utils
Version: 1.3.10
Release: 6%{?dist}
Version: 1.3.11
Release: 1%{?dist}
Summary: PERL-based scripts for maintaining and servicing PowerPC systems
License: GPLv2
URL: https://github.com/ibm-power-utilities/powerpc-utils
Source0: https://github.com/ibm-power-utilities/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
Source1: nx-gzip.udev
Patch0: powerpc-utils-1.3.10-manpages.patch
Patch0: powerpc-utils-1.3.11-manpages.patch
Patch1: powerpc-utils-1.3.10-distro.patch
# bz#2121470, Fix lsslot -c mem output when using 4GB LMB size
Patch3: powerpc-utils-b1b9e7-LMB_size_4GB.patch
Patch4: powerpc-utils-e1f1de-lmb_address_in_hexadecimal.patch
# bz#2110129, Add NVMf-FC boot support for Power - powerpc-utils
Patch5: powerpc-utils-c01580-add_NVMf-FC_boot_support_part1.patch
Patch6: powerpc-utils-2fbd7c-add_NVMf-FC_boot_support_part2.patch
ExclusiveArch: ppc %{power64}
@ -200,10 +194,14 @@ systemctl enable hcn-init.service >/dev/null 2>&1 || :
%{_mandir}/man8/nvram.8*
%{_mandir}/man8/ofpathname.8*
%{_mandir}/man8/drmgr.8*
%{_mandir}/man8/drmgr-hooks.8*
%{_mandir}/man8/lparnumascore.8*
%changelog
* Tue Jan 24 2023 Than Ngo <than@redhat.com> - 1.3.11-1
- update to 1.3.11
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.10-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (powerpc-utils-1.3.10.tar.gz) = 37b09268e9ce9041e7f823423f7517d5837625ebe33c28b9dcd8902580718327df0a835a1cf7f2659ef3e0b637f2bd008153114ea146996f3b1b97d6c078b46e
SHA512 (powerpc-utils-1.3.11.tar.gz) = 448fbbd707a4ad734db79206fabc01f76a41738ce54d6dea86573bf4b7ea8e98e4efe99b1173d91dc0c0f4ee4312c044a7bf087a2a5f50c7e9089f81b1425921