Commit graph

581 commits

Author SHA1 Message Date
Brian King
df2be04800 iprutils: Fix rpm build with new udev driven systemd services
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2018-06-05 08:49:14 -05:00
Brian King
5832ec2cb4 iprutils: Further show-details speedup
While attempting to further optimize show-details performance,
it was observed that get_drive_phy_loc was iterating over all
ioa's, even though a specific ioa is passed into the function.
On large configurations, this resulted in show-details taking
longer than 5 seconds. If we remove this redundant code, show-details
will now complete in less than 1 second in a similar configuration.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2018-06-05 08:32:28 -05:00
Dan Horák
3af0d5dc83 install udev rules 2018-05-14 15:06:50 +02:00
Dan Horák
aeca4f9208 properly install iprutils.target 2018-05-14 15:06:50 +02:00
Jakub Čajka
65ada384b0 Add posibility to activate ipr systemd units via udev rule and corresponding iprutils.target that makes deps between the ipr systemd units
Add those new files in to the dist target
2018-05-13 19:03:32 +02:00
Brian King
f1a87842c6 iprutils: Version 2.4.16
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2018-05-01 15:24:56 -05:00
Wen Xiong
981c7dda80 iprutils: Improve error messages when creating the arrays with RI and non-RI disks
When creating the arrays with RI and non-RI ssd disks, this patch
improves the error message in GUI and command line.

Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2018-04-25 15:31:46 -06:00
Brian King
f3bc6fa5d4 iprutils: Speedup for show-details
Avoid unnecessary commands in check_current_config for show-details.
This provides a nice speedup in large configs when vpdupdate gets
run, which calls show-details for every device in the system.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2018-04-25 15:30:02 -06:00
Brian King
35e85f59ef iprutils: Fix microcode image sorting on little endian systems
Fixes the sorting of microcode images from the filesystem
on little endian systems so that when using the ncurses
interface to download microcode, the latest version shows
up as the top option.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2018-02-12 08:43:00 -06:00
Brian King
1d7c258706 iprutils: Fix download microcode to all devices
This fixes a regression that was introduced which broke the
iprconfig option to download microcode to all devices.

Fixes: bcfcda764d ("iprutils: Fix iprconfig dump option to log full IOA details")
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2018-02-12 08:42:56 -06:00
Brian King
635f0170ee iprutils: Version 2.4.15
Bump version.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2017-06-19 08:37:02 -05:00
Brian King
e72dee8ef3 iprutils: Enable write cache policy for JBODs
If there is no saved write cache policy for a JBOD, we
would like the write cache policy to default to write back
for the best performance. To do this, we do two things:

1. Remove the write_cache_policy field in the ipr_dev struct.
2. Enhance ipr_modify_dev_attr to set write_cache_policy to the default
   value of write back if there is no saved write cache policy.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
2017-06-16 16:10:01 -05:00
Brian King
053ce15504 iprutils: Fix data direction for some SG_IO ioctls
This fixes up a couple places where iprutils was not
setting the data direction to SG_DXFER_NONE for SG_IO
ioctls with a zero data length. The sg driver has recently
gotten more strict about this and has started failing
these requests.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2017-06-16 16:09:33 -05:00
Guilherme G. Piccoli
67abd8ceb2 iprutils/trivial: improve README documentation
Added more packages as required to perform build process, like
libtool, autoconf and automake. Pointed name differences of devel
packages on Ubuntu (compared with RHEL-based distros).

Also, fixed a typo on README file.

Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2017-06-09 09:56:38 -05:00
Brian King
aba0efca11 iprutils: Display RAID migration status
When performing a RAID array level migration operation, display this
as a unique status rather than simply reporting Degraded. Adds a new
status of Migrating and XX% Migrated.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
2017-04-19 10:55:24 -05:00
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