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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>