Commit graph

566 commits

Author SHA1 Message Date
Wen Xiong
e02df178e3 iprutils: Add reserved bits in page 2 of ses device
The length of Page 2 with Slider SFF is 0x2A4. Add reserved bits in
structure of Page 2.

Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2017-03-16 09:02:37 -05:00
Brian King
7f5e08c9c1 iprutils: Version 2.4.14
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-10-25 15:57:44 -05:00
Brian King
258b9bb7ff iprutils: Remove sleeps from iprconfig
This patch ensures that if __tool_init fails, we don't sleep and retry
if the tool is iprconfig. We only want to do this for the ipr daemons.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-10-25 13:58:19 -05:00
Brian King
2985e71c6e iprutils: Remove JBOD HDDs from the device statistics menu
This patch filters out JBOD HDDs from showing up as devices for selection in
the device statistics menu. Without this patch, they are selectable, but return
without displaying any data.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-10-25 13:58:18 -05:00
Brian King
d298e9b502 iprutils: Allow VSET write cache in bare metal mode
Allow VSET write cache to be enabled in bare metal mode.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
2016-10-25 13:58:16 -05:00
Brian King
bcfcda764d iprutils: Fix iprconfig dump option to log full IOA details
Fixes up iprconfig -c dump to show more details about the IOA. Also
fixes an issue where we could end up treating a RAID array as an
adapter resource which resulted in strange looking iprconfig menus
and possible iprinit failures.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-10-25 13:57:24 -05:00
Brian King
b841ac8371 iprutils: Backwards compatibility for endian swapped device_id
Older kernels on little endian systems had the device_id endian
swapped in sysfs. This has since been fixed up. This patch adds
support to iprinit to check for attributes saved using the old
endian swapped device id.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-10-25 13:57:23 -05:00
Brian King
1480be3414 iprutils: Vset cache enable fixes
If a disk array has a saved queue depth, and the saved queue depth
is equal to the max supported queue depth for that disk array, init_vset_dev
will return early without changing the current queue depth and also
without even attempting to enable the VSET cache, if it is supported.
This was reported as an issue with the VSET cache not getting enabled
by iprinit at boot time. This fixes the early exit in this case to
make sure the queue depth gets set. It also moves the code in init_vset_dev
around to setup the VSET cache first. And thirdly, this also changes
ipr_set_ioa_attr to do the change cache parameters before setting the
other attributes to ensure it gets set properly.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-10-25 13:57:20 -05:00
Brian King
f640923deb iprinit: Wait for sg module
If the iprinit daemon runs prior to the sg module being loaded,
it is not able to talk to the ipr adapters and do much of anything
that is useful. This was observed on a system where the adapter
write cache was not getting enabled at times during boot. This
modifies iprinit to check to see if the sg module is loaded
and also checks to see if its actually been bound to each
ipr adapter yet. If not, it makes iprinit wait for a bit
until this happens. Some distros load sg via a udev rule
which can happen in parallel to iprinit starting, so this
fixes this race. It also adds some informational logging
to make it easier to track when this indeed does occur in
case a system never loads the sg driver.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-10-25 13:57:18 -05:00
Brian King
feb064c58d iprutils: Remove stale debug printf
Remove a debug printf that is not needed.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-10-25 13:57:16 -05:00
Brian King
7a3dd814a4 iprutils: Disable rebuild verify by default for single adapter configurations
Allow the option to disable verify on array rebuild, which greatly speeds up rebuild
time, to get enabled on single adapter configurations and enable this by default.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-10-25 13:57:14 -05:00
Brian King
775d7a2888 iprutils: Fix raid-create on dual adapter setups
Using the raid-create iprconfig command line option would sometimes
result in commands getting sent to the secondary adapter rather than
the primary adapter. This fixes that up.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-10-25 13:57:12 -05:00
Gabriel Krisman Bertazi
46184ee418 iprlib: Export missing prototypes in header file
ipr_device_lock(), ipr_device_unlock() and get_scsi_dev_data() all get
used outside of iprlib.c but they were missing a prototype in the
library header file.  This patch adds it to silently the following
warnings:

../iprconfig.c: In function ‘wait_for_formatted_af_dasd’:
../iprconfig.c:240:14: warning: implicit declaration of function ‘get_scsi_dev_data’ [-Wimplicit-function-declaration]
   num_devs = get_scsi_dev_data(&scsi_devs);
              ^~~~~~~~~~~~~~~~~
../iprconfig.c: In function ‘verify_device’:
../iprconfig.c:1711:6: warning: implicit declaration of function ‘ipr_device_lock’ [-Wimplicit-function-declaration]
  if (ipr_device_lock(dev))
      ^~~~~~~~~~~~~~~
../iprconfig.c:1741:2: warning: implicit declaration of function ‘ipr_device_unlock’ [-Wimplicit-function-declaration]
  ipr_device_unlock(dev);
  ^~~~~~~~~~~~~~~~~

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-10-18 09:55:32 -05:00
Gabriel Krisman Bertazi
14438c8ed3 iprconfig: Don't bail update_all_ucodes on missing IOA
If an IOA is missing its scsi_dev_data, we want to skip it and look for
other IOAs, instead of bailing out early.

This also fixes the compilation warning below:

../iprconfig.c: In function ‘update_all_ucodes’:
../iprconfig.c:15735:4: warning: ‘return’ with no value, in function returning non-void
    return;
    ^~~~~~
../iprconfig.c:15725:12: note: declared here
 static int update_all_ucodes(char **args, int num_args)
            ^~~~~~~~~~~~~~~~~
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-10-18 09:55:30 -05:00
Gabriel Krisman Bertazi
fb71102acd iprconfig: Reposition ses_time functions in the file
Move the ses_*_time functions to the beginning of the iprlib.c file to
prevent warnings of implicit declaration.

../iprlib.c: In function ‘init_ses_dev’:
../iprlib.c:9777:3: warning: implicit declaration of function ‘ipr_ses_set_time’ [-Wimplicit-function-declaration]
   ipr_ses_set_time(dev, t);
   ^~~~~~~~~~~~~~~~

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-10-18 09:55:27 -05:00
Gabriel Krisman Bertazi
fb12f0e814 iprconfig: Add missing header
In my system, Fedora 24, the library function basename() requires the
explicitly inclusion of libgen.h header file.  Add it to avoid
the compilation warning below:

../iprconfig.c: In function ‘download_all_ucode’:
../iprconfig.c:11847:5: warning: implicit declaration of function ‘basename’ [-Wimplicit-function-declaration]
     basename(dev->gen_name), lfw->version,
     ^~~~~~~~

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-10-18 09:55:16 -05:00
Gabriel Krisman Bertazi
bd7dba9552 iprconfig: pass disk name to scsi_err
Commit da3fe0fc80 ("iprutils: Don't show RAID migration level for
secondary devices.") added an error message to
query_raid_levels_raid_migrate but didn't pass the disk name as a
parameter.  This error triggers a warning and eventually segfaults
iprconfig.

This commit adds the missing parameter.

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-10-18 09:54:05 -05:00
Wen Xiong
54e9a25492 iprutils: Fix for "-c show-slots" showing D1 slot twice with Slider drawer
To show all slots of a drawer for concurrent maintenance, we need to get
the "dev" based on each slot id of the drawer. Skip the dev if dev is an
 array or volume set when iterating the devs.

Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-09-22 21:03:37 -05:00
Brian King
d7d5bc6f92 iprutils: Version 2.4.13
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-08-16 09:47:13 -05:00
Brian King
9b51ebc8f8 iprutils: Properly set known zeroed state on SIS64 adapters
This patch fixes two issues. It changes how the known zeroed
state is tracked so that it works reliably on SIS64 adapters.
We previously had been relying on the bus/target/lun value
to be consistent when a JBOD disk was reformatted to a RAID
capable disk. This is true for SIS32 adapters, since this
tuple is tied to a physical location. For SIS64, however,
this tuple is generated by the ipr driver, so is often
not the same value when a JBOD is converted to RAID. Instead,
we change to always use the device_id attribute, which is
generated by the adapter based on the LUN WWN of the disk.
This patch also eliminates a hang that can occur when formatting
disks if a second iprconfig instance is started concurently.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-08-12 11:02:32 -05:00
Brian King
4492190122 iprutils: Version 2.4.12
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-08-04 06:17:49 -05:00
Wen Xiong
fd519da33d iprutils: Fix for hotplug disk with Slider drawers
The patch fixed the issue with Slider's hotplug disk.

Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-08-02 17:27:38 -05:00
Brian King
656fd51ba5 iprutils: Version 2.4.12-rc2
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-07-22 14:17:42 -05:00
Brian King
b22b9b4c5a iprutils: Ensure device known zeroed state gets saved after format
This patch fixes a problem when formatting multiple disks, where either
another instance of iprconfig or iprinit or some similar tool ends up
calling evaluate_device before the issuing iprconfig does, resulting in
formatted devices that are not flagged as known zeroed. This adds some
locking around this function to ensure that does not happen.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-07-22 14:13:22 -05:00
Brian King
366ee114f2 iprutils: Fix find_multipath_jbod to never return itself
The find_multipath_jbod is intended to return the alternate path
for the same device in a multipath configuration. However, it was
simply returning the first device that matched the device_id which
may have been the same device as the function parameter. This fixes
some issues and errors that can be seen when formatting JBOD disks.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-07-22 14:13:19 -05:00
Brian King
5a48b47612 iprutils: Fixup 2.4.12 spec file build issue
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-07-18 13:33:49 -05:00
Brian King
97ff3181af iprutils: Version 2.4.12-rc1
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-07-18 12:58:52 -05:00
Brian King
d994320173 iprutils: Save known zeroed state for command line format
Ensure the known zeroed state gets saved in the adapter following
a format unit command from the command line.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-07-18 12:53:55 -05:00
Brian King
7fb69a75ad iprutils: Remove unnecessary iprconfig prompt on exit
Since newer firmware versions now support tracking of the known zeroed state
for AF DASD disks, we don't need to warn the user about exiting iprconfig
when there are known zeroed disks if the adapter has this support.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-07-18 12:53:44 -05:00
Brian King
cd8f102219 iprutils: Format timeout and format block size fixes
This patch fixes some issues related to disk formatting. First,
it queries the disk to determine the optimal timeout to use for
a format command. This fixes format timeout issues on very large
capacity disks. Second, this also fixes up the 5xx/4k sector
size handling to ensure we don't end up mistakenly reformatting
drives to the wrong block size. This was primarily an issue
for drives that ended up in medium format corrupt and the subsequent
format then did the wrong thing.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-07-18 12:53:20 -05:00
Brian King
7c3eeee806 iprutils: Fix format timeout issue on little endian systems
Fix a possible format timeout issue for large disks on little endian systems.
We need to byte swap the 2 byte timeout field.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-07-18 12:52:58 -05:00
Brian King
3488dbe214 iprutils: Display sr device name
Display the /dev/sr device name for optical devices.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
2016-07-13 17:35:04 -05:00
Brian King
739861281d iprutils: Collect additional logs with iprsos
Enhance iprsos to collect some missing log files.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
2016-07-13 17:34:57 -05:00
Brian King
8ee2a9de03 iprutils: Flush unused multipaths prior to array delete
When formatting a JBOD disk to AF, we unbind the /dev/sd
device nodes prior to starting the format in order to
avoid strange errors from cropping up. Additionally, we
also flush the unused multipath device maps for the same
reason. When we delete a RAID array, although delete the
/dev/sd device nodes prior to deleting the RAID array,
we weren't flushing the unused multipaths, so let's do that.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
2016-07-13 17:34:45 -05:00
Gabriel Krisman Bertazi
5f16659136 iprutils: Display higher link rates in path details.
SPL-4 defines a couple of higher values for the negotiated link rates
that were not defined in iprutils, causing us to display the default
value "Enabled" for link rates higher than 6.0Gbps in
query-path-details. This was found when working with the drawer ESLS.

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-04-17 16:37:19 -05:00
Brian King
284b6d8bd3 iprutils: Version 2.4.11
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-04-06 11:20:59 -05:00
Brian King
3ea740cea0 iprutils: Version 2.4.11.0.rc1
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-04-05 17:04:20 -05:00
Brian King
5f27fe6d0d iprutils: Clarify Read Intensive SSD report verbiage
Clarify the verbiage used for the SSD report for read intensive SSDs.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-04-05 16:50:36 -05:00
Brian King
3c9890a5e2 iprutils: Add LSB package dependency for RHEL 6 build
The iprutils init.d scripts require the redhat-lsb on RHEL 6 in order
to function. Add this as a dependency.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-04-05 16:50:34 -05:00
Gabriel Krisman Bertazi
b0c2b4d0a0 iprutils: Enable time configuration for SES enclosures.
Some new external drawers like ESLS have an internal clock, used by the
internal microcode.  This patch enables iprinit to configure the clock
at boot time.

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-04-05 15:41:23 -05:00
Wen Xiong
c847ce9054 iprutils: Add maximum queue depth in GUI when creating an array
This patch added maximum queue depth in GUI when creating an array. Also
fixed some issues in query-qdepth and set-qdepth.

Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-04-05 15:28:08 -05:00
Gabriel Krisman Bertazi
06be237b4f iprutils: Don't fail with minimum array rebuild rate.
When user passed 0x0 to old firmwares, rebuild rate would be set to the
implementation default value, defined by SIS, and any further read to
Mode Page 0x24 would display 0x0 in the Rebuild Rate field.  Newer
firmwares, on the other hand, will correctly set the rebuild rate to the
implementation defined value, but the Mode Page field will display the
configured value, instead of 0x0.  This causes iprutils to believe the
new configuration has failed, and error out.

The Implementation defined value used by every IPR adapter out there is
the minimum rebuild rate possible, 2/16, which translates to 0x2 in the
Mode page field.  This patch gives iprutils the notion of the minimum
rebuild rate, and supports this scenario, so we don't fail when the user
requests a rebuild rate of 0.

To avoid confusing the user, we also make the values go from 10 to 100
instead of 0-100.  If the user wants to enable the default setting,
instead of typing 0, he needs to use 'default'.

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-04-05 08:25:16 -05:00
Gabriel Krisman Bertazi
7b26b451b0 iprutils: Support Write buffer with smaller buffer length.
Some new enclosures, like ESLS only supports a limited buffer of 4k
bytes during SCSI Write Buffer calls. This means that doing a single
Write Buffer with mode 0Eh to download a large microcode will fail with
an Illegal Request.  This patch adds a fallback mode to the Write Buffer
command in iprlib, allowing it to limit the buffer block size to 4K, in
case the single full write fails.  If the device supports large buffers,
behavior remains unchanged, and iprlib can only issue a single write.

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-04-05 07:11:52 -05:00
Brian King
3aa2da9936 Merge branch 'leitao-master'
Merge debian build fixes.

Signed-off-by: Breno Leitao <brenohl@br.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-04-01 15:49:39 -05:00
Brian King
8add34cf1b Merge branch 'master' of https://github.com/leitao/iprutils-1 into leitao-master
Merge debian build fixes.

Signed-off-by: Breno Leitao <brenohl@br.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-04-01 15:45:04 -05:00
Heitor Ricardo Alves de Siqueira
3340918f42 iprutils: fix build error for older zlib versions
The use of gzclose_r() may break some builds depending on the version of zlib
that is being used. Since that function is identical to gzclose() apart from
some differences in static code linkage, we can swap them without any changes to
program behaviour.

Signed-off-by: Heitor Ricardo Alves de Siqueira <halves@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-04-01 15:28:21 -05:00
Brian King
ca551fe3c4 iprutils: Fixup build issues
When I pushed commit 855e7fd ("iprutils: Enable editor choice for new log system")
I had to manually merge them and ended up missing a couple of files which didn't get
pushed. This fixes that up.

Reported-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2016-03-28 16:17:51 -05:00
Breno Leitao
9c78171d18 Remove hardcoded systemctl path from iprsos
Although not usual, systemd binaries could be somewhere else other than
/usr/bin. This patch just remove this hard coded dependency.

This patch come from the Debian maintainer Colin Watson
<cjwatson@debian.org>

Signed-off-by: Breno Leitao <brenohl@br.ibm.com>
2016-03-28 17:14:56 -03:00
Breno Leitao
8993d42441 Fix device_id scanning on 32-bit systems
scsi_dev_data->device_id is a u64, so should be scanned with %llX rather
than %lX.  On 32-bit big-endian systems I believe this will scan the
device_id into the wrong half of the 64-bit value.

This patch come from the Debian maintainer Colin Watson
<cjwatson@debian.org>

Signed-off-by: Breno Leitao <brenohl@br.ibm.com>
2016-03-28 17:13:26 -03:00
Breno Leitao
3340309de7 Support force-reload options on daemon scripts
Support force-reload options, which is useful and it is required be by
Debian policy.

This patch come from the Debian maintainer Colin Watson
<cjwatson@debian.org>

Signed-off-by: Breno Leitao <brenohl@br.ibm.com>
2016-03-28 17:09:35 -03:00