Compare commits

..

No commits in common. 'cs10' and 'c9' have entirely different histories.
cs10 ... c9

2
.gitignore vendored

@ -1 +1 @@
SOURCES/lsvpd-1.7.15.tar.gz
SOURCES/lsvpd-1.7.14.tar.gz

@ -1 +1 @@
ce361847b8221b8541aea6b927006ff9be01f0be SOURCES/lsvpd-1.7.15.tar.gz
b6d0bb4f69839f056a94954730dda9d680e5e58e SOURCES/lsvpd-1.7.14.tar.gz

@ -0,0 +1,164 @@
commit 1ca39cf877d0a74bc3f420205a672aea146982a5
Author: Sathvika Vasireddy <sv@linux.ibm.com>
Date: Fri Dec 23 14:19:38 2022 +0530
lsvpd: Add NVME f1h log page VPD information parsing logic in fillByBus()
This patch adds NVME f1h log page VPD information parsing logic
in fillByBus(). If bus is pci, then fill PCI device information
for this nvme device by reading and interpreting NVME f1h log
page.
Without this patch:
=====
# lscfg -vl 0185:a0:00.0
0185:a0:00.0 nvme1 pci1014,680 U78DA.ND0.WZS004R-P1-C5
3.2TB NVMe Gen4 U.2 SSD (1014a824)
Manufacturer Name.........IBM
Machine Type-Model........NVMe SSD Controller PM173X
Device Specific.(YC)......0
Location Code.(YL)........U78DA.ND0.WZS004R-P1-C5
=====
With this patch:
=====
# ./lscfg -vl 0185:a0:00.0
0185:a0:00.0 nvme1 pci1014,680 U78DA.ND0.WZS004R-P1-C5
3.2TB NVMe Gen4 U.2 SSD (1014a824)
Manufacturer Name.........IBM
Machine Type-Model........NVMe SSD Controller PM173X
Engineering Change Level..P65459
Field Replaceable Unit Number
..........................01LU968
Manufacturer ID...........S5H0NE0MC00161
Part Number of assembly...01CM529
Serial Number.............CEYD404W
Device Specific.(ID)......3.2TB NVMe Gen4 U.2 SSD
Final Assembly PN.(AN)....01LU965
Customer Card ID Number.(CC)
..........................59B9
Device Specific.(Z0)......10140680
Device Specific.(Z1)......3.0
Device Specific.(Z2)......3200
Device Specific.(Z3)......17.52
Device Specific.(Z4)......0
Device Specific.(Z5)......00
Device Specific.(Z6)......A180010C
Device Specific.(Z7)......0YA
Device Specific.(Z8)......2902
Device Specific.(Z9)......08
Device Specific.(ZA)......0008
Device Specific.(ZB)......0040
Device Specific.(ZC)......00
Device Specific.(FR)......REV.ST45
Device Specific.(YC)......0
Location Code.(YL)........U78DA.ND0.WZS004R-P1-C5
=====
Signed-off-by: Sathvika Vasireddy <sv@linux.ibm.com>
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>
diff --git a/src/include/sysfstreecollector.hpp b/src/include/sysfstreecollector.hpp
index e2af3ab..29f1d20 100644
--- a/src/include/sysfstreecollector.hpp
+++ b/src/include/sysfstreecollector.hpp
@@ -139,6 +139,7 @@ namespace lsvpd
void process_template(Component *fillMe, string *deviceType,
char *data, int dataSize, string *format,
int pageCode);
+ int collectNvmeVpd(Component *fillMe, int device_fd);
int collectVpd(Component *fillMe, int device_fd, bool limitSCSISize);
void fillSCSIComponent( Component* fillMe, bool limitSCSISize);
@@ -224,7 +225,6 @@ namespace lsvpd
*/
void fillUSBDev( Component* fillMe, const string& sysDir );
-
/**
* Fill a NVMe device.
*
@@ -259,6 +259,15 @@ namespace lsvpd
*/
void fillIDEDev( Component* fillMe );
+ /**
+ * Fill a NVME device by reading and interpreting f1h log page
+ * information
+ *
+ * @param fillMe
+ * The Component to fill
+ */
+ void fillPciNvmeVpd( Component* fillMe);
+
/**
* Gather PCI device specific vpd info.
*
diff --git a/src/internal/sys_interface/sysfs_SCSI_Fill.cpp b/src/internal/sys_interface/sysfs_SCSI_Fill.cpp
index b14bc3a..bdd6a30 100644
--- a/src/internal/sys_interface/sysfs_SCSI_Fill.cpp
+++ b/src/internal/sys_interface/sysfs_SCSI_Fill.cpp
@@ -1225,6 +1225,22 @@ namespace lsvpd
return ret;
}
+ int SysFSTreeCollector::collectNvmeVpd(Component *fillMe, int device_fd)
+ {
+ int rc;
+ char data[NVME_VPD_INFO_SIZE];
+
+ rc = nvme_read_vpd(device_fd, data);
+ if (rc)
+ return rc;
+
+ rc = interpretNVMEf1hLogPage(fillMe, data);
+ if (rc)
+ return rc;
+
+ return 0;
+ }
+
/********************************************************************
* @brief: High-level data collection call, using ioctl and doSGQuery
* to collect relevant data which is returned for interpretation.
diff --git a/src/internal/sys_interface/sysfstreecollector.cpp b/src/internal/sys_interface/sysfstreecollector.cpp
index 8ac0ea5..c5eb71d 100644
--- a/src/internal/sys_interface/sysfstreecollector.cpp
+++ b/src/internal/sys_interface/sysfstreecollector.cpp
@@ -1407,6 +1407,22 @@ ERROR:
return 0;
}
+ void SysFSTreeCollector::fillPciNvmeVpd( Component* fillMe )
+ {
+ int device_fd;
+ struct stat myDir;
+ string path;
+ path = fillMe->sysFsNode.getValue() + "/nvme";
+ if (stat(path.c_str(), &myDir) < 0)
+ return;
+ device_fd = device_open(fillMe);
+ if (device_fd < 0)
+ return;
+ collectNvmeVpd(fillMe, device_fd);
+ close(device_fd);
+ return;
+ }
+
/* Parse VPD file */
void SysFSTreeCollector::fillPciDevVpd( Component* fillMe )
{
@@ -1520,6 +1536,9 @@ ERROR:
/* Fill PCI device VPD info */
fillPciDevVpd(fillMe);
+ /* Fill NVME device VPD info using f1h log page */
+ fillPciNvmeVpd(fillMe);
+
// Read the pci config file for Device Specific (YC)
os.str( "" );
os << fillMe->sysFsNode.dataValue << "/config";

@ -0,0 +1,21 @@
commit 6ff86f3e6885e24b6eca2f42d6b02da5cead32e5
Author: Sathvika Vasireddy <sv@linux.ibm.com>
Date: Fri Dec 23 14:19:53 2022 +0530
lsvpd: Update nvme_template with logpage format for 0003 and 0004 versions
This patch adds nvme templates for f1h log page versions
0003 and 0004.
Signed-off-by: Sathvika Vasireddy <sv@linux.ibm.com>
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>
diff --git a/nvme_templates.conf b/nvme_templates.conf
index a85e95e..269c0af 100644
--- a/nvme_templates.conf
+++ b/nvme_templates.conf
@@ -1,2 +1,4 @@
"0001", "_:4,ID:40,PN:12,EC:10,FN:12,AN:12,FC:4,CC:4,SN:8,Z0:8,Z1:4,Z2:10,Z3:12,Z4:1,Z5:2,Z6:8,Z7:3,Z8:5,Z9:2,ZA:4,ZB:4,ZC:2,MN:20,FR:8"
"0002", "_:4,ID:40,PN:12,EC:10,FN:12,AN:12,FC:4,CC:4,SN:8,Z0:8,Z1:4,Z2:10,Z3:12,Z4:1,Z5:2,Z6:8,Z7:3,Z8:5,Z9:2,ZA:4,ZB:4,ZC:2,MN:20,RM:8"
+"0003", "_:4,ID:40,PN:12,EC:10,FN:12,AN:12,FC:4,CC:4,SN:8,Z0:8,Z1:4,Z2:10,Z3:12,Z4:1,Z5:2,Z6:8,Z7:3,Z8:5,Z9:2,ZA:4,ZB:4,ZC:2,MN:20,RM:8"
+"0004", "_:4,ID:40,PN:12,EC:10,FN:12,AN:12,FC:4,CC:4,SN:8,Z0:8,Z1:4,Z2:10,Z3:12,Z4:1,Z5:2,Z6:8,Z7:3,Z8:5,Z9:2,ZA:4,ZB:4,ZC:2,MN:20,RM:8"

@ -1,12 +1,18 @@
%define name lsvpd
%define version 1.7.14
Name: lsvpd
Version: 1.7.15
Release: 6%{?dist}
Version: 1.7.14
Release: 2%{?dist}
Summary: VPD/hardware inventory utilities for Linux
License: GPL-2.0-or-later
License: GPLv2+
URL: https://github.com/power-ras/%{name}/releases
Source: https://github.com/power-ras/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: lsvpd-git1ca39c.patch
Patch1: lsvpd-git6ff86f.patch
BuildRequires: gcc-c++
BuildRequires: libvpd-devel >= 2.2.9
BuildRequires: sg3_utils-devel
@ -35,13 +41,14 @@ on POWER PC based systems.
%autosetup -p1
%build
export CXXFLAGS="-std=c++14 $RPM_OPT_FLAGS"
./bootstrap.sh
%configure
%make_build
make %{?_smp_mflags}
%install
%make_install
make install DESTDIR=$RPM_BUILD_ROOT
%post
%{_sbindir}/vpdupdate &
@ -68,67 +75,24 @@ exit 0
%dir %{_sysconfdir}/lsvpd
%changelog
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1.7.15-6
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1.7.15-5
- Bump release for June 2024 mass rebuild
* Fri Feb 09 2024 Dan Horák <dan@danny.cz> - 1.7.15-4
- rebuilt for sg3_utils 1.48
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.15-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.15-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Oct 02 2023 Than Ngo <than@redhat.com> - 1.7.15-1
- update to 1.7.15
- drop -std=c++14 build flag
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.14-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Mar 23 2023 Than Ngo <than@redhat.com> - 1.7.14-6
- lsvpd is not reporting the correct I/O microcode
for HBA, PCIe, SAS adapters, HDD, etc
* Thu Feb 16 2023 Than Ngo <than@redhat.com> - 1.7.14-5
- migrated to SPDX license
* Sun Feb 05 2023 Than Ngo <than@redhat.com> - 1.7.14-4
- added updatream patches to fix nvme vpd data
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.14-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.14-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Apr 07 2022 Dan Horák <dan[at]danny.cz> - 1.7.14-1
- rebase to 1.7.14
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Sun Feb 05 2023 Than Ngo <than@redhat.com> - 1.7.14-2
- Resolves: #2164975, add NVME f1h log page VPD information
* Wed Sep 15 2021 Than Ngo <than@redhat.com> - 1.7.13-1
- rebase to 1.7.13
* Fri May 06 2022 Than Ngo <than@redhat.com> - 1.7.14-1
- Resolves: #2051289, rebase to 1.7.14
* Fri Sep 03 2021 Than Ngo <than@redhat.com> - 1.7.12-1
- rebase to 1.7.12
- add support for SCSI loc-code
- Fix catching polymorphic type by value
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.7.12-3
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.11-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jun 04 2021 Than Ngo <than@redhat.com> - 1.7.12-2
- Resolves: #1955158, rebuilt against new sg3_utils >= 1.46
* Wed Apr 28 2021 Stephen Gallagher <sgallagh@redhat.com> - 1.7.11-7
- Rebuild to pick up sg3_utils in ELN
* Mon May 17 2021 Than Ngo <than@redhat.com> - 1.7.12-1
- Resolves: #1869564, rebase to 1.7.12
* Tue Apr 06 2021 Tomas Bzatek <tbzatek@redhat.com> - 1.7.11-6
- rebuilt for sg3_utils 1.46
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.7.11-6
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Feb 09 2021 Than Ngo <than@redhat.com> - 1.7.11-5
- Fix, Vendor and Device information mismatch for usb-xhci

Loading…
Cancel
Save