iprdd-commit Mailing List for IPR Linux device driver
Brought to you by:
brking
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
|
Jul
|
Aug
(3) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(6) |
Feb
|
Mar
|
Apr
(6) |
May
(2) |
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
(2) |
Jul
|
Aug
(2) |
Sep
(2) |
Oct
(2) |
Nov
|
Dec
|
From: Kleber S. de S. <kl...@us...> - 2009-10-30 18:46:49
|
Update of /cvsroot/iprdd/iprutils In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19014/iprutils Modified Files: iprconfig.c iprlib.c version.mk Log Message: Change default write buffer mode. Fix show-details for ses devices. Comment out get_write_buffer_dev. Fix Platform Location information. Fix iprconfig indentation. Index: version.mk =================================================================== RCS file: /cvsroot/iprdd/iprutils/version.mk,v retrieving revision 1.76 retrieving revision 1.77 diff -u -d -r1.76 -r1.77 --- version.mk 16 Sep 2009 23:38:05 -0000 1.76 +++ version.mk 30 Oct 2009 18:46:39 -0000 1.77 @@ -6,9 +6,9 @@ IPR_MAJOR_RELEASE=2 IPR_MINOR_RELEASE=2 -IPR_FIX_LEVEL=17 +IPR_FIX_LEVEL=18 IPR_RELEASE=1 -IPR_FIX_DATE=(September 16, 2009) +IPR_FIX_DATE=(October 30, 2009) IPR_VERSION_STR=$(IPR_MAJOR_RELEASE).$(IPR_MINOR_RELEASE).$(IPR_FIX_LEVEL) $(IPR_FIX_DATE) Index: iprlib.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.c,v retrieving revision 1.126 retrieving revision 1.127 diff -u -d -r1.126 -r1.127 --- iprlib.c 16 Sep 2009 23:38:05 -0000 1.126 +++ iprlib.c 30 Oct 2009 18:46:39 -0000 1.127 @@ -32,7 +32,7 @@ int ipr_sg_required = 0; int polling_mode = 0; int ipr_fast = 0; -static int ipr_mode5_write_buffer = 1; +static int ipr_mode5_write_buffer = 0; struct sysfs_dev *head_zdev = NULL; struct sysfs_dev *tail_zdev = NULL; @@ -1699,15 +1699,22 @@ return 0; } +static int ipr_select_pci_address(const struct dirent *dirent) +{ + if (strstr(dirent->d_name, "address")) + return 1; + return 0; +} + /** - * read_slot_attr - + * read_attr_file - * @path: path name of device/file to open * @out: character array * * Returns: * 0 if success / non-zero on failure **/ -static int read_slot_attr(char *path, char out[SYSFS_PATH_MAX]) +static int read_attr_file(char *path, char *out, int size) { int fd, len; @@ -1716,7 +1723,7 @@ return -EIO; } - len = read(fd, out, SYSFS_PATH_MAX); + len = read(fd, out, size); if (len < 0) { syslog_dbg("Failed to read %s\n", path); close(fd); @@ -1731,14 +1738,14 @@ } /** - * ipr_add_slot - + * ipr_add_slot_location - * @path: path of device/file to open * @name: name of device/file to open * * Returns: * 0 if success / non-zero on failure **/ -static int ipr_add_slot(char *path, char *name) +static int ipr_add_slot_location(char *path, char *name) { struct ipr_pci_slot *slot; char fpath[SYSFS_PATH_MAX]; @@ -1751,13 +1758,50 @@ memset(slot, 0, sizeof(*slot)); strcpy(slot->slot_name, name); - rc = read_slot_attr(fpath, slot->physical_name); + rc = read_attr_file(fpath, slot->physical_name, + sizeof(slot->physical_name)); + + if (rc) { + pci_slot = realloc(pci_slot, sizeof(*pci_slot) * num_pci_slots); + return rc; + } + + num_pci_slots++; + return 0; +} + +/** + * ipr_add_slot_address - + * @path: path of device/file to open + * @name: name of device/file to open + * + * Returns: + * 0 if success / non-zero on failure + **/ +static int ipr_add_slot_address(char *path, char *name) +{ + struct ipr_pci_slot *slot; + char fpath[SYSFS_PATH_MAX]; + int rc; + + sprintf(fpath, "%s%s/address", path, name); + + pci_slot = realloc(pci_slot, sizeof(*pci_slot) * (num_pci_slots + 1)); + slot = &pci_slot[num_pci_slots]; + memset(slot, 0, sizeof(*slot)); + + strcpy(slot->slot_name, name); + strcpy(slot->physical_name, name); + rc = read_attr_file(fpath, slot->pci_device, + sizeof(slot->pci_device)); if (rc) { pci_slot = realloc(pci_slot, sizeof(*pci_slot) * num_pci_slots); return rc; } + strcat(slot->pci_device, ".0"); + num_pci_slots++; return 0; } @@ -1772,7 +1816,10 @@ { char rootslot[SYSFS_PATH_MAX], slot[SYSFS_PATH_MAX]; char slotpath[SYSFS_PATH_MAX], attr[SYSFS_PATH_MAX]; + char devspec[PATH_MAX], locpath[PATH_MAX]; + char loc_code[1024], *last_hyphen, *prev_hyphen; int num_slots, i, j, rc, num_attrs; + int slot_found = 0; struct dirent **slotdir, **dirent; struct stat statbuf; struct ipr_ioa *ioa; @@ -1792,13 +1839,23 @@ for (i = 0; i < num_slots; i++) { sprintf(slot, "%s%s", rootslot, slotdir[i]->d_name); rc = scandir(slot, &dirent, ipr_select_phy_location, alphasort); - if (rc <= 0) - continue; + if (rc > 0) { + ipr_add_slot_location(rootslot, slotdir[i]->d_name); + while (rc--) + free(dirent[rc]); + free(dirent); + } else { + rc = scandir(slot, &dirent, ipr_select_pci_address, + alphasort); - ipr_add_slot(rootslot, slotdir[i]->d_name); - while (rc--) - free(dirent[rc]); - free(dirent); + if (rc <= 0) + continue; + + ipr_add_slot_address(rootslot, slotdir[i]->d_name); + while (rc--) + free(dirent[rc]); + free(dirent); + } } while (num_slots--) @@ -1806,6 +1863,10 @@ free(slotdir); for (i = 0; i < num_pci_slots; i++) { + + if (!pci_slot[i].pci_device) + continue; + sprintf(slotpath, "%s/"SYSFS_DEVICES_NAME"/%s/", sysfs_bus->path, pci_slot[i].slot_name); @@ -1837,12 +1898,42 @@ ioa->physical_location[0] = '\0'; for_each_ioa(ioa) { + slot_found = 0; for (i = 0; i < num_pci_slots; i++) { - if (strcmp(pci_slot[i].pci_device, ioa->pci_address)) + if (strcmp(pci_slot[i].pci_device, ioa->pci_address) && + strcmp(pci_slot[i].slot_name, ioa->pci_address)) continue; - strcpy(ioa->physical_location, pci_slot[i].physical_name); + strcpy(ioa->physical_location, + pci_slot[i].physical_name); + slot_found = 1; break; } + if (!slot_found) { + sprintf(attr, "%s/"SYSFS_DEVICES_NAME"/%s/devspec", + sysfs_bus->path, ioa->pci_address); + rc = read_attr_file(attr, devspec, PATH_MAX); + + if (rc) + continue; + + sprintf(locpath, "/proc/device-tree%s/ibm,loc-code", + devspec); + rc = read_attr_file(locpath, loc_code, + sizeof(loc_code)); + + if (rc) + continue; + + last_hyphen = strrchr(loc_code, '-'); + if (last_hyphen && last_hyphen[1] == 'T') { + *last_hyphen = '\0'; + prev_hyphen = strrchr(loc_code, '-'); + if (prev_hyphen && prev_hyphen[1] != 'C') + *last_hyphen = '-'; + } + + strcpy(ioa->physical_location, loc_code); + } } free(pci_slot); @@ -3770,6 +3861,7 @@ * Returns: * device generic name for now - see FIXME below **/ +#if 0 static char *get_write_buffer_dev(struct ipr_dev *dev) { struct sysfs_class_device *class_device; @@ -3819,6 +3911,7 @@ sysfs_close_class_device(class_device); return dev->gen_name; } +#endif /** * ipr_resume_device_bus - Index: iprconfig.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprconfig.c,v retrieving revision 1.140 retrieving revision 1.141 diff -u -d -r1.140 -r1.141 --- iprconfig.c 14 Aug 2009 17:36:31 -0000 1.140 +++ iprconfig.c 30 Oct 2009 18:46:39 -0000 1.141 @@ -11747,6 +11747,7 @@ char *gen_name = dev->gen_name; char node_name[7], buf[100], raid_str[48]; int tab_stop = 0; + int loc_len = 0; char vendor_id[IPR_VENDOR_ID_LEN + 1]; char product_id[IPR_PROD_ID_LEN + 1]; struct ipr_ioa *ioa = dev->ioa; @@ -11769,35 +11770,42 @@ if (option) len += sprintf(body + len, " %s ", option); - len += sprintf(body + len, "%-6s %s/%d:", - node_name, - ioa->pci_address, - ioa->host_num); + len += sprintf(body + len, "%-6s ", node_name); + loc_len = sprintf(body + len, "%s/%d:", + ioa->pci_address, + ioa->host_num); + len += loc_len; if (scsi_dev_data && scsi_dev_data->type == IPR_TYPE_ADAPTER) { + + for (i = 0; i < 27-loc_len; i++) + body[len+i] = ' '; + + len += 27-loc_len; + if (!vpd) { - len += sprintf(body + len," %s %-19s ", get_bus_desc(ioa), + len += sprintf(body + len,"%s %-19s ", get_bus_desc(ioa), get_ioa_desc(dev->ioa)); } else - len += sprintf(body + len," %-8s %-16s ", + len += sprintf(body + len,"%-8s %-16s ", scsi_dev_data->vendor_id, scsi_dev_data->product_id); } else if (scsi_dev_data && scsi_dev_data->type == IPR_TYPE_EMPTY_SLOT) { - tab_stop = sprintf(body + len,"%d:%d: ", - dev->res_addr[ra].bus, - dev->res_addr[ra].target); + loc_len += sprintf(body + len,"%d:%d: ", + dev->res_addr[ra].bus, + dev->res_addr[ra].target); - len += tab_stop; + len += loc_len; - for (i = 0; i < 12-tab_stop; i++) + for (i = 0; i < 27-loc_len; i++) body[len+i] = ' '; - len += 12-tab_stop; - len += sprintf(body + len, "%-8s %-16s "," ", " "); + len += 27-loc_len; + len += sprintf(body + len, "%-8s %-16s ", " ", " "); } else { - tab_stop = sprintf(body + len,"%d:%d:%d ", dev->res_addr[ra].bus, - dev->res_addr[ra].target, dev->res_addr[ra].lun); + tab_stop = sprintf(body + len,"%d:%d:%d ", dev->res_addr[ra].bus, + dev->res_addr[ra].target, dev->res_addr[ra].lun); if (scsi_dev_data) { ipr_strncpy_0(vendor_id, scsi_dev_data->vendor_id, IPR_VENDOR_ID_LEN); @@ -11813,12 +11821,13 @@ } } + loc_len += tab_stop; len += tab_stop; - for (i = 0; i < 12-tab_stop; i++) + for (i = 0; i < 27-loc_len; i++) body[len+i] = ' '; - len += 12-tab_stop; + len += 27-loc_len; if (vpd) { len += sprintf(body + len, "%-8s %-16s ", @@ -14902,6 +14911,8 @@ body = ioa_details(body, dev); else if (ipr_is_volume_set(dev)) body = vset_details(body, dev); + else if (ipr_is_ses(dev)) + body = ses_details(body, dev); else body = disk_details(body, dev); |
From: Kleber S. de S. <kl...@us...> - 2009-10-30 18:46:48
|
Update of /cvsroot/iprdd/iprutils/spec In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19014/iprutils/spec Modified Files: iprutils.spec Log Message: Change default write buffer mode. Fix show-details for ses devices. Comment out get_write_buffer_dev. Fix Platform Location information. Fix iprconfig indentation. Index: iprutils.spec =================================================================== RCS file: /cvsroot/iprdd/iprutils/spec/iprutils.spec,v retrieving revision 1.98 retrieving revision 1.99 diff -u -d -r1.98 -r1.99 --- iprutils.spec 16 Sep 2009 23:38:06 -0000 1.98 +++ iprutils.spec 30 Oct 2009 18:46:39 -0000 1.99 @@ -1,6 +1,6 @@ Summary: Utilities for the IBM Power Linux RAID adapters Name: iprutils -Version: 2.2.17 +Version: 2.2.18 Release: 1 License: CPL Group: System Environment/Base @@ -81,6 +81,16 @@ %{_sysconfdir}/ha.d/resource.d/iprha %changelog +* Fri Oct 30 2009 Kleber Sacilotto de Souza <kl...@li...> 2.2.18 +- Release 2.2.18 +- Changes the default write buffer mode for writing to SES devices. +- Fixes the CLI show-details command for SES devices. +- Comments out the get_write_buffer_dev() routine to suppress compilation + warnings as it is not being used at the moment. +- Fixes the Platform Location Information display for hotplug adapters and + displays the information for non-hotplug adapters. +- Fixes the indentation problem when IOA host number is equal to or greater + than 10. * Wed Sep 16 2009 Wayne Boyer <wa...@li...> 2.2.17 - Release 2.2.17 - Fixes a NULL pointer dereference which caused the daemons to silently fail. |
From: Wayne B. <wb...@us...> - 2009-09-16 23:38:19
|
Update of /cvsroot/iprdd/iprutils In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20330/iprutils Modified Files: iprlib.c version.mk Log Message: Fixes a NULL pointer dereference which caused the daemons to silently fail. Index: version.mk =================================================================== RCS file: /cvsroot/iprdd/iprutils/version.mk,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 --- version.mk 14 Aug 2009 17:36:32 -0000 1.75 +++ version.mk 16 Sep 2009 23:38:05 -0000 1.76 @@ -6,9 +6,9 @@ IPR_MAJOR_RELEASE=2 IPR_MINOR_RELEASE=2 -IPR_FIX_LEVEL=16 +IPR_FIX_LEVEL=17 IPR_RELEASE=1 -IPR_FIX_DATE=(August 14, 2009) +IPR_FIX_DATE=(September 16, 2009) IPR_VERSION_STR=$(IPR_MAJOR_RELEASE).$(IPR_MINOR_RELEASE).$(IPR_FIX_LEVEL) $(IPR_FIX_DATE) Index: iprlib.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.c,v retrieving revision 1.125 retrieving revision 1.126 diff -u -d -r1.125 -r1.126 --- iprlib.c 14 Aug 2009 17:36:32 -0000 1.125 +++ iprlib.c 16 Sep 2009 23:38:05 -0000 1.126 @@ -1906,6 +1906,9 @@ class_devices = sysfs_get_class_devices(sysfs_host_class); dlist_for_each_data(class_devices, class_device, struct sysfs_class_device) { sysfs_host_device = sysfs_get_classdev_device(class_device); + if (!sysfs_host_device) + continue; + sysfs_pci_device = sysfs_get_device_parent(sysfs_host_device); if (strcmp(pci_address, sysfs_pci_device->name) == 0) { @@ -1924,6 +1927,9 @@ class_devices = sysfs_get_class_devices(sysfs_device_class); dlist_for_each_data(class_devices, class_device, struct sysfs_class_device) { sysfs_device_device = sysfs_get_classdev_device(class_device); + if (!sysfs_device_device) + continue; + sprintf(buf, "%d:255:255:255", ipr_ioa->host_num); if (!strcmp(buf, sysfs_device_device->name)) { |
From: Wayne B. <wb...@us...> - 2009-09-16 23:38:17
|
Update of /cvsroot/iprdd/iprutils/spec In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20330/iprutils/spec Modified Files: iprutils.spec Log Message: Fixes a NULL pointer dereference which caused the daemons to silently fail. Index: iprutils.spec =================================================================== RCS file: /cvsroot/iprdd/iprutils/spec/iprutils.spec,v retrieving revision 1.97 retrieving revision 1.98 diff -u -d -r1.97 -r1.98 --- iprutils.spec 14 Aug 2009 17:36:32 -0000 1.97 +++ iprutils.spec 16 Sep 2009 23:38:06 -0000 1.98 @@ -1,6 +1,6 @@ Summary: Utilities for the IBM Power Linux RAID adapters Name: iprutils -Version: 2.2.16 +Version: 2.2.17 Release: 1 License: CPL Group: System Environment/Base @@ -81,6 +81,9 @@ %{_sysconfdir}/ha.d/resource.d/iprha %changelog +* Wed Sep 16 2009 Wayne Boyer <wa...@li...> 2.2.17 +- Release 2.2.17 +- Fixes a NULL pointer dereference which caused the daemons to silently fail. * Fri Aug 14 2009 Wayne Boyer <wa...@li...> 2.2.16 - Release 2.2.16 - Fixes a bug where CLI raid create is broken. |
From: Wayne B. <wb...@us...> - 2009-08-14 17:36:46
|
Update of /cvsroot/iprdd/iprutils In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15043/iprutils Modified Files: iprconfig.8 iprconfig.c iprlib.c version.mk Log Message: memory leak fixes and raid create fix Index: version.mk =================================================================== RCS file: /cvsroot/iprdd/iprutils/version.mk,v retrieving revision 1.74 retrieving revision 1.75 diff -u -d -r1.74 -r1.75 --- version.mk 30 Jun 2009 23:32:40 -0000 1.74 +++ version.mk 14 Aug 2009 17:36:32 -0000 1.75 @@ -6,9 +6,9 @@ IPR_MAJOR_RELEASE=2 IPR_MINOR_RELEASE=2 -IPR_FIX_LEVEL=15 +IPR_FIX_LEVEL=16 IPR_RELEASE=1 -IPR_FIX_DATE=(June 30, 2009) +IPR_FIX_DATE=(August 14, 2009) IPR_VERSION_STR=$(IPR_MAJOR_RELEASE).$(IPR_MINOR_RELEASE).$(IPR_FIX_LEVEL) $(IPR_FIX_DATE) Index: iprlib.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.c,v retrieving revision 1.124 retrieving revision 1.125 diff -u -d -r1.124 -r1.125 --- iprlib.c 30 Jun 2009 23:32:40 -0000 1.124 +++ iprlib.c 14 Aug 2009 17:36:32 -0000 1.125 @@ -6137,8 +6137,6 @@ **/ int ipr_get_ioa_attr(struct ipr_ioa *ioa, struct ipr_ioa_attr *attr) { - struct ipr_dual_ioa_entry *ioa_entry; - attr->preferred_primary = 0; attr->gscsi_only_ha = ioa->in_gscsi_only_ha; attr->active_active = ioa->asymmetric_access_enabled; @@ -6147,9 +6145,6 @@ if (!ioa->dual_raid_support) return 0; - ioa_entry = (struct ipr_dual_ioa_entry *) - (((unsigned long)&ioa->ioa_status.cap) + ntohl(ioa->ioa_status.cap.length)); - if (ioa->ioa_status.cap.preferred_role == IPR_IOA_STATE_PRIMARY) attr->preferred_primary = 1; return 0; Index: iprconfig.8 =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprconfig.8,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- iprconfig.8 26 Sep 2008 20:54:10 -0000 1.21 +++ iprconfig.8 14 Aug 2009 17:36:31 -0000 1.22 @@ -1,9 +1,9 @@ -.\" (C) Copyright 2000, 2008 +.\" (C) Copyright 2000, 2009 .\" International Business Machines Corporation and others. .\" All Rights Reserved. This program and the accompanying .\" materials are made available under the terms of the .\" Common Public License v1.0 which accompanies this distribution. -.TH IPRCONFIG 8 "December 2005" +.TH IPRCONFIG 8 "August 2009" .SH NAME iprconfig \- IBM Power RAID storage adapter configuration/recovery utility .SH SYNOPSIS @@ -424,6 +424,11 @@ .br Show the current asymmetric access mode for the given disk array. .TP +.B query-ioa-caching [IOA] +.br +Show whether or not the user requested caching mode for the given IOA is set to +default or disabled. +.TP .B raid-create [-r raid_level] [-s stripe_size_in_kb] [devices...] Create a RAID array. RAID level can be any supported RAID level for the given adapter, such as 0, 10, 5, 6. Currently supported stripe sizes in kb @@ -681,9 +686,18 @@ .B iprconfig -c set-array-asymmetric-access-mode sda Optimized .TP .B set-ioa-asymmetric-access-mode [IOA] [Enabled | Disabled] -Used to set the asymmetric access mode of the IOA. Example: +Used to set the asymmetric access mode of the IOA. +.br +Example: .br .B iprconfig -c set-ioa-asymmetric-access-mode sg5 Enabled +.TP +.B set-ioa-caching [IOA] [Default | Disabled] +Used to set the requested caching mode of the IOA. +.br +Example: +.br +.B iprconfig -c set-ioa-caching sg5 Disabled .RE .TP .B \-\-version Index: iprconfig.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprconfig.c,v retrieving revision 1.139 retrieving revision 1.140 diff -u -d -r1.139 -r1.140 --- iprconfig.c 30 Jun 2009 23:32:40 -0000 1.139 +++ iprconfig.c 14 Aug 2009 17:36:31 -0000 1.140 @@ -1841,8 +1841,10 @@ do { n_disk_status.body = buffer[toggle&1]; s_out = screen_driver(&n_disk_status,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -1851,8 +1853,6 @@ n_disk_status.body = NULL; - rc = s_out->rc; - free(s_out); return rc; } @@ -2543,8 +2543,10 @@ do { n_raid_status.body = buffer[toggle&1]; s_out = screen_driver(&n_raid_status,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -2553,8 +2555,6 @@ n_raid_status.body = NULL; - rc = s_out->rc; - free(s_out); return rc; } @@ -2565,6 +2565,12 @@ * * Returns: * 1 if the array is in use / 0 otherwise + * + * TODO: This routine no longer works. It was originally designed to work + * with the 2.4 kernels. For now, the routine will just return 0. + * The rest of the code is being left in place in case this kind of + * test becomes possible in the future. + * JWB - August 11, 2009 **/ static int is_array_in_use(struct ipr_ioa *ioa, u8 array_id) @@ -2572,6 +2578,8 @@ int opens; struct ipr_dev *vset; + return 0; + for_each_vset(ioa, vset) { if (array_id == vset->array_rcd->array_id) { if (!vset->scsi_dev_data) @@ -2640,19 +2648,21 @@ free(n_raid_stop_fail.body); n_raid_stop_fail.body = NULL; + + rc = s_out->rc; + free(s_out); } else { toggle_field = 0; do { n_raid_stop.body = buffer[toggle&1]; s_out = screen_driver(&n_raid_stop,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); + } while (rc == TOGGLE_SCREEN); } - rc = s_out->rc; - free(s_out); - for (k = 0; k < 2; k++) { free(buffer[k]); buffer[k] = NULL; @@ -2730,11 +2740,10 @@ do { n_confirm_raid_stop.body = buffer[toggle&1]; s_out = screen_driver(&n_confirm_raid_stop,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; - free(s_out); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -2917,11 +2926,10 @@ do { n_raid_start.body = buffer[toggle&1]; s_out = screen_driver(&n_raid_start,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; - free(s_out); + } while (rc == TOGGLE_SCREEN); free_raid_cmds(); } @@ -2998,6 +3006,7 @@ i_container *i_con2 = NULL; i_container *i_con_head_saved; i_container *temp_i_con = NULL; + i_container *temp_i_con2; struct screen_output *s_out; int header_lines; int toggle = 0; @@ -3028,16 +3037,16 @@ do { n_configure_raid_start.body = buffer[toggle&1]; s_out = screen_driver(&n_configure_raid_start,header_lines,i_con2); + temp_i_con2 = s_out->i_con; + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; + } while (rc == TOGGLE_SCREEN); if (rc > 0) goto leave; - i_con2 = s_out->i_con; - free(s_out); + i_con2 = temp_i_con2; found = 0; @@ -3534,11 +3543,10 @@ do { n_confirm_raid_start.body = buffer[toggle&1]; s_out = screen_driver(&n_confirm_raid_start,header_lines,NULL); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; - free(s_out); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -3763,11 +3771,10 @@ do { n_raid_rebuild.body = buffer[toggle&1]; s_out = screen_driver(&n_raid_rebuild,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; - free(s_out); + } while (rc == TOGGLE_SCREEN); free_raid_cmds(); } @@ -3838,11 +3845,10 @@ do { n_confirm_raid_rebuild.body = buffer[toggle&1]; s_out = screen_driver(&n_confirm_raid_rebuild,header_lines,NULL); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; - free(s_out); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -3995,11 +4001,11 @@ do { n_raid_resync.body = buffer[toggle&1]; s_out = screen_driver(&n_raid_resync,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); + } while (rc == TOGGLE_SCREEN); - rc = s_out->rc; - free(s_out); free_raid_cmds(); } @@ -4070,11 +4076,10 @@ do { n_confirm_raid_resync.body = buffer[toggle&1]; s_out = screen_driver(&n_confirm_raid_resync,header_lines,NULL); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; - free(s_out); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -5195,8 +5200,8 @@ while (rc & REFRESH_FLAG) { s_out = screen_driver(&n_change_array_asym_access, header_lines, NULL); - rc = s_out->rc; + free(s_out); if (rc == RC_SUCCESS) { if (!acd->do_cmd) { @@ -5222,7 +5227,6 @@ n_change_array_asym_access.body = NULL; free_i_con(new_i_con); i_con_head = i_con_head_saved; - free(s_out); return rc; } @@ -5415,11 +5419,11 @@ do { n_raid_include.body = buffer[toggle&1]; s_out = screen_driver(&n_raid_include,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); + } while (rc == TOGGLE_SCREEN); - rc = s_out->rc; - free(s_out); free_raid_cmds(); } @@ -5538,8 +5542,11 @@ do { n_configure_raid_include.body = buffer[toggle&1]; s_out = screen_driver(&n_configure_raid_include,header_lines,i_con); + temp_i_con = s_out->i_con; + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -5548,9 +5555,9 @@ n_configure_raid_include.body = NULL; - i_con = s_out->i_con; + i_con = temp_i_con; - if ((rc = s_out->rc) > 0) + if (rc > 0) goto leave; /* first, count devices selected to be sure min multiple is satisfied */ @@ -5589,7 +5596,6 @@ rc = confirm_raid_include(i_con); leave: - free(s_out); return rc; } @@ -5636,11 +5642,10 @@ do { n_confirm_raid_include.body = buffer[toggle&1]; s_out = screen_driver(&n_confirm_raid_include, header_lines, NULL); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; - free(s_out); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -6110,21 +6115,23 @@ free(n_af_remove_fail.body); n_af_remove_fail.body = NULL; } + + rc = s_out->rc; + free(s_out); } else { toggle_field = 0; do { n_screen->body = buffer[toggle&1]; s_out = screen_driver(n_screen,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); + } while (rc == TOGGLE_SCREEN); free_devs_to_init(); } - rc = s_out->rc; - free(s_out); - for (k = 0; k < 2; k++) { free(buffer[k]); buffer[k] = NULL; @@ -6266,6 +6273,7 @@ n_remove_hot_spare_fail.body = NULL; } + free(s_out); rc = EXIT_FLAG; goto leave; } @@ -6273,13 +6281,13 @@ do { n_screen->body = buffer[toggle&1]; s_out = screen_driver(n_screen,header_lines,i_con); + temp_i_con = s_out->i_con; + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; - free(s_out); + } while (rc == TOGGLE_SCREEN); - i_con = s_out->i_con; + i_con = temp_i_con; if (rc > 0) { rc = EXIT_FLAG; @@ -6356,6 +6364,7 @@ struct scsi_dev_data *scsi_dev_data; struct ipr_dev_record *dev_rcd; i_container *temp_i_con,*i_con2 = NULL; + i_container *temp_i_con2; struct screen_output *s_out = NULL; int header_lines; s_node *n_screen; @@ -6396,8 +6405,11 @@ do { n_screen->body = buffer[toggle&1]; s_out = screen_driver(n_screen,header_lines,i_con2); + temp_i_con2 = s_out->i_con; + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -6406,8 +6418,7 @@ n_screen->body = NULL; - rc = s_out->rc; - i_con2 = s_out->i_con; + i_con2 = temp_i_con2; if (rc > 0) goto leave; @@ -6438,7 +6449,6 @@ leave: i_con2 = free_i_con(i_con2); i_con_head = i_con_head_saved; - free(s_out); return rc; } @@ -6486,8 +6496,10 @@ do { n_screen->body = buffer[toggle&1]; s_out = screen_driver(n_screen,header_lines,NULL); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -6496,9 +6508,6 @@ n_screen->body = NULL; - rc = s_out->rc; - free(s_out); - if(rc > 0) goto leave; @@ -6776,9 +6785,10 @@ do { n_screen->body = buffer[toggle&1]; s_out = screen_driver(n_screen,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - rc = s_out->rc; + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -7239,7 +7249,7 @@ **/ int start_conc_maint(i_container *i_con, int action) { - int rc, i, k; + int rc, s_rc, i, k; char *buffer[2]; int num_lines = 0; struct screen_output *s_out; @@ -7281,8 +7291,10 @@ do { n_screen->body = buffer[toggle&1]; s_out = screen_driver(n_screen,header_lines,i_con); + s_rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); + } while (s_rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -7291,7 +7303,7 @@ n_screen->body = NULL; - if (!s_out->rc) { + if (!s_rc) { if (action == IPR_CONC_REMOVE) rc = process_conc_maint(i_con, IPR_VERIFY_CONC_REMOVE); else @@ -7305,7 +7317,6 @@ free_empty_slots(devs, num_devs); free(devs); - free(s_out); return rc; } @@ -7425,11 +7436,10 @@ do { n_path_status.body = buffer[toggle&1]; s_out = screen_driver(&n_path_status, header_lines, i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; - free(s_out); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -7538,11 +7548,10 @@ do { n_init_device.body = buffer[toggle&1]; s_out = screen_driver(&n_init_device,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; - free(s_out); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -7622,11 +7631,10 @@ do { n_confirm_init_device.body = buffer[toggle&1]; s_out = screen_driver(&n_confirm_init_device,header_lines,NULL); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; - free(s_out); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -8034,11 +8042,10 @@ do { n_reclaim_cache.body = buffer[toggle&1]; s_out = screen_driver(&n_reclaim_cache,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; - free(s_out); + } while (rc == TOGGLE_SCREEN); leave: @@ -8124,11 +8131,10 @@ do { n_confirm_reclaim.body = buffer[toggle&1]; s_out = screen_driver(&n_confirm_reclaim,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; - free(s_out); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -8169,11 +8175,10 @@ do { n_confirm_reclaim_warning.body = buffer[toggle&1]; s_out = screen_driver(&n_confirm_reclaim_warning,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; - free(s_out); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -8356,11 +8361,11 @@ do { n_battery_maint.body = buffer[toggle&1]; s_out = screen_driver(&n_battery_maint,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); + } while (rc == TOGGLE_SCREEN); - rc = s_out->rc; - free(s_out); leave: for (k = 0; k < 2; k++) { @@ -8519,11 +8524,10 @@ do { n_confirm_force_battery_error.body = buffer[toggle&1]; s_out = screen_driver(&n_confirm_force_battery_error,header_lines,NULL); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; - free(s_out); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -8600,11 +8604,10 @@ do { n_confirm_start_cache.body = buffer[toggle&1]; s_out = screen_driver(&n_confirm_start_cache,header_lines,NULL); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; - free(s_out); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -8758,11 +8761,10 @@ do { n_bus_config.body = buffer[toggle&1]; s_out = screen_driver(&n_bus_config,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; - free(s_out); + } while (rc == TOGGLE_SCREEN); } for (k = 0; k < 2; k++) { @@ -9019,6 +9021,7 @@ while (1) { s_out = screen_driver(&n_change_bus_attr,header_lines,i_con); rc = s_out->rc; + free(s_out); for_each_icon(temp_i_con) { if (!temp_i_con->field_data[0]) { @@ -9061,7 +9064,6 @@ free(n_change_bus_attr.body); n_change_bus_attr.body = NULL; free_i_con(i_con); - free(s_out); return rc; } @@ -9587,11 +9589,10 @@ do { n_driver_config.body = buffer[toggle&1]; s_out = screen_driver(&n_driver_config,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - rc = s_out->rc; - free(s_out); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -9778,8 +9779,10 @@ do { n_disk_config.body = buffer[toggle&1]; s_out = screen_driver(&n_disk_config,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -9787,8 +9790,6 @@ } n_disk_config.body = NULL; - rc = s_out->rc; - free(s_out); return rc; } @@ -10033,6 +10034,7 @@ while (1) { s_out = screen_driver(&n_change_disk_config, header_lines, i_con); rc = s_out->rc; + free(s_out); found = 0; @@ -10078,7 +10080,6 @@ n_change_disk_config.body = NULL; free_i_con(i_con); i_con_head = i_con_head_saved; - free(s_out); return rc; } @@ -10277,6 +10278,7 @@ while (1) { s_out = screen_driver(&n_change_ioa_config, header_lines, i_con); rc = s_out->rc; + free(s_out); found = 0; for_each_icon(temp_i_con) { @@ -10333,7 +10335,6 @@ n_change_ioa_config.body = NULL; free_i_con(i_con); i_con_head = i_con_head_saved; - free(s_out); return rc; } @@ -10385,8 +10386,10 @@ do { n_ioa_config.body = buffer[toggle&1]; s_out = screen_driver(&n_ioa_config, header_lines, i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -10394,8 +10397,6 @@ } n_ioa_config.body = NULL; - rc = s_out->rc; - free(s_out); return rc; } @@ -10466,8 +10467,10 @@ do { n_download_ucode.body = buffer[toggle&1]; s_out = screen_driver(&n_download_ucode,header_lines,i_con); + rc = s_out->rc; + free(s_out); toggle++; - } while (s_out->rc == TOGGLE_SCREEN); + } while (rc == TOGGLE_SCREEN); for (k = 0; k < 2; k++) { free(buffer[k]); @@ -10475,8 +10478,6 @@ } n_download_ucode.body = NULL; - rc = s_out->rc; - free(s_out); return rc; } @@ -10635,6 +10636,7 @@ n_choose_ucode.body = body; s_out = screen_driver(&n_choose_ucode, header_lines, i_con); + free(s_out); free(n_choose_ucode.body); n_choose_ucode.body = NULL; @@ -10681,11 +10683,12 @@ if (!s_out->rc) rc = update_ucode(dev, fw_image); + free(s_out); + leave: free(list); i_con = free_i_con(i_con); i_con_head = i_con_head_saved; - free(s_out); return rc; } @@ -12194,9 +12197,10 @@ hdd_count++; } - if (hdd_count > 0 && ssd_count > 0) + if (hdd_count > 0 && ssd_count > 0) { syslog(LOG_ERR, _("SSDs and HDDs can not be mixed in an array.\n")); return -EINVAL; + } if (!ioa) { syslog(LOG_ERR, _("No valid devices specified.\n")); |
From: Wayne B. <wb...@us...> - 2009-08-14 17:36:42
|
Update of /cvsroot/iprdd/iprutils/spec In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15043/iprutils/spec Modified Files: iprutils.spec Log Message: memory leak fixes and raid create fix Index: iprutils.spec =================================================================== RCS file: /cvsroot/iprdd/iprutils/spec/iprutils.spec,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- iprutils.spec 30 Jun 2009 23:32:40 -0000 1.96 +++ iprutils.spec 14 Aug 2009 17:36:32 -0000 1.97 @@ -1,6 +1,6 @@ Summary: Utilities for the IBM Power Linux RAID adapters Name: iprutils -Version: 2.2.15 +Version: 2.2.16 Release: 1 License: CPL Group: System Environment/Base @@ -81,6 +81,11 @@ %{_sysconfdir}/ha.d/resource.d/iprha %changelog +* Fri Aug 14 2009 Wayne Boyer <wa...@li...> 2.2.16 +- Release 2.2.16 +- Fixes a bug where CLI raid create is broken. +- Fixes several potential memory leak problems. +- Adds man page entries for the disable cache query and command. * Tue Jun 30 2009 Wayne Boyer <wa...@li...> 2.2.15 - Release 2.2.15 - Fixes a bug where cache reclaim can time out too soon. |
From: Wayne B. <wb...@us...> - 2009-06-30 23:32:50
|
Update of /cvsroot/iprdd/iprutils In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv18452/iprutils Modified Files: iprconfig.c iprlib.c iprlib.h version.mk Log Message: fixes for disable IOA caching and fix for IOA cache reclaim timeout problem Index: version.mk =================================================================== RCS file: /cvsroot/iprdd/iprutils/version.mk,v retrieving revision 1.73 retrieving revision 1.74 diff -u -d -r1.73 -r1.74 --- version.mk 9 Apr 2009 00:25:11 -0000 1.73 +++ version.mk 30 Jun 2009 23:32:40 -0000 1.74 @@ -6,9 +6,9 @@ IPR_MAJOR_RELEASE=2 IPR_MINOR_RELEASE=2 -IPR_FIX_LEVEL=14 +IPR_FIX_LEVEL=15 IPR_RELEASE=1 -IPR_FIX_DATE=(April 07, 2009) +IPR_FIX_DATE=(June 30, 2009) IPR_VERSION_STR=$(IPR_MAJOR_RELEASE).$(IPR_MINOR_RELEASE).$(IPR_FIX_LEVEL) $(IPR_FIX_DATE) Index: iprlib.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.c,v retrieving revision 1.123 retrieving revision 1.124 diff -u -d -r1.123 -r1.124 --- iprlib.c 9 Apr 2009 00:25:11 -0000 1.123 +++ iprlib.c 30 Jun 2009 23:32:40 -0000 1.124 @@ -3022,7 +3022,7 @@ int fd; u8 cdb[IPR_CCB_CDB_LEN]; struct sense_data_t sense_data; - int rc; + int timeout, rc; int length = sizeof(struct ipr_reclaim_query_data); if (strlen(file) == 0) @@ -3042,9 +3042,14 @@ cdb[7] = (length & 0xff00) >> 8; cdb[8] = length & 0xff; + if ((action & IPR_RECLAIM_ACTION) == IPR_RECLAIM_PERFORM) + timeout = IPR_CACHE_RECLAIM_TIMEOUT; + else + timeout = IPR_INTERNAL_DEV_TIMEOUT; + rc = sg_ioctl(fd, cdb, buff, length, SG_DXFER_FROM_DEV, - &sense_data, IPR_INTERNAL_DEV_TIMEOUT); + &sense_data, timeout); if (rc != 0) { if (sense_data.sense_key != ILLEGAL_REQUEST) @@ -6100,17 +6105,17 @@ { int rc; int found = 0; - struct ipr_query_ioa_caching_info *info; + struct ipr_query_ioa_caching_info info; struct ipr_global_cache_params_term *term; + int term_size = sizeof(struct ipr_query_ioa_caching_info); - info = malloc(IPR_CACHE_QUERY_SIZE); - memset(info, 0, IPR_CACHE_QUERY_SIZE); + memset(&info, 0, term_size); - rc = ipr_query_cache_parameters(ioa, info, IPR_CACHE_QUERY_SIZE); + rc = ipr_query_cache_parameters(ioa, &info, term_size); if (rc) return IPR_IOA_REQUESTED_CACHING_DEFAULT; - for_each_cache_term(info, term) + for_each_cache_term(term, &info) if (term && term->term_id == IPR_CACHE_PARAM_TERM_ID) { found = 1; break; Index: iprlib.h =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.h,v retrieving revision 1.106 retrieving revision 1.107 diff -u -d -r1.106 -r1.107 --- iprlib.h 9 Apr 2009 00:25:11 -0000 1.106 +++ iprlib.h 30 Jun 2009 23:32:40 -0000 1.107 @@ -97,6 +97,7 @@ #define IPR_SUSPEND_DEV_BUS_TIMEOUT (35) /* 35 seconds */ #define IPR_EVALUATE_DEVICE_TIMEOUT (2 * 60) /* 2 minutes */ #define IPR_WRITE_BUFFER_TIMEOUT (8 * 60) /* 8 minutes */ +#define IPR_CACHE_RECLAIM_TIMEOUT (10 * 60) /* 10 minutes */ #define SET_DASD_TIMEOUTS_TIMEOUT (2 * 60) #define IPR_NUM_DRIVE_ELEM_STATUS_ENTRIES 50 #define IPR_DRIVE_ELEM_STATUS_EMPTY 5 @@ -1797,9 +1798,6 @@ struct ipr_sas_expander_info exp[1]; }; -/* define space for the header and 512 term ID records */ -#define IPR_CACHE_QUERY_SIZE 2049 - struct ipr_global_cache_params_term { #define IPR_CACHE_PARAM_TERM_ID 0x10 u8 term_id; @@ -1816,18 +1814,19 @@ u8 reserved2; }; -#define for_each_cache_term(info, term) \ - for (term = (info)->term; \ - ((unsigned long)term) < ((unsigned long)((unsigned long)(info) + ntohs((info)->len))) && \ - ((unsigned long)term) < ((unsigned long)((unsigned long)((info)->term + sizeof((info)->term)))); \ - term = term + term->len) - struct ipr_query_ioa_caching_info { u16 len; u8 reserved[2]; - struct ipr_global_cache_params_term term[1]; +#define IPR_MAX_TERMS 512 + struct ipr_global_cache_params_term term[IPR_MAX_TERMS]; }; +#define for_each_cache_term(term, info) \ + for (term = (info)->term; \ + ((unsigned long)term) < ((unsigned long)((unsigned long)(info) + ntohs((info)->len)) + 2) && \ + ((unsigned long)term + term->len + 2 - (unsigned long)(info)->term) < sizeof((info)->term); \ + term = (struct ipr_global_cache_params_term *)(((unsigned long)term) + term->len + 2)) + struct ipr_log_page18 { u8 page_code; u8 reserved; Index: iprconfig.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprconfig.c,v retrieving revision 1.138 retrieving revision 1.139 diff -u -d -r1.138 -r1.139 --- iprconfig.c 9 Apr 2009 00:25:11 -0000 1.138 +++ iprconfig.c 30 Jun 2009 23:32:40 -0000 1.139 @@ -15493,7 +15493,7 @@ fprintf(stderr, "Cannot find %s\n", args[0]); return -EINVAL; } - if (dev != &dev->ioa->ioa || dev->ioa->is_aux_cache) { + if (dev != &dev->ioa->ioa) { fprintf(stderr, "%s is not an IOA.\n", args[0]); return -EINVAL; } @@ -15530,10 +15530,13 @@ fprintf(stderr, "Cannot find %s\n", args[0]); return -EINVAL; } - if (dev != &dev->ioa->ioa || dev->ioa->is_aux_cache) { + if (dev != &dev->ioa->ioa) { fprintf(stderr, "%s is not an IOA.\n", args[0]); return -EINVAL; } + if (dev->ioa->is_aux_cache) { + return -EINVAL; + } if (!dev->ioa->has_cache) { fprintf(stderr, "%s does not have cache.\n", args[0]); return -EINVAL; |
From: Wayne B. <wb...@us...> - 2009-06-30 23:32:43
|
Update of /cvsroot/iprdd/iprutils/spec In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv18452/iprutils/spec Modified Files: iprutils.spec Log Message: fixes for disable IOA caching and fix for IOA cache reclaim timeout problem Index: iprutils.spec =================================================================== RCS file: /cvsroot/iprdd/iprutils/spec/iprutils.spec,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- iprutils.spec 9 Apr 2009 00:25:11 -0000 1.95 +++ iprutils.spec 30 Jun 2009 23:32:40 -0000 1.96 @@ -1,6 +1,6 @@ Summary: Utilities for the IBM Power Linux RAID adapters Name: iprutils -Version: 2.2.14 +Version: 2.2.15 Release: 1 License: CPL Group: System Environment/Base @@ -81,6 +81,10 @@ %{_sysconfdir}/ha.d/resource.d/iprha %changelog +* Tue Jun 30 2009 Wayne Boyer <wa...@li...> 2.2.15 +- Release 2.2.15 +- Fixes a bug where cache reclaim can time out too soon. +- Fixes some problems with the disable caching support. * Tue Apr 07 2009 Wayne Boyer <wa...@li...> 2.2.14 - Release 2.2.14 - Add support for disabling IOA caching. |
From: Wayne B. <wb...@us...> - 2009-04-09 00:25:23
|
Update of /cvsroot/iprdd/iprutils In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv26808/iprutils Modified Files: Makefile iprconfig.c iprconfig.h iprlib.c iprlib.h version.mk Log Message: Adds support for SSDs and disabling IOA cache. Index: iprlib.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.c,v retrieving revision 1.122 retrieving revision 1.123 diff -u -d -r1.122 -r1.123 --- iprlib.c 20 Nov 2008 01:20:20 -0000 1.122 +++ iprlib.c 9 Apr 2009 00:25:11 -0000 1.123 @@ -3562,6 +3562,92 @@ } /** + * ipr_change_cache_parameters + * @ioa: ipr ioa struct + * @mode: caching mode to set + * + * Returns: + * 0 if success / non-zero on failure + **/ +int ipr_change_cache_parameters(struct ipr_ioa *ioa, int mode) +{ + char *name = ioa->ioa.gen_name; + struct sense_data_t sense_data; + u8 cdb[IPR_CCB_CDB_LEN]; + int fd, rc; + + if (strlen(name) == 0) + return -ENOENT; + + fd = open(name, O_RDWR); + if (fd <= 1) { + if (!strcmp(tool_name, "iprconfig") || ipr_debug) + syslog(LOG_ERR, "Could not open %s. %m\n", name); + return errno; + } + + memset(cdb, 0, IPR_CCB_CDB_LEN); + + cdb[0] = IPR_IOA_SERVICE_ACTION; + cdb[1] = IPR_CHANGE_CACHE_PARAMETERS; + cdb[2] = mode; + + rc = sg_ioctl(fd, cdb, NULL, 0, SG_DXFER_NONE, + &sense_data, IPR_INTERNAL_DEV_TIMEOUT); + + if (rc != 0 && (sense_data.sense_key != ILLEGAL_REQUEST || ipr_debug)) + ioa_cmd_err(ioa, &sense_data, "change cache params failed", rc); + + close(fd); + return rc; +} + +/** + * ipr_query_cache_parameters - + * @ioa: ipr ioa struct + * @buf: buffer for returned cache data + * @len: length of buffer + * + * Returns: + * 0 if success / non-zero on failure + **/ +int ipr_query_cache_parameters(struct ipr_ioa *ioa, void *buf, int len) +{ + char *name = ioa->ioa.gen_name; + struct sense_data_t sense_data; + u8 cdb[IPR_CCB_CDB_LEN]; + int fd, rc; + + if (strlen(name) == 0) + return -ENOENT; + + fd = open(name, O_RDWR); + if (fd <= 1) { + if (!strcmp(tool_name, "iprconfig") || ipr_debug) + syslog(LOG_ERR, "Could not open %s. %m\n", name); + return errno; + } + + memset(cdb, 0, IPR_CCB_CDB_LEN); + + cdb[0] = IPR_IOA_SERVICE_ACTION; + cdb[1] = IPR_QUERY_CACHE_PARAMETERS; + cdb[10] = len >> 24; + cdb[11] = len >> 16 & 0xff; + cdb[12] = len >> 8 & 0xff; + cdb[13] = len & 0xff; + + rc = sg_ioctl(fd, cdb, buf, len, SG_DXFER_FROM_DEV, + &sense_data, IPR_INTERNAL_DEV_TIMEOUT); + + if (rc != 0 && (sense_data.sense_key != ILLEGAL_REQUEST || ipr_debug)) + ioa_cmd_err(ioa, &sense_data, "Query Cache Parameters", rc); + + close(fd); + return rc; +} + +/** * ipr_query_res_redundancy_info - * @dev: ipr dev struct * @info: ipr_res_redundancy_info struct @@ -4706,8 +4792,8 @@ &scsi_dev_data->id, &scsi_dev_data->lun); - sprintf(scsi_dev_data->sysfs_device_name, - sysfs_device_device->name); + strcpy(scsi_dev_data->sysfs_device_name, + sysfs_device_device->name); sysfs_attr = sysfs_get_device_attr(sysfs_device_device, "type"); if (sysfs_attr) @@ -5031,6 +5117,7 @@ /** * get_ioa_cap - get the capability information for the ioa (inquiry page D0) + * Also, if page 01 is supported, then there is cache on the card. * @ioa: ipr ioa struct * * Returns: @@ -5055,6 +5142,10 @@ } for (j = 0; j < page0_inq.page_length; j++) { + if (page0_inq.supported_page_codes[j] == 0x01) { + ioa->has_cache = 1; + continue; + } if (page0_inq.supported_page_codes[j] != 0xD0) continue; rc = ipr_inquiry(&ioa->ioa, 0xD0, &ioa_cap, sizeof(ioa_cap)); @@ -5999,6 +6090,39 @@ } /** + * get_ioa_caching - + * @ioa: ipr ioa struct + * + * Returns: + * 0 + **/ +int get_ioa_caching(struct ipr_ioa *ioa) +{ + int rc; + int found = 0; + struct ipr_query_ioa_caching_info *info; + struct ipr_global_cache_params_term *term; + + info = malloc(IPR_CACHE_QUERY_SIZE); + memset(info, 0, IPR_CACHE_QUERY_SIZE); + + rc = ipr_query_cache_parameters(ioa, info, IPR_CACHE_QUERY_SIZE); + if (rc) + return IPR_IOA_REQUESTED_CACHING_DEFAULT; + + for_each_cache_term(info, term) + if (term && term->term_id == IPR_CACHE_PARAM_TERM_ID) { + found = 1; + break; + } + + if (found == 1 && term->disable_caching_requested == IPR_IOA_REQUESTED_CACHING_DISABLED) + return IPR_IOA_REQUESTED_CACHING_DISABLED; + else + return IPR_IOA_REQUESTED_CACHING_DEFAULT; +} + +/** * ipr_get_ioa_attr - * @ioa: ipr ioa struct * @attr: ipr_ioa_attr struct @@ -6013,6 +6137,7 @@ attr->preferred_primary = 0; attr->gscsi_only_ha = ioa->in_gscsi_only_ha; attr->active_active = ioa->asymmetric_access_enabled; + attr->caching = get_ioa_caching(ioa); if (!ioa->dual_raid_support) return 0; @@ -6143,6 +6268,7 @@ { struct ipr_ioa_attr old_attr; char temp[100]; + int mode; if (ipr_get_ioa_attr(ioa, &old_attr)) return -EIO; @@ -6187,6 +6313,14 @@ } } + if (attr->caching != old_attr.caching) { + if (attr->caching == IPR_IOA_REQUESTED_CACHING_DEFAULT) + mode = IPR_IOA_SET_CACHING_DEFAULT; + else + mode = IPR_IOA_SET_CACHING_DISABLED; + ipr_change_cache_parameters(ioa, mode); + } + get_dual_ioa_state(ioa); /* for preferred_primary */ get_subsys_config(ioa); /* for gscsi_only_ha */ return 0; @@ -6977,7 +7111,7 @@ const struct ioa_parms *ioa_parms = get_ioa_fw(ioa); if (ioa_parms) - sprintf(buf, ioa_parms->fw_name); + strcpy(buf, ioa_parms->fw_name); else sprintf(buf, "534953%02X", get_ioa_image_type(ioa)); } @@ -7348,6 +7482,8 @@ char *tmp; char ucode_file[200]; DIR *dir; + char *img_file; + char cwd[200]; fw_version = get_ioa_fw_version(ioa); @@ -7384,8 +7520,23 @@ ioa_info(ioa, "Updating adapter microcode from %08X to %08X.\n", fw_version, ntohl(image_hdr->rev_level)); - tmp = strrchr(image->file, '/'); - tmp++; + /* Give the file name an absolute path if needed. */ + if (image->file[0] != '/') { + getcwd(cwd, sizeof(cwd)); + strcat(cwd, "/"); + img_file = strcat(cwd, image->file); + } else + img_file = image->file; + + tmp = strrchr(img_file, '/'); + if (tmp) + tmp++; + else { + syslog(LOG_ERR, "Failed to find image name in %s\n", + img_file); + return -EIO; + } + dir = opendir(hotplug_dir); if (!dir) mkdir(hotplug_dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); @@ -7399,7 +7550,7 @@ } closedir(dir); sprintf(ucode_file, "%s/.%s", hotplug_dir, tmp); - symlink(image->file, ucode_file); + symlink(img_file, ucode_file); sprintf(ucode_file, ".%s\n", tmp); class_device = sysfs_open_class_device("scsi_host", ioa->host_name); attr = sysfs_get_classdev_attr(class_device, "update_fw"); Index: iprconfig.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprconfig.c,v retrieving revision 1.137 retrieving revision 1.138 diff -u -d -r1.137 -r1.138 --- iprconfig.c 20 Nov 2008 01:20:20 -0000 1.137 +++ iprconfig.c 9 Apr 2009 00:25:11 -0000 1.138 @@ -2022,6 +2022,13 @@ body = add_line_to_body(body,_("Current Asymmetric Access State"), _("Disabled")); } + if (dev->ioa->has_cache) { + if (get_ioa_caching(dev->ioa) == IPR_IOA_REQUESTED_CACHING_DISABLED) + body = add_line_to_body(body,_("Current Requested Caching Mode"), _("Disabled")); + else + body = add_line_to_body(body,_("Current Requested Caching Mode"), _("Default")); + } + return body; } @@ -3652,10 +3659,18 @@ not_done = 1; } else if (status_record->status != IPR_CMD_STATUS_SUCCESSFUL) { done_bad = 1; - syslog(LOG_ERR, _("Start parity protect to %s failed. " - "Check device configuration for proper format.\n"), - ioa->ioa.gen_name); - rc = RC_FAILED; + if (status_record->status == IPR_CMD_STATUS_MIXED_BLK_DEV_CLASESS) { + syslog(LOG_ERR, _("Start parity protect to %s failed. " + "SSDs and HDDs can not be mixed in an array.\n"), + ioa->ioa.gen_name); + rc = RC_22_Mixed_Block_Dev_Classes; + } else { + + syslog(LOG_ERR, _("Start parity protect to %s failed. " + "Check device configuration for proper format.\n"), + ioa->ioa.gen_name); + rc = RC_FAILED; + } } else if (!(device_available)) { wait_device++; @@ -3673,9 +3688,12 @@ if (!not_done) { flush_stdscr(); - if (done_bad) + if (done_bad) { + if (status_record->status == IPR_CMD_STATUS_MIXED_BLK_DEV_CLASESS) + return RC_22_Mixed_Block_Dev_Classes; /* Start Parity Protection failed. */ return RC_19_Create_Fail; + } check_current_config(false); @@ -5535,8 +5553,7 @@ if ((rc = s_out->rc) > 0) goto leave; - /* first, count devices select to be sure min multiple - is satisfied */ + /* first, count devices selected to be sure min multiple is satisfied */ found = 0; for_each_icon(temp_i_con) { @@ -5546,9 +5563,9 @@ } if (found % min_mult_array_devices != 0) { - /* "Error: number of devices selected must be a multiple of %d" */ + /* "Error: number of devices selected must be a multiple of %d" */ s_status.num = min_mult_array_devices; - return 25 | REFRESH_FLAG; + return 25 | REFRESH_FLAG; } for_each_icon(temp_i_con) { @@ -5897,7 +5914,7 @@ not_done = 1; } else if (status_record->status != IPR_CMD_STATUS_SUCCESSFUL) /* "Include failed" */ - rc = 26; + rc = RC_26_Include_Fail; break; } } @@ -5920,11 +5937,11 @@ if (done_bad) /* "Include failed" */ - return 26 | EXIT_FLAG; + return RC_26_Include_Fail | EXIT_FLAG; /* "Include Unit completed successfully" */ complete_screen_driver(&n_dev_include_complete, percent_cmplt,1); - return 27 | EXIT_FLAG; + return RC_27_Include_Success | EXIT_FLAG; } not_done = 0; sleep(1); @@ -8220,7 +8237,7 @@ { char *body = get_reclaim_results(buf); - printf(body); + printf("%s", body); free(body); } @@ -10070,6 +10087,7 @@ int preferred_primary; int gscsi_only_ha; int active_active; + int caching; }; /** @@ -10098,8 +10116,8 @@ start_row += 2; /* for title */ /* FIXME */ if (ioa_config_attr->option == 1 || ioa_config_attr->option == 2 - || ioa_config_attr->option == 3) { - num_menu_items = 3; + || ioa_config_attr->option == 3 || ioa_config_attr->option == 4) { + num_menu_items = 4; menu_item = malloc(sizeof(ITEM **) * (num_menu_items + 1)); userptr = malloc(sizeof(int) * num_menu_items); @@ -10108,8 +10126,10 @@ menu_item[menu_index] = new_item("None",""); else if (ioa_config_attr->option == 2) menu_item[menu_index] = new_item("RAID",""); - else + else if (ioa_config_attr->option == 3) menu_item[menu_index] = new_item("Disabled",""); + else + menu_item[menu_index] = new_item("Default",""); userptr[menu_index] = 0; set_item_userptr(menu_item[menu_index], @@ -10121,8 +10141,10 @@ menu_item[menu_index] = new_item("Primary",""); else if (ioa_config_attr->option == 2) menu_item[menu_index] = new_item("JBOD",""); - else + else if (ioa_config_attr->option == 3) menu_item[menu_index] = new_item("Enabled",""); + else + menu_item[menu_index] = new_item("Disabled",""); userptr[menu_index] = 1; set_item_userptr(menu_item[menu_index], @@ -10136,8 +10158,10 @@ ioa_config_attr->preferred_primary = *retptr; else if (ioa_config_attr->option == 2) ioa_config_attr->gscsi_only_ha = *retptr; - else + else if (ioa_config_attr->option == 3) ioa_config_attr->active_active = *retptr; + else + ioa_config_attr->caching = *retptr; } i = 0; @@ -10237,6 +10261,17 @@ sprintf(pref_str, "Disabled"); i_con = add_i_con(i_con, pref_str, &ioa_config_attr[index++]); } + if (dev->ioa->has_cache) { + body = add_line_to_body(body,_("IOA Caching Mode"), "%13"); + ioa_config_attr[index].option = 4; + ioa_config_attr[index].caching = ioa_attr.caching; + if (ioa_attr.caching == IPR_IOA_REQUESTED_CACHING_DEFAULT) + sprintf(pref_str, "Default"); + else + sprintf(pref_str, "Disabled"); + i_con = add_i_con(i_con, pref_str, &ioa_config_attr[index++]); + } + n_change_ioa_config.body = body; while (1) { @@ -10270,6 +10305,12 @@ else sprintf(temp_i_con->field_data, "Disabled"); ioa_attr.active_active = config_attr->active_active; + } else if (config_attr->option == 4) { + if (config_attr->caching == IPR_IOA_REQUESTED_CACHING_DEFAULT) + sprintf(temp_i_con->field_data, "Default"); + else + sprintf(temp_i_con->field_data, "Disabled"); + ioa_attr.caching = config_attr->caching; } found++; break; @@ -11781,22 +11822,40 @@ vendor_id, product_id); } else { if (ipr_is_hot_spare(dev)) - len += sprintf(body + len, "%-25s ", "Hot Spare"); + if (dev->dev_rcd->block_dev_class == IPR_SSD) + len += sprintf(body + len, "%-25s ", "SSD Hot Spare"); + else + len += sprintf(body + len, "%-25s ", "Hot Spare"); else if (ipr_is_volume_set(dev)) { - sprintf(buf, "RAID %s Disk Array", - dev->prot_level_str); + if (dev->dev_rcd->block_dev_class == IPR_SSD) + sprintf(buf, "RAID %s SSD Disk Array", + dev->prot_level_str); + else + sprintf(buf, "RAID %s Disk Array", + dev->prot_level_str); len += sprintf(body + len, "%-25s ", buf); } else if (ipr_is_array_member(dev)) { if (indent) - sprintf(raid_str," RAID %s Array Member", - dev->prot_level_str); + if (dev->dev_rcd->block_dev_class == IPR_SSD) + sprintf(raid_str," RAID %s SSD Member", + dev->prot_level_str); + else + sprintf(raid_str," RAID %s Array Member", + dev->prot_level_str); else - sprintf(raid_str,"RAID %s Array Member", - dev->prot_level_str); + if (dev->dev_rcd->block_dev_class == IPR_SSD) + sprintf(raid_str,"RAID %s SSD Member", + dev->prot_level_str); + else + sprintf(raid_str,"RAID %s Array Member", + dev->prot_level_str); len += sprintf(body + len, "%-25s ", raid_str); } else if (ipr_is_af_dasd_device(dev)) - len += sprintf(body + len, "%-25s ", "Advanced Function Disk"); + if (dev->dev_rcd->block_dev_class == IPR_SSD) + len += sprintf(body + len, "%-25s ", "Advanced Function SSD"); + else + len += sprintf(body + len, "%-25s ", "Advanced Function Disk"); else if (scsi_dev_data && scsi_dev_data->type == TYPE_ENCLOSURE) len += sprintf(body + len, "%-25s ", "Enclosure"); else if (scsi_dev_data && scsi_dev_data->type == TYPE_PROCESSOR) @@ -12077,6 +12136,7 @@ static int raid_create(char **args, int num_args) { int i, num_devs = 0, rc; + int hdd_count = 0, ssd_count = 0; int next_raid_level, next_stripe_size, next_qdepth; char *raid_level = IPR_DEFAULT_RAID_LVL; int stripe_size, qdepth; @@ -12127,8 +12187,17 @@ syslog(LOG_ERR, _("All devices must be attached to the same adapter.\n")); return -EINVAL; } + + if (dev->dev_rcd->block_dev_class == IPR_SSD) + ssd_count++; + else + hdd_count++; } + if (hdd_count > 0 && ssd_count > 0) + syslog(LOG_ERR, _("SSDs and HDDs can not be mixed in an array.\n")); + return -EINVAL; + if (!ioa) { syslog(LOG_ERR, _("No valid devices specified.\n")); return -EINVAL; @@ -12253,6 +12322,7 @@ int i, rc, zeroed = 0; struct ipr_dev *dev, *vset = NULL; struct ipr_ioa *ioa; + struct devs_to_init_t *dev_init; for (i = 0; i < num_args; i++) { if (!strcmp(args[i], "-z")) @@ -12269,8 +12339,8 @@ if (ipr_is_volume_set(dev)) { if (vset) { - fprintf(stderr, "Invalid parameters. Only one disk array can " - "specified at once\n"); + fprintf(stderr, "Invalid parameters. Only one " + "disk array can be specified at a time.\n"); return -EINVAL; } @@ -12280,8 +12350,8 @@ } if (!ipr_is_af_dasd_device(dev)) { - fprintf(stderr, "Invalid device specified. Device must be formatted " - "to Advanced Function Format\n"); + fprintf(stderr, "Invalid device specified. Device must " + "be formatted to Advanced Function Format.\n"); return -EINVAL; } @@ -12298,10 +12368,16 @@ } if (!vset) { - fprintf(stderr, "Invalid parameters. A disk array must be specified\n"); + fprintf(stderr, "Invalid parameters. A disk array must be specified.\n"); return -EINVAL; } + for_each_dev_to_init(dev_init) + if (vset->array_rcd->block_dev_class != dev_init->dev->dev_rcd->block_dev_class) { + fprintf(stderr, "Invalid parameter. Can not mix SSDs and HDDs.\n"); + return -EINVAL; + } + if (!zeroed) { rc = send_dev_inits(NULL); free_devs_to_init(); @@ -13470,7 +13546,7 @@ } /** - * ipr_start_array_protection - Start array protection for an array + * __reclaim - Reclaim the specified IOA's write cache. * @args: argument vector * @num_args: number of arguments * @action: @@ -13509,7 +13585,7 @@ } /** - * reclaim - + * reclaim - Reclaim the specified IOA's write cache. * @args: argument vector * @num_args: number of arguments * @@ -13522,7 +13598,8 @@ } /** - * reclaim_unknown - + * reclaim_unknown - Reclaim the specified IOA's write cache and allow + * unknown data loss. * @args: argument vector * @num_args: number of arguments * @@ -14631,8 +14708,9 @@ } if (cap->format_overlay_type == IPR_FORMAT_REMOVE_DEVICES) - fprintf(stderr, "%d devices will be removed from the array\n", - cap->min_num_array_devices); + fprintf(stderr, "%d %s will be removed from the array\n", + cap->min_num_array_devices, + cap->min_num_array_devices == 1 ? "device" : "devices"); else if (cap->format_overlay_type == IPR_FORMAT_ADD_DEVICES) { fprintf(stderr, "Minimum number of devices required = %d\n", cap->min_num_array_devices); @@ -15396,6 +15474,86 @@ return ipr_set_array_asym_access(vset->ioa); } +/** + * query_ioa_caching - Show whether or not user requested caching mode is set + * to default or disabled. + * @args: argument vector + * @num_args: number of arguments + * + * Returns: + * 0 if success / non-zero on failure + **/ +static int query_ioa_caching(char **args, int num_args) +{ + int mode; + struct ipr_dev *dev; + + dev = find_dev(args[0]); + if (!dev) { + fprintf(stderr, "Cannot find %s\n", args[0]); + return -EINVAL; + } + if (dev != &dev->ioa->ioa || dev->ioa->is_aux_cache) { + fprintf(stderr, "%s is not an IOA.\n", args[0]); + return -EINVAL; + } + if (!dev->ioa->has_cache) { + printf("none\n"); + return 0; + } + + mode = get_ioa_caching(dev->ioa); + + if (mode == IPR_IOA_REQUESTED_CACHING_DISABLED) + printf("disabled\n"); + else + printf("default\n"); + + return 0; +} + +/** + * set_ioa_caching - Set the requested IOA caching mode to default or disabled. + * @args: argument vector + * @num_args: number of arguments + * + * Returns: + * 0 if success / non-zero on failure + **/ +static int set_ioa_caching(char **args, int num_args) +{ + int mode, rc; + struct ipr_dev *dev; + + dev = find_dev(args[0]); + if (!dev) { + fprintf(stderr, "Cannot find %s\n", args[0]); + return -EINVAL; + } + if (dev != &dev->ioa->ioa || dev->ioa->is_aux_cache) { + fprintf(stderr, "%s is not an IOA.\n", args[0]); + return -EINVAL; + } + if (!dev->ioa->has_cache) { + fprintf(stderr, "%s does not have cache.\n", args[0]); + return -EINVAL; + } + + /* Default or Disabled? */ + if (!strncasecmp(args[1], "Default", 3)) + mode = IPR_IOA_SET_CACHING_DEFAULT; + else if (!strncasecmp(args[1], "Disabled", 3)) + mode = IPR_IOA_SET_CACHING_DISABLED; + else { + scsi_err(dev, "Unrecognized mode given for IOA caching."); + return -EINVAL; + } + + rc = ipr_change_cache_parameters(dev->ioa , mode); + + return rc; +} + static const struct { char *cmd; int min_args; @@ -15456,6 +15614,8 @@ { "query-recommended-stripe-size", 2, 0, 2, query_recommended_stripe_size, "sg5 5" }, { "query-path-status", 0, 0, 1, query_path_status, "sg5" }, { "query-path-details", 1, 0, 1, query_path_details, "sda" }, + { "query-ioa-caching", 1, 0, 1, query_ioa_caching, "sg5" }, + { "set-ioa-caching", 2, 0, 2, set_ioa_caching, "sg5 [Default | Disabled]" }, { "primary", 1, 0, 1, set_primary, "sg5" }, { "secondary", 1, 0, 1, set_secondary, "sg5" }, { "set-all-primary", 0, 0, 0, set_all_primary, "" }, Index: iprconfig.h =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprconfig.h,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- iprconfig.h 20 Nov 2008 01:20:20 -0000 1.52 +++ iprconfig.h 9 Apr 2009 00:25:11 -0000 1.53 @@ -983,7 +983,7 @@ __("ATTENTION!!! ATTENTION!!! ATTENTION!!! ATTENTION!!!\n"), __("ATTENTION: Proceed with this function only if directed to from a " "service procedure. Data in the IOA cache will be discarded. " - "This data loss may or may not be detected by the host operating." + "This data loss may or may not be detected by the host operating " "system. Filesystem corruption may result on the system.\n\n"), __("Press 's' to continue.\n\n"), "" } @@ -1018,7 +1018,7 @@ __("There are no disks eligible for the selected operation " "due to one or more of the following reasons:\n\n"), __("o There are no disks that need to be rebuilt.\n"), - __("o The disk that needs to be rebuild is not at the right " + __("o The disk that needs to be rebuilt is not at the right " "location. Examine the 'message log' for the exposed unit " "and make sure that the replacement unit is at the correct " "location.\n"), @@ -1518,7 +1518,7 @@ /* 19 */ __("Create disk array failed."), /* 20 */ __("Delete disk array failed."), /* 21 */ __("Disk array successfully deleted."), - /* 22 */ "", + /* 22 */ __("Create disk array failed - can not mix SSDs and HDDs."), /* 23 */ "", /* 24 */ "", /* 25 */ __("Error: number of devices selected must be a multiple of %d"), @@ -1605,12 +1605,12 @@ RC_19_Create_Fail, RC_20_Delete_Fail, RC_21_Delete_Success, - RC_22_Blank, + RC_22_Mixed_Block_Dev_Classes, RC_23_Blank, RC_24_Blank, RC_25_Devices_Multiple, - RC_26_Add_Fail, - RC_27_Add_Success, + RC_26_Include_Fail, + RC_27_Include_Success, RC_28_Rebuild_Started, RC_29_Rebuild_Fail, RC_30_Maint_Fail, Index: iprlib.h =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.h,v retrieving revision 1.105 retrieving revision 1.106 diff -u -d -r1.105 -r1.106 --- iprlib.h 20 Nov 2008 01:20:20 -0000 1.105 +++ iprlib.h 9 Apr 2009 00:25:11 -0000 1.106 @@ -43,7 +43,6 @@ #include <stdbool.h> #include <netinet/in.h> #include <sysfs/libsysfs.h> -#include <linux/byteorder/swab.h> #include <asm/byteorder.h> #include <sys/mman.h> #include <paths.h> @@ -147,6 +146,8 @@ #define IPR_DISRUPT_DEVICE 0x11 #define IPR_QUERY_SAS_EXPANDER_INFO 0x12 #define IPR_QUERY_RES_REDUNDANCY_INFO 0x13 +#define IPR_CHANGE_CACHE_PARAMETERS 0x14 +#define IPR_QUERY_CACHE_PARAMETERS 0x16 #define IPR_EVALUATE_DEVICE 0xE4 #define SKIP_READ 0xE8 #define SKIP_WRITE 0xEA @@ -187,6 +188,14 @@ #define IPR_CLEAR_ASYMMETRIC_STATE 0x0 #define IPR_PRESERVE_ASYMMETRIC_STATE 0x80 +#define IPR_IOA_REQUESTED_CACHING_DEFAULT 0x0 +#define IPR_IOA_REQUESTED_CACHING_DISABLED 0x1 +#define IPR_IOA_SET_CACHING_DEFAULT 0x0 +#define IPR_IOA_SET_CACHING_DISABLED 0x10 + +#define IPR_HDD 0x0 +#define IPR_SSD 0x1 + #define IPR_IS_DASD_DEVICE(std_inq_data) \ ((((std_inq_data).peri_dev_type) == TYPE_DISK) && !((std_inq_data).removeable_medium)) @@ -686,7 +695,6 @@ u8 issue_cmd:1; #endif - //u8 reserved2; #if defined (__BIG_ENDIAN_BITFIELD) u8 saved_asym_access_state:4; u8 current_asym_access_state:4; @@ -734,7 +742,16 @@ u8 vendor_id[IPR_VENDOR_ID_LEN]; u8 product_id[IPR_PROD_ID_LEN]; u8 serial_number[8]; - u32 reserved; +#if defined (__BIG_ENDIAN_BITFIELD) + u8 block_dev_class:3; + u8 reserved5:5; +#elif defined (__LITTLE_ENDIAN_BITFIELD) + u8 reserved5:5; + u8 block_dev_class:3; +#endif + u8 reserved6; + u8 reserved7; + u8 reserved8; }; struct ipr_dev_record { @@ -805,7 +822,16 @@ u8 vendor_id[IPR_VENDOR_ID_LEN]; u8 product_id[IPR_PROD_ID_LEN]; u8 serial_num[IPR_SERIAL_NUM_LEN]; - u32 reserved5; +#if defined (__BIG_ENDIAN_BITFIELD) + u8 block_dev_class:3; + u8 reserved5:5; +#elif defined (__LITTLE_ENDIAN_BITFIELD) + u8 reserved5:5; + u8 block_dev_class:3; +#endif + u8 reserved6; + u8 reserved7; + u8 reserved8; }; #define __for_each_qac_entry(rcd, qac, type) \ @@ -1125,6 +1151,7 @@ int preferred_primary; int gscsi_only_ha; int active_active; + int caching; }; #define IPR_DEV_MAX_PATHS 2 @@ -1182,6 +1209,7 @@ u8 in_gscsi_only_ha:1; u8 asymmetric_access:1; u8 asymmetric_access_enabled:1; + u8 has_cache:1; enum ipr_tcq_mode tcq_mode; u16 pci_vendor; u16 pci_device; @@ -1459,6 +1487,7 @@ #define IPR_CMD_STATUS_ATTRIB_CHANGE 3 #define IPR_CMD_STATUS_FAILED 4 #define IPR_CMD_STATUS_INSUFF_DATA_MOVED 5 +#define IPR_CMD_STATUS_MIXED_BLK_DEV_CLASESS 6 u8 percent_complete; struct ipr_res_addr failing_dev_res_addr; @@ -1768,6 +1797,37 @@ struct ipr_sas_expander_info exp[1]; }; +/* define space for the header and 512 term ID records */ +#define IPR_CACHE_QUERY_SIZE 2049 + +struct ipr_global_cache_params_term { +#define IPR_CACHE_PARAM_TERM_ID 0x10 + u8 term_id; + u8 len; +#if defined (__BIG_ENDIAN_BITFIELD) + u8 disable_caching_dual_ioa_failure:1; + u8 disable_caching_requested:1; + u8 reserved1:6; +#elif defined (__LITTLE_ENDIAN_BITFIELD) + u8 reserved1:6; + u8 disable_caching_requested:1; + u8 disable_caching_dual_ioa_failure:1; +#endif + u8 reserved2; +}; + +#define for_each_cache_term(info, term) \ + for (term = (info)->term; \ + ((unsigned long)term) < ((unsigned long)((unsigned long)(info) + ntohs((info)->len))) && \ + ((unsigned long)term) < ((unsigned long)((unsigned long)((info)->term + sizeof((info)->term)))); \ + term = term + term->len) + +struct ipr_query_ioa_caching_info { + u16 len; + u8 reserved[2]; + struct ipr_global_cache_params_term term[1]; +}; + struct ipr_log_page18 { u8 page_code; u8 reserved; @@ -2055,6 +2115,7 @@ struct ipr_res_redundancy_info *); int ipr_query_sas_expander_info(struct ipr_ioa *, struct ipr_query_sas_expander_info *); +int ipr_query_cache_parameters(struct ipr_ioa *, void *, int); int ipr_disrupt_device(struct ipr_dev *); int ipr_inquiry(struct ipr_dev *, u8, void *, u8); int ipr_query_res_addr_aliases(struct ipr_ioa *, struct ipr_res_addr *, @@ -2080,7 +2141,8 @@ int ipr_modify_ioa_attr(struct ipr_ioa *, struct ipr_ioa_attr *); int ipr_set_dev_attr(struct ipr_dev *, struct ipr_disk_attr *, int); int set_active_active_mode(struct ipr_ioa *, int); - +int get_ioa_caching(struct ipr_ioa *); +int ipr_change_cache_parameters(struct ipr_ioa *, int); int ipr_query_dasd_timeouts(struct ipr_dev *, struct ipr_query_dasd_timeouts *); int get_ioa_firmware_image_list(struct ipr_ioa *, struct ipr_fw_images **); int get_dasd_firmware_image_list(struct ipr_dev *, struct ipr_fw_images **); Index: Makefile =================================================================== RCS file: /cvsroot/iprdd/iprutils/Makefile,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- Makefile 20 Nov 2008 01:20:20 -0000 1.27 +++ Makefile 9 Apr 2009 00:25:11 -0000 1.28 @@ -81,9 +81,7 @@ rpm: *.c *.h *.8 -make clean cd .. - cp -f spec/iprutils.spec . $(TAR) mv ../iprutils-$(UTILS_VER)-src.tgz . - rm -f iprutils.spec rpmbuild --nodeps -ts iprutils-$(UTILS_VER)-src.tgz - cp /home/$(USER)/rpm/SRPMS/iprutils-$(UTILS_VER)-$(IPR_RELEASE).src.rpm . + cp `rpm --eval '%{_srcrpmdir}'`/iprutils-$(UTILS_VER)-$(IPR_RELEASE).src.rpm . Index: version.mk =================================================================== RCS file: /cvsroot/iprdd/iprutils/version.mk,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- version.mk 20 Nov 2008 01:20:20 -0000 1.72 +++ version.mk 9 Apr 2009 00:25:11 -0000 1.73 @@ -1,4 +1,4 @@ -# (C) Copyright 2000, 2008 +# (C) Copyright 2000, 2009 # International Business Machines Corporation and others. # All Rights Reserved. This program and the accompanying # materials are made available under the terms of the @@ -6,9 +6,9 @@ IPR_MAJOR_RELEASE=2 IPR_MINOR_RELEASE=2 -IPR_FIX_LEVEL=13 +IPR_FIX_LEVEL=14 IPR_RELEASE=1 -IPR_FIX_DATE=(November 17, 2008) +IPR_FIX_DATE=(April 07, 2009) IPR_VERSION_STR=$(IPR_MAJOR_RELEASE).$(IPR_MINOR_RELEASE).$(IPR_FIX_LEVEL) $(IPR_FIX_DATE) |
From: Wayne B. <wb...@us...> - 2009-04-09 00:25:19
|
Update of /cvsroot/iprdd/iprutils/spec In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv26808/iprutils/spec Modified Files: iprutils.spec Log Message: Adds support for SSDs and disabling IOA cache. Index: iprutils.spec =================================================================== RCS file: /cvsroot/iprdd/iprutils/spec/iprutils.spec,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- iprutils.spec 20 Nov 2008 01:20:20 -0000 1.94 +++ iprutils.spec 9 Apr 2009 00:25:11 -0000 1.95 @@ -1,6 +1,6 @@ Summary: Utilities for the IBM Power Linux RAID adapters Name: iprutils -Version: 2.2.13 +Version: 2.2.14 Release: 1 License: CPL Group: System Environment/Base @@ -81,6 +81,13 @@ %{_sysconfdir}/ha.d/resource.d/iprha %changelog +* Tue Apr 07 2009 Wayne Boyer <wa...@li...> 2.2.14 +- Release 2.2.14 +- Add support for disabling IOA caching. +- Remove #include of <linux/byteorder/swab.h> as it is not used. +- Allow giving a relative path for a microcode image file when doing an upgrade + from the command line. +- Add support for SSD drives. * Mon Nov 17 2008 Wayne Boyer <wa...@li...> 2.2.13 - Release 2.2.13 - Additional fixes for the active-active functionality. |
Update of /cvsroot/iprdd/iprutils In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8442/iprutils Modified Files: Makefile iprconfig.c iprconfig.h iprdump.c iprinit.c iprlib.c iprlib.h iprupdate.c version.mk Log Message: A few more active/active updates and fixes, also support new kevent paths Index: iprlib.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.c,v retrieving revision 1.121 retrieving revision 1.122 diff -u -d -r1.121 -r1.122 --- iprlib.c 23 Oct 2008 17:11:20 -0000 1.121 +++ iprlib.c 20 Nov 2008 01:20:20 -0000 1.122 @@ -5087,6 +5087,8 @@ if (page24->dual_adapter_af == ENABLE_DUAL_IOA_ACTIVE_ACTIVE) { ioa->dual_raid_support = 1; ioa->asymmetric_access_enabled = 1; + } else { + ioa->asymmetric_access_enabled = 0; } } } @@ -6148,6 +6150,7 @@ /* FIXME - preferred_primary and active_active may change at the same * time. This code may need to change. */ + if (attr->preferred_primary != old_attr.preferred_primary) if (ipr_change_multi_adapter_assignment(ioa, attr->preferred_primary, IPR_PRESERVE_ASYMMETRIC_STATE)) return -EIO; @@ -6171,15 +6174,17 @@ if (attr->active_active) { if (ipr_set_active_active_mode(ioa)) return -EIO; + if (save) + ipr_save_ioa_attr(ioa, IPR_DUAL_ADAPTER_ACTIVE_ACTIVE, temp, 1); } else { + if (save) + ipr_save_ioa_attr(ioa, IPR_DUAL_ADAPTER_ACTIVE_ACTIVE, temp, 1); ipr_reset_adapter(ioa); if (ipr_change_multi_adapter_assignment(ioa, attr->preferred_primary, attr->active_active)) return -EIO; } - if (save) - ipr_save_ioa_attr(ioa, IPR_DUAL_ADAPTER_ACTIVE_ACTIVE, temp, 1); } get_dual_ioa_state(ioa); /* for preferred_primary */ @@ -8122,7 +8127,7 @@ } /** - * scsi_host_kevent - Start array protection for an array + * scsi_host_kevent - * @buf: data buffer * @func: funtion pointer * Index: iprconfig.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprconfig.c,v retrieving revision 1.136 retrieving revision 1.137 diff -u -d -r1.136 -r1.137 --- iprconfig.c 23 Oct 2008 17:11:20 -0000 1.136 +++ iprconfig.c 20 Nov 2008 01:20:20 -0000 1.137 @@ -3551,7 +3551,7 @@ rc = is_array_in_use(ioa, cur_raid_cmd->array_id); if (rc != 0) { /* "Start Parity Protection failed." */ - rc = 19; + rc = RC_19_Create_Fail; syslog(LOG_ERR, _("Devices may have changed state. Command cancelled," " please issue commands again if RAID still desired %s.\n"), ioa->ioa.gen_name); @@ -3675,12 +3675,12 @@ if (done_bad) /* Start Parity Protection failed. */ - return 19; + return RC_19_Create_Fail; check_current_config(false); /* Start Parity Protection completed successfully */ - return 18; + return RC_18_Array_Created; } not_done = 0; sleep(1); @@ -5068,7 +5068,7 @@ start_row = i_con->y + 2; - num_menu_items = ipr_debug ? 3 : 2; + num_menu_items = 3; menu_item = malloc(sizeof(ITEM **) * (num_menu_items + 1)); userptr = malloc(sizeof(int) * num_menu_items); @@ -5084,13 +5084,11 @@ set_item_userptr(menu_item[menu_index], (char *)&userptr[menu_index]); - if (ipr_debug) { - menu_index++; - menu_item[menu_index] = new_item("Not Set",""); - userptr[menu_index] = 2; - set_item_userptr(menu_item[menu_index], - (char *)&userptr[menu_index]); - } + menu_index++; + menu_item[menu_index] = new_item("Not Set",""); + userptr[menu_index] = 2; + set_item_userptr(menu_item[menu_index], + (char *)&userptr[menu_index]); menu_index++; menu_item[menu_index] = NULL; @@ -5102,7 +5100,7 @@ sprintf(i_con->field_data, "Optimized"); else if (*new_state == IPR_ACTIVE_NON_OPTIMIZED) sprintf(i_con->field_data, "Non-Optimized"); - else if (ipr_debug && *new_state == IPR_ACTIVE_STANDBY) + else if (*new_state == IPR_ACTIVE_STANDBY) sprintf(i_con->field_data, "Not Set"); /* only issue the command if the state selection changed */ if (acd->dev->array_rcd->saved_asym_access_state != *new_state) @@ -5136,9 +5134,8 @@ * Returns: * 0 if success / non-zero on failure **/ -int configure_asym_access(i_container *i_con) +int configure_asym_access(struct array_cmd_data *acd) { - struct array_cmd_data *acd; i_container *new_i_con, *i_con_head_saved; int header_lines = 0; char pref_str[20]; @@ -5150,8 +5147,6 @@ i_con_head_saved = i_con_head; i_con_head = new_i_con = NULL; - acd = i_con->data; - body = body_init(n_change_array_asym_access.header, &header_lines); sprintf(buffer, "Array: %s", acd->dev->dev_name); body = add_line_to_body(body, buffer, NULL); @@ -5195,11 +5190,8 @@ state = IPR_ACTIVE_OPTIMIZED; else if (!strncmp(new_i_con->field_data, "Non-Optimized", 8)) state = IPR_ACTIVE_NON_OPTIMIZED; - else if (ipr_debug) - state = IPR_ACTIVE_STANDBY; else - /* We should never get here. */ - break; + state = IPR_ACTIVE_STANDBY; acd->dev->array_rcd->issue_cmd = 1; acd->dev->array_rcd->saved_asym_access_state = state; @@ -5229,7 +5221,7 @@ struct screen_output *s_out; int found = 0; int toggle = 1; - i_container *i_con, *temp_i_con; + i_container *i_con; char *input; int rc; struct array_cmd_data *acd; @@ -5240,7 +5232,7 @@ do { n_asym_access.body = buffer[toggle&1]; /* display array selection screen */ - s_out = screen_driver(&n_asym_access, header_lines, i_con); + s_out = screen_driver(&n_asym_access, header_lines, NULL); rc = s_out->rc; free(s_out); toggle++; @@ -5251,9 +5243,9 @@ found = 0; /* do one at a time */ - for_each_icon(temp_i_con) { - acd = temp_i_con->data; - input = temp_i_con->field_data; + for_each_icon(i_con) { + acd = i_con->data; + input = i_con->field_data; if (acd && strcmp(input, "1") == 0) { found++; @@ -5263,7 +5255,7 @@ if (found) { /* Go to asymmetric access selection screen */ - rc = configure_asym_access(temp_i_con); + rc = configure_asym_access(acd); /* Done on success or exit */ if (rc == RC_SUCCESS || rc & EXIT_FLAG) @@ -5275,7 +5267,6 @@ s_status.index = INVALID_OPTION_STATUS; } - check_current_config(false); return rc; } @@ -5301,11 +5292,13 @@ /* make sure the i_con list is empty */ i_con = free_i_con(i_con); + check_current_config(false); + rc = RC_SUCCESS; body_init_status(buffer, n_asym_access.header, &header_lines); - for_each_ioa(ioa) { + for_each_primary_ioa(ioa) { if (!ioa->asymmetric_access || !ioa->asymmetric_access_enabled) continue; for_each_vset(ioa, vset) { @@ -12196,7 +12189,11 @@ if (rc) return rc; - return raid_start_complete(); + rc = raid_start_complete(); + if (rc == RC_18_Array_Created) + return 0; + else + return -EIO; } /** @@ -15352,6 +15349,13 @@ return -EINVAL; } + /* Check that the adapter is a primary adapter. */ + if (vset->ioa->is_secondary) { + ioa_err(vset->ioa, "Asymmetric access commands must be issued " + "for arrays on the primary IOA"); + return -EINVAL; + } + /* Check that asymmetric access is supported by the adapter. */ if (!vset->ioa->asymmetric_access) { ioa_err(vset->ioa, "Asymmetric access is not supported."); Index: Makefile =================================================================== RCS file: /cvsroot/iprdd/iprutils/Makefile,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- Makefile 7 Dec 2005 23:27:50 -0000 1.26 +++ Makefile 20 Nov 2008 01:20:20 -0000 1.27 @@ -4,7 +4,7 @@ # materials are made available under the terms of the # Common Public License v1.0 which accompanies this distribution. -INCLUDEDIR = -I. +INCLUDEDIR = -I. -I/usr/include/ncurses CC = gcc include version.mk Index: iprupdate.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprupdate.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- iprupdate.c 5 Jan 2006 20:20:48 -0000 1.22 +++ iprupdate.c 20 Nov 2008 01:20:20 -0000 1.23 @@ -1,7 +1,7 @@ /** * IBM IPR adapter microcode update utility * - * (C) Copyright 2000, 2004 + * (C) Copyright 2000, 2008 * International Business Machines Corporation and others. * All Rights Reserved. This program and the accompanying * materials are made available under the terms of the @@ -182,9 +182,11 @@ { polling_mode = 0; - if (!strncmp(buf, "change@/class/scsi_host", 23)) + if (!strncmp(buf, "change@/class/scsi_host", 23) || + (!strncmp(buf, "change@/devices/pci", 19) && strstr(buf, "scsi_host"))) scsi_host_kevent(buf, update_ioa); - else if (!strncmp(buf, "add@/class/scsi_generic", 23)) + else if (!strncmp(buf, "add@/class/scsi_generic", 23) || + (!strncmp(buf, "add@/devices/pci", 16) && strstr(buf, "scsi_generic"))) scsi_dev_kevent(buf, find_gen_dev, update_disk_fw); else if (!strncmp(buf, "add@/block/sd", 13)) scsi_dev_kevent(buf, find_blk_dev, update_disk_fw); Index: iprconfig.h =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprconfig.h,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- iprconfig.h 23 Oct 2008 17:11:20 -0000 1.51 +++ iprconfig.h 20 Nov 2008 01:20:20 -0000 1.52 @@ -296,6 +296,11 @@ .header = { __("There are no arrays eligible for the selected operation " "due to one or more of the following reasons:\n\n"), + __("o Active/Active mode is not enabled on the IOAs.\n"), + __("o An IOA needs updated microcode in order to support " + "active/active configurations.\n"), + __("o None of the disk arrays in the system are capable of " + "changing asymmetric access attributes.\n"), __("o There are no disk arrays in the system.\n"), __("o An IOA is in a condition that makes the disks attached to " "it read/write protected. Examine the kernel messages log " @@ -304,10 +309,6 @@ "code to correct the problem, if necessary.\n"), __("o Not all disks attached to an advanced function IOA have " "reported to the system. Retry the operation.\n"), - __("o None of the disk arrays in the system are capable of " - "changing asymmetric access attributes.\n"), - __("o An IOA needs updated microcode in order to support " - "active/active configurations.\n"), "" } }; Index: version.mk =================================================================== RCS file: /cvsroot/iprdd/iprutils/version.mk,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 --- version.mk 23 Oct 2008 17:11:20 -0000 1.71 +++ version.mk 20 Nov 2008 01:20:20 -0000 1.72 @@ -1,4 +1,4 @@ -# (C) Copyright 2000, 2001 +# (C) Copyright 2000, 2008 # International Business Machines Corporation and others. # All Rights Reserved. This program and the accompanying # materials are made available under the terms of the @@ -6,9 +6,9 @@ IPR_MAJOR_RELEASE=2 IPR_MINOR_RELEASE=2 -IPR_FIX_LEVEL=12 +IPR_FIX_LEVEL=13 IPR_RELEASE=1 -IPR_FIX_DATE=(October 23, 2008) +IPR_FIX_DATE=(November 17, 2008) IPR_VERSION_STR=$(IPR_MAJOR_RELEASE).$(IPR_MINOR_RELEASE).$(IPR_FIX_LEVEL) $(IPR_FIX_DATE) Index: iprinit.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprinit.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- iprinit.c 7 Mar 2005 17:20:16 -0000 1.21 +++ iprinit.c 20 Nov 2008 01:20:20 -0000 1.22 @@ -1,7 +1,7 @@ /** * IBM IPR adapter initialization utility * - * (C) Copyright 2004 + * (C) Copyright 2004, 2008 * International Business Machines Corporation and others. * All Rights Reserved. This program and the accompanying * materials are made available under the terms of the @@ -41,9 +41,11 @@ { polling_mode = 0; - if (!strncmp(buf, "change@/class/scsi_host", 23)) + if (!strncmp(buf, "change@/class/scsi_host", 23) || + (!strncmp(buf, "change@/devices/pci", 19) && strstr(buf, "scsi_host"))) scsi_host_kevent(buf, ipr_init_ioa); - else if (!strncmp(buf, "add@/class/scsi_generic", 23)) + else if (!strncmp(buf, "add@/class/scsi_generic", 23) || + (!strncmp(buf, "add@/devices/pci", 16) && strstr(buf, "scsi_generic"))) scsi_dev_kevent(buf, find_gen_dev, ipr_init_dev); else if (!strncmp(buf, "add@/block/sd", 13)) scsi_dev_kevent(buf, find_blk_dev, ipr_init_dev); Index: iprlib.h =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.h,v retrieving revision 1.104 retrieving revision 1.105 diff -u -d -r1.104 -r1.105 --- iprlib.h 23 Oct 2008 17:11:20 -0000 1.104 +++ iprlib.h 20 Nov 2008 01:20:20 -0000 1.105 @@ -185,7 +185,7 @@ #define IPR_ACTIVE_NON_OPTIMIZED 0x1 #define IPR_ACTIVE_STANDBY 0x2 #define IPR_CLEAR_ASYMMETRIC_STATE 0x0 -#define IPR_PRESERVE_ASYMMETRIC_STATE 0x1 +#define IPR_PRESERVE_ASYMMETRIC_STATE 0x80 #define IPR_IS_DASD_DEVICE(std_inq_data) \ ((((std_inq_data).peri_dev_type) == TYPE_DISK) && !((std_inq_data).removeable_medium)) Index: iprdump.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprdump.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- iprdump.c 8 Sep 2006 16:26:01 -0000 1.18 +++ iprdump.c 20 Nov 2008 01:20:20 -0000 1.19 @@ -53,6 +53,13 @@ static char *enable = "1\n"; static char *disable = "0\n"; +/** + * enable_dump - + * @ioa: ipr_ioa struct + * + * Returns: + * nothing + **/ static void enable_dump(struct ipr_ioa *ioa) { struct sysfs_class_device *class_device; @@ -92,6 +99,13 @@ sysfs_close_class_device(class_device); } +/** + * disable_dump - + * @ioa: ipr_ioa struct + * + * Returns: + * nothing + **/ static void disable_dump(struct ipr_ioa *ioa) { struct sysfs_class_device *class_device; @@ -128,6 +142,13 @@ sysfs_close_class_device(class_device); } +/** + * read_dump - + * @ioa: ipr_ioa struct + * + * Returns: + * number of items read + **/ static int read_dump(struct ipr_ioa *ioa) { struct sysfs_class_device *class_device; @@ -162,6 +183,13 @@ return count; } +/** + * select_dump_file - + * @dirent: dirent struct + * + * Returns: + * 1 if the string is found, else 0 + **/ static int select_dump_file(const struct dirent *dirent) { if (strstr(dirent->d_name, DUMP_PREFIX)) @@ -169,6 +197,14 @@ return 0; } +/** + * dump_sort - + * @a: void buffer + * @b: void buffer + * + * Returns: + * + **/ static int dump_sort(const void *a, const void *b) { const struct dirent **dumpa = (const struct dirent **)a; @@ -185,6 +221,12 @@ return alphasort(dumpa, dumpb); } +/** + * cleanup_old_dumps - + * + * Returns: + * Nothing + **/ static void cleanup_old_dumps() { struct dirent **dirent; @@ -205,6 +247,13 @@ } } +/** + * get_dump_fname - + * @fname: file name + * + * Returns: + * -EIO on error, else 0 + **/ static int get_dump_fname(char *fname) { struct dirent **dirent; @@ -235,6 +284,14 @@ return 0; } +/** + * write_dump - + * @ioa: ipr_ioa struct + * @count: size to write + * + * Returns: + * Nothing + **/ static void write_dump(struct ipr_ioa *ioa, int count) { int f_dump; @@ -256,6 +313,13 @@ ioa_err(ioa, "Dump of ipr IOA has completed to file: %s\n", dump_path); } +/** + * handle_signal - + * @signal: signal value + * + * Returns: + * Nothing + **/ static void handle_signal(int signal) { struct ipr_ioa *ioa; @@ -266,6 +330,13 @@ exit(0); } +/** + * select_dump_file - + * @ioa: ipr_ioa struct + * + * Returns: + * Nothing + **/ static void dump_ioa(struct ipr_ioa *ioa) { int count; @@ -278,6 +349,12 @@ enable_dump(ioa); } +/** + * poll_for_dump - + * + * Returns: + * Nothing + **/ static void poll_for_dump() { struct ipr_ioa *ioa; @@ -290,16 +367,27 @@ dump_ioa(ioa); } +/** + * kevent_handler - + * @buf: character buffer + * + * Returns: + * Nothing + **/ static void kevent_handler(char *buf) { struct ipr_ioa *ioa; int host, i; + char *index; - if (strncmp(buf, "change@/class/scsi_host", 23)) + if (!strncmp(buf, "change@/class/scsi_host", 23)) { + host = strtoul(&buf[28], NULL, 10); + } else if (!strncmp(buf, "change@/devices/pci", 19) && strstr(buf, "scsi_host")) { + index = strrchr(buf, '/'); + host = strtoul(index + 5, NULL, 10); + } else return; - host = strtoul(&buf[28], NULL, 10); - for (i = 0; i < 10; i++) { tool_init(0); ioa = find_ioa(host); @@ -317,6 +405,14 @@ dump_ioa(ioa); } +/** + * main - + * @argc: argument count + * @argv: argument string + * + * Returns: + * return value of handle_events() call + **/ int main(int argc, char *argv[]) { struct ipr_ioa *ioa; @@ -338,13 +434,15 @@ } else { printf("Usage: "TOOL_NAME" [options]\n"); printf(" Options: --version Print iprdump version\n"); + printf(" --daemon Run as a daemon\n"); printf(" --debug Print extra debugging information\n"); printf(" -d <usr_dir>\n"); exit(1); } } - ipr_daemonize(); + if (daemonize) + ipr_daemonize(); signal(SIGINT, handle_signal); signal(SIGQUIT, handle_signal); @@ -356,5 +454,3 @@ return handle_events(poll_for_dump, 60, kevent_handler); } - - |
From: Wayne B. <wb...@us...> - 2008-11-20 01:20:27
|
Update of /cvsroot/iprdd/iprutils/init.d In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8442/iprutils/init.d Modified Files: iprdump iprupdate Log Message: A few more active/active updates and fixes, also support new kevent paths Index: iprupdate =================================================================== RCS file: /cvsroot/iprdd/iprutils/init.d/iprupdate,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- iprupdate 21 Aug 2007 18:56:03 -0000 1.12 +++ iprupdate 20 Nov 2008 01:20:20 -0000 1.13 @@ -30,7 +30,7 @@ if [ ! -d /sys/class/scsi_generic ] ; then modprobe sg fi - $IPRUPDATE --daemon + start_daemon $IPRUPDATE --daemon RETVAL=$? if [ $RETVAL -eq 0 ]; then Index: iprdump =================================================================== RCS file: /cvsroot/iprdd/iprutils/init.d/iprdump,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- iprdump 21 Aug 2007 18:56:02 -0000 1.10 +++ iprdump 20 Nov 2008 01:20:20 -0000 1.11 @@ -30,7 +30,7 @@ if [ ! -d /sys/class/scsi_generic ] ; then modprobe sg fi - start_daemon $IPRDUMP + start_daemon $IPRDUMP --daemon RETVAL=$? if [ $RETVAL -eq 0 ]; then |
From: Wayne B. <wb...@us...> - 2008-11-20 01:20:27
|
Update of /cvsroot/iprdd/iprutils/spec In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8442/iprutils/spec Modified Files: iprutils.spec Log Message: A few more active/active updates and fixes, also support new kevent paths Index: iprutils.spec =================================================================== RCS file: /cvsroot/iprdd/iprutils/spec/iprutils.spec,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- iprutils.spec 23 Oct 2008 17:11:20 -0000 1.93 +++ iprutils.spec 20 Nov 2008 01:20:20 -0000 1.94 @@ -1,6 +1,6 @@ Summary: Utilities for the IBM Power Linux RAID adapters Name: iprutils -Version: 2.2.12 +Version: 2.2.13 Release: 1 License: CPL Group: System Environment/Base @@ -81,6 +81,10 @@ %{_sysconfdir}/ha.d/resource.d/iprha %changelog +* Mon Nov 17 2008 Wayne Boyer <wa...@li...> 2.2.13 +- Release 2.2.13 +- Additional fixes for the active-active functionality. +- Fixes for iprdump to recognize a /sys/devices path. * Thu Oct 23 2008 Wayne Boyer <wa...@li...> 2.2.12 - Release 2.2.12 - Additional GUI support and fixes for the active-active functionality. |
From: Wayne B. <wb...@us...> - 2008-10-23 17:11:53
|
Update of /cvsroot/iprdd/iprutils/spec In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21140/iprutils/spec Modified Files: iprutils.spec Log Message: Additional GUI support and fixes for the active-active functionality. Index: iprutils.spec =================================================================== RCS file: /cvsroot/iprdd/iprutils/spec/iprutils.spec,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- iprutils.spec 26 Sep 2008 20:54:18 -0000 1.92 +++ iprutils.spec 23 Oct 2008 17:11:20 -0000 1.93 @@ -1,6 +1,6 @@ Summary: Utilities for the IBM Power Linux RAID adapters Name: iprutils -Version: 2.2.11 +Version: 2.2.12 Release: 1 License: CPL Group: System Environment/Base @@ -81,6 +81,10 @@ %{_sysconfdir}/ha.d/resource.d/iprha %changelog +* Thu Oct 23 2008 Wayne Boyer <wa...@li...> 2.2.12 +- Release 2.2.12 +- Additional GUI support and fixes for the active-active functionality. +- Fixes for CLI RAID create and delete. * Fri Sep 26 2008 Wayne Boyer <wa...@li...> 2.2.11 - Release 2.2.11 - Add support for the active-active functionality. |
From: Wayne B. <wb...@us...> - 2008-10-23 17:11:27
|
Update of /cvsroot/iprdd/iprutils In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21140/iprutils Modified Files: iprconfig.c iprconfig.h iprlib.c iprlib.h version.mk Log Message: Additional GUI support and fixes for the active-active functionality. Index: version.mk =================================================================== RCS file: /cvsroot/iprdd/iprutils/version.mk,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- version.mk 26 Sep 2008 20:54:18 -0000 1.70 +++ version.mk 23 Oct 2008 17:11:20 -0000 1.71 @@ -6,9 +6,9 @@ IPR_MAJOR_RELEASE=2 IPR_MINOR_RELEASE=2 -IPR_FIX_LEVEL=11 +IPR_FIX_LEVEL=12 IPR_RELEASE=1 -IPR_FIX_DATE=(September 26, 2008) +IPR_FIX_DATE=(October 23, 2008) IPR_VERSION_STR=$(IPR_MAJOR_RELEASE).$(IPR_MINOR_RELEASE).$(IPR_FIX_LEVEL) $(IPR_FIX_DATE) Index: iprlib.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.c,v retrieving revision 1.120 retrieving revision 1.121 diff -u -d -r1.120 -r1.121 --- iprlib.c 26 Sep 2008 20:54:17 -0000 1.120 +++ iprlib.c 23 Oct 2008 17:11:20 -0000 1.121 @@ -3632,12 +3632,13 @@ * Returns: * 0 if success / non-zero on failure **/ -int ipr_set_array_asym_access(struct ipr_dev *dev, struct ipr_array_query_data *qac) +int ipr_set_array_asym_access(struct ipr_ioa *ioa) { - char *name = dev->gen_name; + char *name = ioa->ioa.gen_name; struct sense_data_t sense_data; u8 cdb[IPR_CCB_CDB_LEN]; int fd, rc; + int length = ntohs(ioa->qac_data->resp_len); if (strlen(name) == 0) return -ENOENT; @@ -3652,14 +3653,14 @@ memset(cdb, 0, IPR_CCB_CDB_LEN); cdb[0] = IPR_SET_ARRAY_ASYMMETRIC_ACCESS; - cdb[7] = (sizeof(*qac) >> 8) & 0xff; - cdb[8] = sizeof(*qac) & 0xff; + cdb[7] = (length >> 8) & 0xff; + cdb[8] = length & 0xff; - rc = sg_ioctl(fd, cdb, qac, sizeof(*qac), SG_DXFER_TO_DEV, + rc = sg_ioctl(fd, cdb, ioa->qac_data, length, SG_DXFER_TO_DEV, &sense_data, IPR_ARRAY_CMD_TIMEOUT); - if (rc != 0 && sense_data.sense_key != ILLEGAL_REQUEST) - ioa_cmd_err(dev->ioa, &sense_data, "Set Array Asymmetric Access", rc); + if (rc != 0 && (sense_data.sense_key != ILLEGAL_REQUEST || ipr_debug)) + ioa_cmd_err(ioa, &sense_data, "Set Array Asymmetric Access", rc); close(fd); return rc; @@ -4541,7 +4542,7 @@ rc = sg_ioctl(fd, cdb, NULL, 0, SG_DXFER_NONE, &sense_data, IPR_INTERNAL_DEV_TIMEOUT); - if (rc != 0 && sense_data.sense_key != ILLEGAL_REQUEST) + if (rc != 0 && (sense_data.sense_key != ILLEGAL_REQUEST || ipr_debug)) scsi_cmd_err(dev, &sense_data, "Change Multi Adapter Assignment", rc); close(fd); @@ -6165,14 +6166,18 @@ sprintf(temp, "%d", attr->active_active); /* If setting active/active, use mode page 24. - * If clearing, use Change Multi Adapter Assignment. */ + * If clearing, reset the adapter and then use + * Change Multi Adapter Assignment. */ if (attr->active_active) { if (ipr_set_active_active_mode(ioa)) return -EIO; - } else if (ipr_change_multi_adapter_assignment(ioa, + } else { + ipr_reset_adapter(ioa); + if (ipr_change_multi_adapter_assignment(ioa, attr->preferred_primary, attr->active_active)) return -EIO; + } if (save) ipr_save_ioa_attr(ioa, IPR_DUAL_ADAPTER_ACTIVE_ACTIVE, temp, 1); } @@ -7900,7 +7905,7 @@ if (ipr_get_ioa_attr(dev->ioa, &attr)) return; ipr_modify_ioa_attr(dev->ioa, &attr); - if (ipr_set_ioa_attr(dev->ioa, &attr, 1)) + if (ipr_set_ioa_attr(dev->ioa, &attr, 0)) return; if (ipr_get_bus_attr(dev->ioa, &buses)) return; Index: iprlib.h =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.h,v retrieving revision 1.103 retrieving revision 1.104 diff -u -d -r1.103 -r1.104 --- iprlib.h 26 Sep 2008 20:54:17 -0000 1.103 +++ iprlib.h 23 Oct 2008 17:11:20 -0000 1.104 @@ -183,7 +183,7 @@ #define IPR_ACTIVE_OPTIMIZED 0x0 #define IPR_ACTIVE_NON_OPTIMIZED 0x1 -#define IPR_ACTIVE_STANDYBY 0x2 +#define IPR_ACTIVE_STANDBY 0x2 #define IPR_CLEAR_ASYMMETRIC_STATE 0x0 #define IPR_PRESERVE_ASYMMETRIC_STATE 0x1 @@ -2042,7 +2042,7 @@ int ipr_start_array_protection(struct ipr_ioa *, int, int); int ipr_migrate_array_protection(struct ipr_ioa *, struct ipr_array_query_data *, int, int, int); -int ipr_set_array_asym_access(struct ipr_dev *, struct ipr_array_query_data *); +int ipr_set_array_asym_access(struct ipr_ioa *); int ipr_add_hot_spare(struct ipr_ioa *); int ipr_rebuild_device_data(struct ipr_ioa *); int ipr_resync_array(struct ipr_ioa *); Index: iprconfig.h =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprconfig.h,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- iprconfig.h 26 Sep 2008 20:54:17 -0000 1.50 +++ iprconfig.h 23 Oct 2008 17:11:20 -0000 1.51 @@ -111,6 +111,7 @@ int raid_migrate(i_container * i_con); int asym_access(i_container *i_con); +int asym_access_menu(i_container * i_con); int raid_rebuild(i_container * i_con); int confirm_raid_rebuild(i_container * i_con); @@ -278,7 +279,7 @@ s_node n_asym_access = { .rc_flags = (EXIT_FLAG | CANCEL_FLAG | REFRESH_FLAG), - .f_flags = (EXIT_FLAG | CANCEL_FLAG | TOGGLE_FLAG | FWD_FLAG ), + .f_flags = (EXIT_FLAG | CANCEL_FLAG | REFRESH_FLAG | TOGGLE_FLAG | FWD_FLAG), .num_opts = NUM_OPTS(null_opt), .options = &null_opt[0], .title = __("Array Asymmetric Access"), @@ -310,6 +311,25 @@ "" } }; +struct screen_opts change_array_asym_access_opt[] = { + {asym_access_menu, "c"}, + {NULL, "\n"} +}; + +s_node n_change_array_asym_access = { + .rc_flags = (EXIT_FLAG | CANCEL_FLAG | REFRESH_FLAG), + .f_flags = (ENTER_FLAG | EXIT_FLAG | CANCEL_FLAG | FWD_FLAG | MENU_FLAG), + .num_opts = NUM_OPTS(change_array_asym_access_opt), + .options = &change_array_asym_access_opt[0], + .title = __("Change Asymmetric Access Configuration of Array"), + .header = { + __("Current array asymmetric access configuration is shown. To " + "change setting hit 'c' for options menu. Highlight " + "desired option then hit Enter.\n"), + __(" c=Change Setting\n\n"), + "" } +}; + s_node n_raid_migrate_complete = { .title = __("Migrate Disk Array Status"), .body = __("You selected to migrate a disk array") Index: iprconfig.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprconfig.c,v retrieving revision 1.135 retrieving revision 1.136 diff -u -d -r1.135 -r1.136 --- iprconfig.c 26 Sep 2008 20:54:10 -0000 1.135 +++ iprconfig.c 23 Oct 2008 17:11:20 -0000 1.136 @@ -5047,6 +5047,239 @@ } /** + * asym_access_menu - Display the Optimized and Non-Optimized choices. + * @i_con: i_container struct + * + * Returns: + * 0 if success / non-zero on failure + **/ +int asym_access_menu(i_container *i_con) +{ + struct array_cmd_data *acd; + int start_row; + int num_menu_items; + int menu_index = 0; + ITEM ** menu_item = NULL; + int *userptr = NULL; + int *new_state; + int rc; + + acd = (struct array_cmd_data *)i_con->data; + + start_row = i_con->y + 2; + + num_menu_items = ipr_debug ? 3 : 2; + + menu_item = malloc(sizeof(ITEM **) * (num_menu_items + 1)); + userptr = malloc(sizeof(int) * num_menu_items); + + menu_item[menu_index] = new_item("Optimized",""); + userptr[menu_index] = 0; + set_item_userptr(menu_item[menu_index], + (char *)&userptr[menu_index]); + + menu_index++; + menu_item[menu_index] = new_item("Non-Optimized",""); + userptr[menu_index] = 1; + set_item_userptr(menu_item[menu_index], + (char *)&userptr[menu_index]); + + if (ipr_debug) { + menu_index++; + menu_item[menu_index] = new_item("Not Set",""); + userptr[menu_index] = 2; + set_item_userptr(menu_item[menu_index], + (char *)&userptr[menu_index]); + } + + menu_index++; + menu_item[menu_index] = NULL; + rc = display_menu(menu_item, start_row, menu_index, &new_state); + + if (rc == RC_SUCCESS) { + /* set field_data based on menu choice */ + if (*new_state == IPR_ACTIVE_OPTIMIZED) + sprintf(i_con->field_data, "Optimized"); + else if (*new_state == IPR_ACTIVE_NON_OPTIMIZED) + sprintf(i_con->field_data, "Non-Optimized"); + else if (ipr_debug && *new_state == IPR_ACTIVE_STANDBY) + sprintf(i_con->field_data, "Not Set"); + /* only issue the command if the state selection changed */ + if (acd->dev->array_rcd->saved_asym_access_state != *new_state) + acd->do_cmd = 1; + else + acd->do_cmd = 0; + } else { + /* set field_data based on existing value */ + if (acd->dev->array_rcd->saved_asym_access_state == IPR_ACTIVE_OPTIMIZED) + sprintf(i_con->field_data, "Optimized"); + else if (acd->dev->array_rcd->saved_asym_access_state == IPR_ACTIVE_NON_OPTIMIZED) + sprintf(i_con->field_data, "Non-Optimized"); + else + sprintf(i_con->field_data, "Not Set"); + } + + menu_index = 0; + while (menu_item[menu_index] != NULL) + free_item(menu_item[menu_index++]); + free(menu_item); + free(userptr); + menu_item = NULL; + + return rc; +} + +/** + * configure_asym_access - Configure the array setting for asymmetric access. + * @i_con: i_container struct + * + * Returns: + * 0 if success / non-zero on failure + **/ +int configure_asym_access(i_container *i_con) +{ + struct array_cmd_data *acd; + i_container *new_i_con, *i_con_head_saved; + int header_lines = 0; + char pref_str[20]; + char buffer[128]; + char *body = NULL; + struct screen_output *s_out; + int state = 0, rc = REFRESH_FLAG; + + i_con_head_saved = i_con_head; + i_con_head = new_i_con = NULL; + + acd = i_con->data; + + body = body_init(n_change_array_asym_access.header, &header_lines); + sprintf(buffer, "Array: %s", acd->dev->dev_name); + body = add_line_to_body(body, buffer, NULL); + if (acd->dev->array_rcd->current_asym_access_state == IPR_ACTIVE_OPTIMIZED) + sprintf(buffer, "Current asymmetric access state: Optimized"); + else + sprintf(buffer, "Current asymmetric access state: Non-Optimized"); + body = add_line_to_body(body, buffer, NULL); + if (acd->dev->array_rcd->saved_asym_access_state == IPR_ACTIVE_OPTIMIZED) { + sprintf(buffer, "Saved asymmetric access state: Optimized\n"); + sprintf(pref_str, "Optimized"); + } else if (acd->dev->array_rcd->saved_asym_access_state == IPR_ACTIVE_NON_OPTIMIZED) { + sprintf(buffer, "Saved asymmetric access state: Non-Optimized\n"); + sprintf(pref_str, "Non-Optimized"); + } else { + sprintf(buffer, "Saved asymmetric access state: Not Set\n"); + sprintf(pref_str, "Not Set"); + } + body = add_line_to_body(body, buffer, NULL); + + header_lines += 2; + + body = add_line_to_body(body,_("Preferred Asymmetric Access State"), "%13"); + + new_i_con = add_i_con(new_i_con, pref_str, acd); + + n_change_array_asym_access.body = body; + + while (rc & REFRESH_FLAG) { + s_out = screen_driver(&n_change_array_asym_access, header_lines, NULL); + + rc = s_out->rc; + + if (rc == RC_SUCCESS) { + if (!acd->do_cmd) { + rc = REFRESH_FLAG; + break; + } + + if (!strncmp(new_i_con->field_data, "Optimized", 8)) + state = IPR_ACTIVE_OPTIMIZED; + else if (!strncmp(new_i_con->field_data, "Non-Optimized", 8)) + state = IPR_ACTIVE_NON_OPTIMIZED; + else if (ipr_debug) + state = IPR_ACTIVE_STANDBY; + else + /* We should never get here. */ + break; + + acd->dev->array_rcd->issue_cmd = 1; + acd->dev->array_rcd->saved_asym_access_state = state; + rc = ipr_set_array_asym_access(acd->ioa); + } + } + processing(); + + free(n_change_array_asym_access.body); + n_change_array_asym_access.body = NULL; + free_i_con(new_i_con); + i_con_head = i_con_head_saved; + free(s_out); + return rc; +} + +/** + * process_asym_access - Process the arrays that support asymmetric access. + * @buffer: + * @header_lines: + * + * Returns: + * 0 if success / non-zero on failure + **/ +int process_asym_access(char *buffer[], int header_lines) +{ + struct screen_output *s_out; + int found = 0; + int toggle = 1; + i_container *i_con, *temp_i_con; + char *input; + int rc; + struct array_cmd_data *acd; + + while (1) { + toggle_field = 0; + + do { + n_asym_access.body = buffer[toggle&1]; + /* display array selection screen */ + s_out = screen_driver(&n_asym_access, header_lines, i_con); + rc = s_out->rc; + free(s_out); + toggle++; + } while (rc == TOGGLE_SCREEN); + + if (rc & EXIT_FLAG || rc & CANCEL_FLAG) + break; + + found = 0; + /* do one at a time */ + for_each_icon(temp_i_con) { + acd = temp_i_con->data; + input = temp_i_con->field_data; + + if (acd && strcmp(input, "1") == 0) { + found++; + break; + } + } + + if (found) { + /* Go to asymmetric access selection screen */ + rc = configure_asym_access(temp_i_con); + + /* Done on success or exit */ + if (rc == RC_SUCCESS || rc & EXIT_FLAG) + break; + + /* clear the do_cmd flag */ + acd->do_cmd = 0; + } else + s_status.index = INVALID_OPTION_STATUS; + } + + check_current_config(false); + return rc; +} + +/** * asym_access - GUI routine for setting array asymmetric access. * @i_con: i_container struct * @@ -5055,11 +5288,13 @@ **/ int asym_access(i_container *i_con) { - int rc; + int rc, k; int found = 0; char *buffer[2]; struct screen_output *s_out; int header_lines; + struct ipr_ioa *ioa; + struct ipr_dev *vset; processing(); @@ -5070,6 +5305,20 @@ body_init_status(buffer, n_asym_access.header, &header_lines); + for_each_ioa(ioa) { + if (!ioa->asymmetric_access || !ioa->asymmetric_access_enabled) + continue; + for_each_vset(ioa, vset) { + if (!vset->array_rcd->asym_access_cand) + continue; + add_raid_cmd_tail(ioa, vset, vset->array_rcd->array_id); + i_con = add_i_con(i_con, "\0", raid_cmd_tail); + + print_dev(k, vset, buffer, "%1", k); + found++; + } + } + if (!found) { n_asym_access_fail.body = body_init(n_asym_access_fail.header, NULL); s_out = screen_driver(&n_asym_access_fail, 0, i_con); @@ -5080,7 +5329,12 @@ rc = s_out->rc | CANCEL_FLAG; free(s_out); } else - rc = 1; //process_asym_access(buffer, header_lines); + rc = process_asym_access(buffer, header_lines); + + for (k = 0; k < 2; k++) { + free(buffer[k]); + buffer[k] = NULL; + } return rc; } @@ -9818,68 +10072,6 @@ return rc; } -/** - * ioa_config - - * @i_con: i_container struct - * - * Returns: - * 0 if success / non-zero on failure FIXME - **/ -int ioa_config(i_container * i_con) -{ - int rc, k; - int len = 0; - int num_lines = 0; - struct ipr_ioa *ioa; - struct screen_output *s_out; - int header_lines; - char *buffer[2]; - int toggle = 1; - - processing(); - rc = RC_SUCCESS; - i_con = free_i_con(i_con); - - check_current_config(false); - body_init_status(buffer, n_ioa_config.header, &header_lines); - - for_each_ioa(ioa) { - if (ioa->ioa.scsi_dev_data == NULL) - continue; - if (!ioa->dual_raid_support && !ioa->gscsi_only_ha) - continue; - - print_dev(k, &ioa->ioa, buffer, "%1", k); - i_con = add_i_con(i_con, "\0", &ioa->ioa); - num_lines++; - } - - if (num_lines == 0) { - for (k = 0; k < 2; k++) { - len = strlen(buffer[k]); - buffer[k] = realloc(buffer[k], len + - strlen(_(no_dev_found)) + 8); - sprintf(buffer[k] + len, "\n%s", _(no_dev_found)); - } - } - - do { - n_ioa_config.body = buffer[toggle&1]; - s_out = screen_driver(&n_ioa_config,header_lines,i_con); - toggle++; - } while (s_out->rc == TOGGLE_SCREEN); - - for (k = 0; k < 2; k++) { - free(buffer[k]); - buffer[k] = NULL; - } - n_ioa_config.body = NULL; - - rc = s_out->rc; - free(s_out); - return rc; -} - struct ioa_config_attr { int option; int preferred_primary; @@ -10099,7 +10291,8 @@ } processing(); - ipr_set_ioa_attr(dev->ioa, &ioa_attr, 1); + rc = ipr_set_ioa_attr(dev->ioa, &ioa_attr, 1); + check_current_config(false); leave: free(n_change_ioa_config.body); @@ -10111,6 +10304,68 @@ } /** + * ioa_config - + * @i_con: i_container struct + * + * Returns: + * 0 if success / non-zero on failure FIXME + **/ +int ioa_config(i_container * i_con) +{ + int rc, k; + int len = 0; + int num_lines = 0; + struct ipr_ioa *ioa; + struct screen_output *s_out; + int header_lines; + char *buffer[2]; + int toggle = 1; + + processing(); + rc = RC_SUCCESS; + i_con = free_i_con(i_con); + + check_current_config(false); + body_init_status(buffer, n_ioa_config.header, &header_lines); + + for_each_ioa(ioa) { + if (ioa->ioa.scsi_dev_data == NULL) + continue; + if (!ioa->dual_raid_support && !ioa->gscsi_only_ha) + continue; + + print_dev(k, &ioa->ioa, buffer, "%1", k); + i_con = add_i_con(i_con, "\0", &ioa->ioa); + num_lines++; + } + + if (num_lines == 0) { + for (k = 0; k < 2; k++) { + len = strlen(buffer[k]); + buffer[k] = realloc(buffer[k], len + + strlen(_(no_dev_found)) + 8); + sprintf(buffer[k] + len, "\n%s", _(no_dev_found)); + } + } + + do { + n_ioa_config.body = buffer[toggle&1]; + s_out = screen_driver(&n_ioa_config, header_lines, i_con); + toggle++; + } while (s_out->rc == TOGGLE_SCREEN); + + for (k = 0; k < 2; k++) { + free(buffer[k]); + buffer[k] = NULL; + } + n_ioa_config.body = NULL; + + rc = s_out->rc; + free(s_out); + return rc; +} + +/** * download_ucode - * @i_con: i_container struct * @@ -11459,6 +11714,10 @@ char product_id[IPR_PROD_ID_LEN + 1]; struct ipr_ioa *ioa = dev->ioa; + /* In cases where we're having problems with the device */ + if (!ioa) + return body; + if (body) len = strlen(body); body = realloc(body, len + 256); @@ -11872,11 +12131,16 @@ if (!ioa) ioa = dev->ioa; else if (ioa != dev->ioa) { - syslog(LOG_ERR, _("All devices must be attached to the same adapter\n")); + syslog(LOG_ERR, _("All devices must be attached to the same adapter.\n")); return -EINVAL; } } + if (!ioa) { + syslog(LOG_ERR, _("No valid devices specified.\n")); + return -EINVAL; + } + cap = get_cap_entry(ioa->supported_arrays, raid_level); if (!cap) { @@ -12067,7 +12331,7 @@ dev = find_and_add_dev(args[0]); - if (!dev) { + if (!dev || !ipr_is_volume_set(dev)) { syslog(LOG_ERR, _("Invalid device specified: %s\n"), args[0]); return -EINVAL; } @@ -12094,8 +12358,10 @@ static void printf_device(struct ipr_dev *dev, int type) { char *buf = print_device(dev, NULL, NULL, type); - printf("%s", buf); - free(buf); + if (buf) { + printf("%s", buf); + free(buf); + } } /** @@ -12114,8 +12380,10 @@ int percent, int indent) { char *buf = __print_device(dev, NULL, NULL, sd, sg, vpd, percent, indent, 0, 0); - printf("%s", buf); - free(buf); + if (buf) { + printf("%s", buf); + free(buf); + } } /** @@ -13309,8 +13577,10 @@ static void printf_path_status(struct ipr_dev *dev) { char *buf = __print_device(dev, NULL, NULL, 1, 1, 1, 0, 0, 0, 1); - printf("%s", buf); - free(buf); + if (buf) { + printf("%s", buf); + free(buf); + } } /** @@ -14395,13 +14665,13 @@ struct ipr_ioa *ioa; for_each_ioa(ioa) { - if (!ioa->asymmetric_access); + if (!ioa->asymmetric_access) continue; if (!hdr) { hdr = 1; printf("%s\n%s\n", status_hdr[3], status_sep[3]); } - printf_device(&ioa->ioa, 1); + printf_device(&ioa->ioa, 2); } return 0; } @@ -14497,8 +14767,10 @@ printf("Unsupported\n"); else if (vset->array_rcd->current_asym_access_state == IPR_ACTIVE_OPTIMIZED) printf("Optimized\n"); - else + else if (vset->array_rcd->current_asym_access_state == IPR_ACTIVE_NON_OPTIMIZED) printf("Not Optimized\n"); + else + scsi_dbg(vset, "Unrecognized state - %d.", vset->array_rcd->current_asym_access_state); return 0; } @@ -15036,7 +15308,8 @@ * set_ioa_asymmetric_access - Change the asymmetric access mode for an IOA. * Enabling occurs by sending a change multi adapter * assignment command from ipr_set_ioa_attr(). - * Disabling occurs by sending a mode select + * Disabling occurs by resetting the adapter and + * then sending a mode select * page 24 in ipr_set_active_active_mode(). * @args: argument vector * @num_args: number of arguments @@ -15067,7 +15340,6 @@ { int state; struct ipr_dev *vset = NULL; - struct ipr_ioa *ioa = NULL; vset = find_dev(args[0]); if (!vset) { @@ -15110,14 +15382,14 @@ if (vset->array_rcd->asym_access_cand) vset->array_rcd->issue_cmd = 1; else { - scsi_err(vset, "%s is not a candidate for " - "asymmetric access.", vset->gen_name); + scsi_err(vset, "%s is not a candidate for asymmetric access.", + vset->dev_name); return -EINVAL; } vset->array_rcd->saved_asym_access_state = state; - return ipr_set_array_asym_access(vset, ioa->qac_data); + return ipr_set_array_asym_access(vset->ioa); } static const struct { @@ -15186,8 +15458,8 @@ { "set-all-secondary", 0, 0, 0, set_all_secondary, "" }, { "query-ha-mode", 1, 0, 1, get_ha_mode, "sg5" }, { "set-ha-mode", 2, 0, 2, __set_ha_mode, "sg5 [Normal | JBOD]" }, - { "set-ioa-asymmetric-access", 2, 0, 2, set_ioa_asymmetric_access, "sg5 [Enabled | Disabled]" }, - { "set-array-asymmetric-access", 2, 0, 2, set_array_asymmetric_access, "sda [Optimized | Non-Optimized]" }, + { "set-ioa-asymmetric-access-mode", 2, 0, 2, set_ioa_asymmetric_access, "sg5 [Enabled | Disabled]" }, + { "set-array-asymmetric-access-mode", 2, 0, 2, set_array_asymmetric_access, "sda [Optimized | Non-Optimized]" }, { "raid-create", 1, 1, 0, raid_create, "-r 5 -s 64 sda sdb sg6 sg7" }, { "raid-delete", 1, 0, 1, raid_delete, "sdb" }, { "raid-include", 2, 0, 17, raid_include_cmd, "sda sg6 sg7" }, |
From: Wayne B. <wb...@us...> - 2008-08-20 23:04:39
|
Update of /cvsroot/iprdd/iprutils In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv24974/iprutils Modified Files: iprlib.h Log Message: Fixed a problem that caused a compile failure on small endian systems. Index: iprlib.h =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.h,v retrieving revision 1.101 retrieving revision 1.102 diff -u -d -r1.101 -r1.102 --- iprlib.h 14 Aug 2008 01:12:54 -0000 1.101 +++ iprlib.h 20 Aug 2008 22:59:29 -0000 1.102 @@ -637,19 +637,19 @@ struct ipr_array_cap_entry { u8 prot_level; #define IPR_DEFAULT_RAID_LVL "5" + #if defined (__BIG_ENDIAN_BITFIELD) u8 include_allowed:1; u8 reserved:5; u8 format_overlay_type:2; - -#define IPR_FORMAT_ADD_DEVICES 1 -#define IPR_FORMAT_REMOVE_DEVICES 2 - #elif defined (__LITTLE_ENDIAN_BITFIELD) u8 format_overlay_type:2; u8 reserved:5; u8 include_allowed:1; #endif +#define IPR_FORMAT_ADD_DEVICES 1 +#define IPR_FORMAT_REMOVE_DEVICES 2 + u16 reserved2; u8 reserved3; u8 max_num_array_devices; |
From: Wayne B. <wb...@us...> - 2008-08-14 01:12:51
|
Update of /cvsroot/iprdd/iprutils/spec In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6250/iprutils/spec Modified Files: iprutils.spec Log Message: Add support for the array migration functionality. Index: iprutils.spec =================================================================== RCS file: /cvsroot/iprdd/iprutils/spec/iprutils.spec,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -r1.90 -r1.91 --- iprutils.spec 14 May 2008 20:17:11 -0000 1.90 +++ iprutils.spec 14 Aug 2008 01:12:55 -0000 1.91 @@ -1,6 +1,6 @@ Summary: Utilities for the IBM Power Linux RAID adapters Name: iprutils -Version: 2.2.9 +Version: 2.2.10 Release: 1 License: CPL Group: System Environment/Base @@ -81,11 +81,9 @@ %{_sysconfdir}/ha.d/resource.d/iprha %changelog -* Wed May 14 2008 Tseng-Hui Lin <tse...@us...> -- Under heavy traffic, download microcode to a disk through /dev/sgX - may get -ENOMEM SG_IO ioctl. Change to use /dev/sdX. Fall back - to /dev/sgX if: (1) /dev/sdX does not exist or (2) max_sectors_kb - is not set large enough for microcode download. +* Wed Aug 13 2008 Wayne Boyer <wa...@li...> 2.2.10 +- Release 2.2.10 +- Add support for the array migration functionality. * Thu Apr 09 2008 Tseng-Hui Lin <tse...@us...> 2.2.9 - Release 2.2.9 - Do not save preferred primary attribute to fix an infinite failover |
From: Wayne B. <wb...@us...> - 2008-08-14 01:12:51
|
Update of /cvsroot/iprdd/iprutils In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6250/iprutils Modified Files: iprconfig.8 iprconfig.c iprconfig.h iprlib.c iprlib.h version.mk Log Message: Add support for the array migration functionality. Index: iprlib.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.c,v retrieving revision 1.118 retrieving revision 1.119 diff -u -d -r1.118 -r1.119 --- iprlib.c 14 May 2008 20:17:08 -0000 1.118 +++ iprlib.c 14 Aug 2008 01:12:54 -0000 1.119 @@ -354,6 +354,14 @@ /*---------- subroutine/function code starts here ---------*/ +/** + * ses_table_entry - + * @ioa: ipr ioa struct + * @bus: + * + * Returns: + * ses_table_entry pointer if success / NULL on failure + **/ [...3271 lines suppressed...] + * Returns: + * nothing + **/ void ipr_daemonize() { int rc = fork(); @@ -6350,6 +8102,13 @@ setsid(); } +/** + * ipr_disable_qerr - + * @dev: ipr dev struct + * + * Returns: + * 0 if success / non-zero on failure + **/ int ipr_disable_qerr(struct ipr_dev *dev) { u8 ioctl_buffer[IOCTL_BUFFER_SIZE]; Index: iprconfig.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprconfig.c,v retrieving revision 1.133 retrieving revision 1.134 diff -u -d -r1.133 -r1.134 --- iprconfig.c 4 Sep 2007 21:05:10 -0000 1.133 +++ iprconfig.c 14 Aug 2008 01:12:52 -0000 1.134 @@ -130,6 +130,16 @@ for (i = 0; i < 2; i++) \ (buf)[i] = print_device(dev, (buf)[i], fmt, type); +static struct sysfs_dev *head_sdev; +static struct sysfs_dev *tail_sdev; + +/** + * is_format_allowed - + * @dev: ipr dev struct + * + * Returns: [...5539 lines suppressed...] + * 0 if success / non-zero on failure + **/ static int non_interactive_cmd(char *cmd, char **args, int num_args) { int rc, i; @@ -11590,6 +14904,14 @@ return -EINVAL; } +/** + * main - program entry point + * @argc: number of arguments + * @argv: argument vector + * + * Returns: + * 0 if success / non-zero on failure + **/ int main(int argc, char *argv[]) { int next_editor, next_dir, next_cmd, next_args, i, rc = 0; Index: iprlib.h =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.h,v retrieving revision 1.100 retrieving revision 1.101 diff -u -d -r1.100 -r1.101 --- iprlib.h 9 Apr 2008 19:34:17 -0000 1.100 +++ iprlib.h 14 Aug 2008 01:12:54 -0000 1.101 @@ -51,19 +51,19 @@ #include <linux/netlink.h> #include <time.h> -#define IPR_DASD_UCODE_USRLIB 0 -#define IPR_DASD_UCODE_ETC 1 +#define IPR_DASD_UCODE_USRLIB 0 +#define IPR_DASD_UCODE_ETC 1 -#define IPR_DASD_UCODE_NOT_FOUND -1 -#define IPR_DASD_UCODE_NO_HDR 1 -#define IPR_DASD_UCODE_HDR 2 +#define IPR_DASD_UCODE_NOT_FOUND -1 +#define IPR_DASD_UCODE_NO_HDR 1 +#define IPR_DASD_UCODE_HDR 2 -#define UCODE_BASE_DIR "/usr/lib/microcode" -#define LINUX_UCODE_BASE_DIR "/lib/firmware" +#define UCODE_BASE_DIR "/usr/lib/microcode" +#define LINUX_UCODE_BASE_DIR "/lib/firmware" -#define FIRMWARE_HOTPLUG_DIR_TAG "FIRMWARE_DIR" -#define FIRMWARE_HOTPLUG_CONFIG_FILE "/etc/hotplug/firmware.agent" -#define FIRMWARE_HOTPLUG_DEFAULT_DIR LINUX_UCODE_BASE_DIR +#define FIRMWARE_HOTPLUG_DIR_TAG "FIRMWARE_DIR" +#define FIRMWARE_HOTPLUG_CONFIG_FILE "/etc/hotplug/firmware.agent" +#define FIRMWARE_HOTPLUG_DEFAULT_DIR LINUX_UCODE_BASE_DIR #define IPR_JBOD_BLOCK_SIZE 512 #define IPR_DEFAULT_AF_BLOCK_SIZE 522 @@ -81,36 +81,36 @@ #define IPR_INVALID_ARRAY_ID 0xFF #define IPR_IOA_RESOURCE_HANDLE 0xffffffff #define IPR_RECLAIM_NUM_BLOCKS_MULTIPLIER 256 -#define IPR_SDB_CHECK_AND_QUIESCE 0x00 -#define IPR_SDB_CHECK_ONLY 0x40 -#define IPR_SDB_CHECK_AND_QUIESCE_ENC 0x0e -#define IPR_RDB_UNQUIESCE_AND_REBALANCE 0x20 +#define IPR_SDB_CHECK_AND_QUIESCE 0x00 +#define IPR_SDB_CHECK_ONLY 0x40 +#define IPR_SDB_CHECK_AND_QUIESCE_ENC 0x0e +#define IPR_RDB_UNQUIESCE_AND_REBALANCE 0x20 #define IPR_MAX_NUM_SUPP_INQ_PAGES 36 #define IPR_DUMP_TRACE_ENTRY_SIZE 8192 #define IPR_MODE_SENSE_LENGTH 255 #define IPR_DEFECT_LIST_HDR_LEN 4 #define IPR_FORMAT_DATA 0x10 #define IPR_FORMAT_IMMED 2 -#define IPR_ARRAY_CMD_TIMEOUT (2 * 60) /* 2 minutes */ -#define IPR_INTERNAL_DEV_TIMEOUT (2 * 60) /* 2 minutes */ +#define IPR_ARRAY_CMD_TIMEOUT (2 * 60) /* 2 minutes */ +#define IPR_INTERNAL_DEV_TIMEOUT (2 * 60) /* 2 minutes */ #define IPR_FORMAT_UNIT_TIMEOUT (3 * 60 * 60) /* 3 hours */ -#define IPR_INTERNAL_TIMEOUT (30) /* 30 seconds */ -#define IPR_SUSPEND_DEV_BUS_TIMEOUT (35) /* 35 seconds */ -#define IPR_EVALUATE_DEVICE_TIMEOUT (2 * 60) /* 2 minutes */ -#define IPR_WRITE_BUFFER_TIMEOUT (8 * 60) /* 8 minutes */ -#define SET_DASD_TIMEOUTS_TIMEOUT (2 * 60) +#define IPR_INTERNAL_TIMEOUT (30) /* 30 seconds */ +#define IPR_SUSPEND_DEV_BUS_TIMEOUT (35) /* 35 seconds */ +#define IPR_EVALUATE_DEVICE_TIMEOUT (2 * 60) /* 2 minutes */ +#define IPR_WRITE_BUFFER_TIMEOUT (8 * 60) /* 8 minutes */ +#define SET_DASD_TIMEOUTS_TIMEOUT (2 * 60) #define IPR_NUM_DRIVE_ELEM_STATUS_ENTRIES 50 #define IPR_DRIVE_ELEM_STATUS_EMPTY 5 #define IPR_DRIVE_ELEM_STATUS_POPULATED 1 #define IPR_DRIVE_ELEM_STATUS_UNSUPP 0 -#define IPR_TIMEOUT_SECOND_RADIX 0x0000 -#define IPR_TIMEOUT_MINUTE_RADIX 0x4000 -#define IPR_TIMEOUT_RADIX_MASK 0xC000 +#define IPR_TIMEOUT_SECOND_RADIX 0x0000 +#define IPR_TIMEOUT_MINUTE_RADIX 0x4000 +#define IPR_TIMEOUT_RADIX_MASK 0xC000 #define IPR_TIMEOUT_RADIX_IS_MINUTE(to) \ (((to) & IPR_TIMEOUT_RADIX_MASK) == IPR_TIMEOUT_MINUTE_RADIX) #define IPR_TIMEOUT_RADIX_IS_SECONDS(to) \ (((to) & IPR_TIMEOUT_RADIX_MASK) == IPR_TIMEOUT_SECOND_RADIX) -#define IPR_TIMEOUT_MASK 0x3FFF +#define IPR_TIMEOUT_MASK 0x3FFF #define IPR_IOA_DEBUG 0xDDu #define IPR_IOA_DEBUG_READ_IOA_MEM 0x00u @@ -119,40 +119,41 @@ #define IPR_IOA_DEBUG_ENABLE_DBG_FUNC 0x0Au #define IPR_IOA_DEBUG_DISABLE_DBG_FUNC 0x0Bu -#define IPR_STD_INQ_Z0_TERM_LEN 8 -#define IPR_STD_INQ_Z1_TERM_LEN 12 -#define IPR_STD_INQ_Z2_TERM_LEN 4 -#define IPR_STD_INQ_Z3_TERM_LEN 5 -#define IPR_STD_INQ_Z4_TERM_LEN 4 -#define IPR_STD_INQ_Z5_TERM_LEN 2 -#define IPR_STD_INQ_Z6_TERM_LEN 10 -#define IPR_STD_INQ_PART_NUM_LEN 12 -#define IPR_STD_INQ_EC_LEVEL_LEN 10 -#define IPR_STD_INQ_FRU_NUM_LEN 12 +#define IPR_STD_INQ_Z0_TERM_LEN 8 +#define IPR_STD_INQ_Z1_TERM_LEN 12 +#define IPR_STD_INQ_Z2_TERM_LEN 4 +#define IPR_STD_INQ_Z3_TERM_LEN 5 +#define IPR_STD_INQ_Z4_TERM_LEN 4 +#define IPR_STD_INQ_Z5_TERM_LEN 2 +#define IPR_STD_INQ_Z6_TERM_LEN 10 +#define IPR_STD_INQ_PART_NUM_LEN 12 +#define IPR_STD_INQ_EC_LEVEL_LEN 10 +#define IPR_STD_INQ_FRU_NUM_LEN 12 -#define IPR_START_STOP_STOP 0x00 -#define IPR_START_STOP_START 0x01 -#define IPR_READ_CAPACITY_16 0x10 +#define IPR_START_STOP_STOP 0x00 +#define IPR_START_STOP_START 0x01 +#define IPR_READ_CAPACITY_16 0x10 #define IPR_SERVICE_ACTION_IN 0x9E #define IPR_MAINTENANCE_IN 0xA3 -#define IPR_QUERY_MULTI_ADAPTER_STATUS 0x01 +#define IPR_QUERY_MULTI_ADAPTER_STATUS 0x01 #define IPR_MAINTENANCE_OUT 0xA4 -#define IPR_CHANGE_MULTI_ADAPTER_ASSIGNMENT 0x02 +#define IPR_CHANGE_MULTI_ADAPTER_ASSIGNMENT 0x02 #define IPR_QUERY_RESOURCE_STATE 0xC2 #define IPR_QUERY_COMMAND_STATUS 0xCB #define IPR_SUSPEND_DEV_BUS 0xC8 #define IPR_RESUME_DEV_BUS 0xC9 #define IPR_IOA_SERVICE_ACTION 0xD2 -#define IPR_QUERY_RES_ADDR_ALIASES 0x10 -#define IPR_DISRUPT_DEVICE 0x11 -#define IPR_QUERY_SAS_EXPANDER_INFO 0x12 -#define IPR_QUERY_RES_REDUNDANCY_INFO 0x13 +#define IPR_QUERY_RES_ADDR_ALIASES 0x10 +#define IPR_DISRUPT_DEVICE 0x11 +#define IPR_QUERY_SAS_EXPANDER_INFO 0x12 +#define IPR_QUERY_RES_REDUNDANCY_INFO 0x13 #define IPR_EVALUATE_DEVICE 0xE4 -#define SKIP_READ 0xE8 -#define SKIP_WRITE 0xEA -#define QUERY_DASD_TIMEOUTS 0xEB -#define SET_DASD_TIMEOUTS 0xEC -#define IPR_QUERY_ARRAY_CONFIG 0xF0 +#define SKIP_READ 0xE8 +#define SKIP_WRITE 0xEA +#define QUERY_DASD_TIMEOUTS 0xEB +#define SET_DASD_TIMEOUTS 0xEC +#define IPR_MIGRATE_ARRAY_PROTECTION 0xEF +#define IPR_QUERY_ARRAY_CONFIG 0xF0 #define IPR_START_ARRAY_PROTECTION 0xF1 #define IPR_STOP_ARRAY_PROTECTION 0xF2 #define IPR_RESYNC_ARRAY_PROTECTION 0xF3 @@ -160,24 +161,24 @@ #define IPR_REMOVE_ARRAY_DEVICE 0xF5 #define IPR_REBUILD_DEVICE_DATA 0xF6 #define IPR_RECLAIM_CACHE_STORE 0xF8 -#define IPR_RECLAIM_ACTION 0x68 -#define IPR_RECLAIM_PERFORM 0x00 -#define IPR_RECLAIM_RESET_BATTERY_ERROR 0x08 -#define IPR_RECLAIM_EXTENDED_INFO 0x10 -#define IPR_RECLAIM_QUERY 0x20 -#define IPR_RECLAIM_RESET 0x40 -#define IPR_RECLAIM_FORCE_BATTERY_ERROR 0x60 -#define IPR_RECLAIM_UNKNOWN_PERM 0x80 -#define SET_SUPPORTED_DEVICES 0xFB +#define IPR_RECLAIM_ACTION 0x68 +#define IPR_RECLAIM_PERFORM 0x00 +#define IPR_RECLAIM_RESET_BATTERY_ERROR 0x08 +#define IPR_RECLAIM_EXTENDED_INFO 0x10 +#define IPR_RECLAIM_QUERY 0x20 +#define IPR_RECLAIM_RESET 0x40 +#define IPR_RECLAIM_FORCE_BATTERY_ERROR 0x60 +#define IPR_RECLAIM_UNKNOWN_PERM 0x80 +#define SET_SUPPORTED_DEVICES 0xFB #define IPR_STD_INQUIRY 0xFF #ifndef REPORT_LUNS -#define REPORT_LUNS 0xA0 +#define REPORT_LUNS 0xA0 #endif #define IPR_XLATE_DEV_FMT_RC(rc) ((((rc) & 127) == 51) ? -EIO : 0) -#define IPR_TYPE_AF_DISK 0xC -#define IPR_TYPE_ADAPTER 0x1f -#define IPR_TYPE_EMPTY_SLOT 0xff +#define IPR_TYPE_AF_DISK 0xC +#define IPR_TYPE_ADAPTER 0x1f +#define IPR_TYPE_EMPTY_SLOT 0xff #define IPR_IS_DASD_DEVICE(std_inq_data) \ ((((std_inq_data).peri_dev_type) == TYPE_DISK) && !((std_inq_data).removeable_medium)) @@ -638,9 +639,15 @@ #define IPR_DEFAULT_RAID_LVL "5" #if defined (__BIG_ENDIAN_BITFIELD) u8 include_allowed:1; - u8 reserved:7; + u8 reserved:5; + u8 format_overlay_type:2; + +#define IPR_FORMAT_ADD_DEVICES 1 +#define IPR_FORMAT_REMOVE_DEVICES 2 + #elif defined (__LITTLE_ENDIAN_BITFIELD) - u8 reserved:7; + u8 format_overlay_type:2; + u8 reserved:5; u8 include_allowed:1; #endif u16 reserved2; @@ -686,7 +693,8 @@ u8 start_cand:1; u8 stop_cand:1; u8 resync_cand:1; - u8 reserved4:5; + u8 migrate_cand:1; + u8 reserved4:4; #elif defined (__LITTLE_ENDIAN_BITFIELD) u8 reserved3:3; u8 no_config_entry:1; @@ -695,7 +703,8 @@ u8 exposed:1; u8 established:1; - u8 reserved4:5; + u8 reserved4:4; + u8 migrate_cand:1; u8 resync_cand:1; u8 stop_cand:1; u8 start_cand:1; @@ -746,7 +755,8 @@ u8 add_hot_spare_cand:1; u8 rmv_hot_spare_cand:1; - u8 reserved3:6; + u8 migrate_array_prot_cand:1; + u8 reserved3:5; #elif defined (__LITTLE_ENDIAN_BITFIELD) u8 reserved2:2; u8 no_cfgte_dev:1; @@ -765,7 +775,8 @@ u8 parity_cand:1; u8 start_cand:1; - u8 reserved3:6; + u8 reserved3:5; + u8 migrate_array_prot_cand:1; u8 rmv_hot_spare_cand:1; u8 add_hot_spare_cand:1; #endif @@ -788,6 +799,10 @@ ((unsigned long)rcd) < ((unsigned long)((qac)->data + sizeof((qac)->data))); \ rcd = (type *)((unsigned long)rcd + ntohs(((struct ipr_common_record *)rcd)->record_len))) +#define for_each_supported_arrays_rcd(rcd, qac) \ + __for_each_qac_entry(rcd, qac, struct ipr_supported_arrays) \ + if (rcd->common.record_id == IPR_RECORD_ID_SUPPORTED_ARRAYS) + #define for_each_qac_entry(rcd, qac) \ __for_each_qac_entry(rcd, qac, struct ipr_common_record) @@ -1783,7 +1798,7 @@ #define IPR_PATH_NOT_ACTIVE 0x80 #define IPR_PATH_STATE_MASK 0x0F -#define IPR_PATH_STATE_NO_INFO 0x00 +#define IPR_PATH_STATE_NO_INFO 0x00 #define IPR_PATH_HEALTHY 0x01 #define IPR_PATH_DEGRADED 0x02 #define IPR_PATH_FAILED 0x03 @@ -1979,11 +1994,12 @@ int set_preferred_primary(struct ipr_ioa *, int); void check_current_config(bool); int num_device_opens(int, int, int, int); +int open_and_lock(char *); void tool_init(int); void exit_on_error(char *, ...); bool is_af_blocked(struct ipr_dev *, int); -int ipr_query_array_config(struct ipr_ioa *, bool, bool, int, void *); -int __ipr_query_array_config(struct ipr_ioa *, int, bool, bool, int, void *); +int ipr_query_array_config(struct ipr_ioa *, bool, bool, bool, int, void *); +int __ipr_query_array_config(struct ipr_ioa *, int, bool, bool, bool, int, void *); int ipr_query_command_status(struct ipr_dev *, void *); int ipr_mode_sense(struct ipr_dev *, u8, void *); int ipr_mode_select(struct ipr_dev *, void *, int); @@ -1999,6 +2015,8 @@ int ipr_stop_array_protection(struct ipr_ioa *); int ipr_remove_hot_spare(struct ipr_ioa *); int ipr_start_array_protection(struct ipr_ioa *, int, int); +int ipr_migrate_array_protection(struct ipr_ioa *, + struct ipr_array_query_data *, int, int, int); int ipr_add_hot_spare(struct ipr_ioa *); int ipr_rebuild_device_data(struct ipr_ioa *); int ipr_resync_array(struct ipr_ioa *); Index: iprconfig.h =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprconfig.h,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- iprconfig.h 25 Apr 2007 16:07:15 -0000 1.48 +++ iprconfig.h 14 Aug 2008 01:12:54 -0000 1.49 @@ -12,30 +12,31 @@ **/ #include <libintl.h> + #define _(string) gettext(string) #define __(string) (string) -#define EXIT_FLAG 0x8000 /* stops at given screen on exit call */ -#define CANCEL_FLAG 0x4000 /* stops at given screen on quit call */ -#define REFRESH_FLAG 0x2000 /* refreshes screen on quit or exit */ -#define TOGGLE_FLAG 0x1000 -#define FWD_FLAG 0x0800 -#define CONFIRM_FLAG 0x0400 -#define CONFIRM_REC_FLAG 0x0200 -#define MENU_FLAG 0x0100 -#define ENTER_FLAG 0x0080 +#define EXIT_FLAG 0x8000 /* stops at given screen on exit call */ +#define CANCEL_FLAG 0x4000 /* stops at given screen on quit call */ +#define REFRESH_FLAG 0x2000 /* refreshes screen on quit or exit */ +#define TOGGLE_FLAG 0x1000 +#define FWD_FLAG 0x0800 +#define CONFIRM_FLAG 0x0400 +#define CONFIRM_REC_FLAG 0x0200 +#define MENU_FLAG 0x0100 +#define ENTER_FLAG 0x0080 #define NUM_OPTS(x) (sizeof(x)/sizeof(struct screen_opts)) -#define REFRESH_SCREEN -13 -#define TOGGLE_SCREEN -14 +#define REFRESH_SCREEN -13 +#define TOGGLE_SCREEN -14 -#define INVALID_OPTION_STATUS 2 -#define PGUP_STATUS 3 -#define TOP_STATUS 4 -#define PGDN_STATUS 5 -#define BTM_STATUS 6 +#define INVALID_OPTION_STATUS 2 +#define PGUP_STATUS 3 +#define TOP_STATUS 4 +#define PGDN_STATUS 5 +#define BTM_STATUS 6 -#define MAX_FIELD_SIZE 39 +#define MAX_FIELD_SIZE 39 typedef struct info_container i_container; @@ -43,8 +44,8 @@ i_container *next_item; /* reference to next info_container */ char field_data[MAX_FIELD_SIZE + 1]; /* stores characters entered into a user-entry field */ void *data; /* stores a field pointer */ - int y; /* cursor y position of user selection */ - int x; /* cursor x position of user selection */ + int y; /* cursor y position of user selection */ + int x; /* cursor x position of user selection */ }; #define for_each_icon(icon) for (icon = i_con_head; icon; icon = icon->next_item) @@ -107,6 +108,8 @@ int confirm_hot_spare(int action); int hot_spare_complete(int action); +int raid_migrate(i_container * i_con); + int raid_rebuild(i_container * i_con); int confirm_raid_rebuild(i_container * i_con); int raid_resync(i_container * i_con); @@ -144,6 +147,8 @@ int ibm_boot_log(i_container *); int exit_confirmed(i_container *); +static int raid_create_check_num_devs(struct ipr_array_cap_entry *, int, int); + /* constant strings */ const char *no_dev_found = __("No devices found"); const char *wait_for_next_screen = __("Please wait for the next screen."); @@ -260,6 +265,68 @@ {add_hot_spare, "7", __("Create a hot spare")}, {remove_hot_spare, "8", __("Delete a hot spare")}, {raid_resync, "9", __("Force RAID Consistency Check")}, + {raid_migrate, "0", __("Migrate disk array protection")}, +}; + +s_node n_raid_migrate_complete = { + .title = __("Migrate Disk Array Status"), + .body = __("You selected to migrate a disk array") +}; + +s_node n_confirm_raid_migrate = { + .rc_flags = (CANCEL_FLAG), + .f_flags = (CANCEL_FLAG | TOGGLE_FLAG | FWD_FLAG), + .num_opts = NUM_OPTS(null_opt), + .options = &null_opt[0], + .title = __("Confirm Migrate a Disk Array"), + .header = { + __("ATTENTION: Disk array will be migrated.\n\n"), + __("Press Enter to continue.\n"), + __(" q=Cancel to return and change your choice.\n\n"), + "" } +}; + +s_node n_raid_migrate = { + .rc_flags = (EXIT_FLAG | CANCEL_FLAG | REFRESH_FLAG), + .f_flags = (EXIT_FLAG | CANCEL_FLAG | TOGGLE_FLAG | FWD_FLAG ), + .num_opts = NUM_OPTS(null_opt), + .options = &null_opt[0], + .title = __("Migrate Disk Array Protection"), + .header = { + __("Select only one disk array for migration.\n\n"), + __("Type choice, press Enter.\n"), + __(" 1=migrate protection for a disk array\n\n"), + "" } +}; + +s_node n_raid_migrate_fail = { + .f_flags = (ENTER_FLAG | EXIT_FLAG | CANCEL_FLAG), + .title = __("Disk Array Migration Failed"), + .header = { + __("There are no arrays eligible for the selected operation " + "due to one or more of the following reasons:\n\n"), + __("o There are no disk arrays in the system.\n"), + __("o An IOA is in a condition that makes the disks attached to " + "it read/write protected. Examine the kernel messages log " + "for any errors that are logged for the IO subsystem " + "and follow the appropriate procedure for the reference " + "code to correct the problem, if necessary.\n"), + __("o Not all disks attached to an advanced function IOA have" + "reported to the system. Retry the operation.\n"), + __("o There are not enough unused AF disks for the migration.\n"), + "" } +}; + +s_node n_raid_migrate_add_disks = { + .rc_flags = (CANCEL_FLAG | REFRESH_FLAG), + .f_flags = (EXIT_FLAG | CANCEL_FLAG | TOGGLE_FLAG | FWD_FLAG), + .num_opts = NUM_OPTS(null_opt), + .options = &null_opt[0], + .title = __("Select Disk Units for Migration"), + .header = { + __("Type option, press Enter.\n"), + __(" 1=Select\n\n"), + "" } }; s_node n_raid_screen = { @@ -424,8 +491,8 @@ __("o An IOA is in a condition that makes the disks attached to " "it read/write protected. Examine the kernel messages log " "for any errors that are logged for the IO subsystem " - "and follow the appropriate procedure for the reference code to " - "correct the problem, if necessary.\n"), + "and follow the appropriate procedure for the reference " + "code to correct the problem, if necessary.\n"), __("o Not all disks attached to an advanced function IOA have" "reported to the system. Retry the operation.\n"), __("o The disks are missing.\n"), @@ -1424,8 +1491,8 @@ /* 63 */ __("Editor unchanged"), /* 64 */ __("Default log values restored"), /* 65 */ __("Editor returned %d. Try setting the default editor."), - /* 66 */ __("Failed to change disk configuration."), - /* 67 */ __("Microcode Download failed."), + /* 66 */ __("Failed to change disk configuration."), + /* 67 */ __("Microcode Download failed."), /* 68 */ __("Failed to enable IOA cache."), /* 69 */ __("Invalid number of devices selected."), /* 70 */ __("Failed to start IOA cache."), @@ -1435,7 +1502,98 @@ /* 74 */ __("RAID Consistency check successful"), /* 75 */ __("Failed to read error log. Try setting root kernel message log directory."), /* 76 */ __("No SAS disks available"), + /* 77 */ __("Too many disks were selected. The maximum is %d."), + /* 78 */ __("Too few disks were selected. The minimum is %d."), + /* 79 */ __("Migrate Array Protection completed successfully."), + /* 80 */ __("Migrate Array Protection failed."), + /* NOTE: 127 maximum limit */ }; -#endif +/* TODO - replace constants in iprconfig.c with the following enums/defines */ +enum { + RC_0_Success = 0, + RC_1_Blank, + RC_2_Invalid_Option, + RC_3_Screen_Up, + RC_4_At_Top, + RC_5_Screen_Down, + RC_6_At_Bottom, + RC_7_Blank, + RC_8_Blank, + RC_9_Blank, + RC_10_No_Devices, + RC_11_Blank, + RC_12_Blank, + RC_13_Blank, + RC_14_Blank, + RC_15_Invalid_Selection, + RC_16_More_Than_One_Dev, + RC_17_Invalid_Option, + RC_18_Array_Created, + RC_19_Create_Fail, + RC_20_Delete_Fail, + RC_21_Delete_Success, + RC_22_Blank, + RC_23_Blank, + RC_24_Blank, + RC_25_Devices_Multiple, + RC_26_Add_Fail, + RC_27_Add_Success, + RC_28_Rebuild_Started, + RC_29_Rebuild_Fail, + RC_30_Maint_Fail, + RC_31_Maint_Fail_In_Use, + RC_32_Maint_Success, + RC_33_No_Units, + RC_34_Init_Format_Success, + RC_35_Init_Format_Fail, + RC_36_Reclaim_Cache_Success, + RC_37_Reclaim_Cache_Fail, + RC_38_No_Reclaim_Needed, + RC_39_No_Reclaim_Performed, + RC_40_Rebuild_Started, + RC_41_Rebuild_Failed, + RC_42_Battery_Err_State_Success, + RC_43_Battery_Err_State_Fail, + RC_44_No_Battery_Pack, + RC_45_Change_Bus_Conf_Success, + RC_46_Change_Bus_Conf_Fail, + RC_47_Change_Driver_Conf_Success, + RC_48_Change_Driver_Conf_Fail, + RC_49_No_Units_Available, + RC_50_Init_Format_Success, + RC_51_Init_Format_Fail, + RC_52_No_Devices_Available, + RC_53_Hot_Spare_Created, + RC_54_Hot_Spare_Deleted, + RC_55_Failed_Create, + RC_56_Failed_Delete, + RC_57_Change_Driver_Conf_Success, + RC_58_Change_Driver_Conf_Fail, + RC_59_Invalid_Dir, + RC_60_Root_Changed, + RC_61_Root_Unchanged, + RC_62_Editor_Changed, + RC_63_Editor_Unchanged, + RC_64_Log_Restored, + RC_65_Set_Default_Editor, + RC_66_Disk_Conf_Fail, + RC_67_uCode_Download_Fail, + RC_68_Cache_Enable_Fail, + RC_69_Invalid_Number_Devs, + RC_70_Cache_Start_Fail, + RC_71_Cache_Start_Success, + RC_72_Battery_Err_State, + RC_73_Force_Check_Fail, + RC_74_Check_Success, + RC_75_Failed_Read_Err_Log, + RC_76_No_SAS_Disks, + RC_77_Too_Many_Disks, + RC_78_Too_Few_Disks, + RC_79_Migrate_Prot_Success, + RC_80_Migrate_Prot_Fail, + /* NOTE: 127 maximum limit */ +}; + +#endif /* iprconfig_h */ Index: version.mk =================================================================== RCS file: /cvsroot/iprdd/iprutils/version.mk,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- version.mk 9 Apr 2008 20:07:50 -0000 1.68 +++ version.mk 14 Aug 2008 01:12:54 -0000 1.69 @@ -6,9 +6,9 @@ IPR_MAJOR_RELEASE=2 IPR_MINOR_RELEASE=2 -IPR_FIX_LEVEL=9 +IPR_FIX_LEVEL=10 IPR_RELEASE=1 -IPR_FIX_DATE=(April 9, 2008) +IPR_FIX_DATE=(August 13, 2008) IPR_VERSION_STR=$(IPR_MAJOR_RELEASE).$(IPR_MINOR_RELEASE).$(IPR_FIX_LEVEL) $(IPR_FIX_DATE) Index: iprconfig.8 =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprconfig.8,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- iprconfig.8 4 Sep 2007 21:05:10 -0000 1.19 +++ iprconfig.8 14 Aug 2008 01:12:52 -0000 1.20 @@ -366,6 +366,31 @@ .br Show the current dual path details for the specified SAS device. .TP +.B query-arrays-raid-migrate +.br +Show the arrays that can be migrated to a different protection level. +.TP +.B query-devices-raid-migrate [array] +.br +Show the AF disks that are candidates to be used in a migration for a given +array. +.TP +.B query-raid-levels-raid-migrate [array] +.br +Show the protection levels to which the given array can be migrated. +.TP +.B query-stripe-sizes-raid-migrate [array] [raid level] +.br +Given an array and a protection level, show the valid stripe sizes to which +the array can be migrated. +.TP +.B query-devices-min-max-raid-migrate [array] [raid level] +.br +Show the number of devices that will be removed for a migration to a protection +level that requires fewer devices. Or, show the minmum number of devices +required, the maximum number of devices allowed and the multiple of the number +of devices required for a migration that requires more devices. +.TP .B raid-create [-r raid_level] [-s stripe_size_in_kb] [devices...] Create a RAID array. RAID level can be any supported RAID level for the given adapter, such as 0, 10, 5, 6. Currently supported stripe sizes in kb @@ -395,6 +420,15 @@ .br .B iprconfig -c raid-include sda sg6 sg7 .TP +.B raid-migrate -r raid_level [-s stripe_size_in_kb] array [disk] ... [disk] +.br +Migrate an existing RAID array to a new RAID protection level. Optionally, +a new stripe size can be given. In some cases one or more new disks must be +added for the migration to succeed. +Example: +.br +.B iprconfig -c raid-migrate -r 10 -s 64 sda sg5 sg6 +.TP .B format-for-raid [disk] ... [disk] .br Format the specified disks for Advanced Function so they can be used in |
From: Roman R. <rr...@re...> - 2008-08-07 12:53:58
|
Hi, if you install iprutils on machine without ipr adapter, there are some daemons running (iprinit, iprupdate, ...). I write patch which solve this problem. But I know there can be better solution for this problem. What do you think about this problem and this patch? Thanks. |
From: Tseng-Hui \(Frank\) L. <tse...@us...> - 2008-05-14 20:20:05
|
Update of /cvsroot/iprdd/iprutils/spec In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv15590/iprutils/spec Modified Files: iprutils.spec Log Message: Change disk microcode download device to /dev/sdX Index: iprutils.spec =================================================================== RCS file: /cvsroot/iprdd/iprutils/spec/iprutils.spec,v retrieving revision 1.89 retrieving revision 1.90 diff -u -d -r1.89 -r1.90 --- iprutils.spec 9 Apr 2008 19:55:20 -0000 1.89 +++ iprutils.spec 14 May 2008 20:17:11 -0000 1.90 @@ -81,6 +81,11 @@ %{_sysconfdir}/ha.d/resource.d/iprha %changelog +* Wed May 14 2008 Tseng-Hui Lin <tse...@us...> +- Under heavy traffic, download microcode to a disk through /dev/sgX + may get -ENOMEM SG_IO ioctl. Change to use /dev/sdX. Fall back + to /dev/sgX if: (1) /dev/sdX does not exist or (2) max_sectors_kb + is not set large enough for microcode download. * Thu Apr 09 2008 Tseng-Hui Lin <tse...@us...> 2.2.9 - Release 2.2.9 - Do not save preferred primary attribute to fix an infinite failover |
From: Tseng-Hui \(Frank\) L. <tse...@us...> - 2008-05-14 20:17:15
|
Update of /cvsroot/iprdd/iprutils In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv15590/iprutils Modified Files: iprlib.c Log Message: Change disk microcode download device to /dev/sdX Index: iprlib.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.c,v retrieving revision 1.117 retrieving revision 1.118 diff -u -d -r1.117 -r1.118 --- iprlib.c 9 Apr 2008 19:34:51 -0000 1.117 +++ iprlib.c 14 May 2008 20:17:08 -0000 1.118 @@ -346,6 +346,14 @@ {"VSBPD1H U3SCSI", "XXXXXXX*XXXXXXXX", 160, 0} }; + +/*---------- static subroutine/function declearation starts here --------*/ + +static int sg_ioctl_by_name(char *, u8 *, void *, u32, u32, + struct sense_data_t *, u32); + +/*---------- subroutine/function code starts here ---------*/ + static const struct ses_table_entry *get_ses_entry(struct ipr_ioa *ioa, int bus) { int i, j, matches; @@ -2873,24 +2881,25 @@ return rc; } +/* + * Issue WRITE_BUFFER command. + * In older kernels, max_sectors_kb is not big enough and would return + * -EIO when using dev_name to issue SG_IO ioctl(). In that case, we have + * to use gen_name. Also, in case dev_name does not exist, we need to use + * gen_name. Hence, we try dev_name first and switch to gen_name if we get + * -ENOENT or -EIO. + */ + static int __ipr_write_buffer(struct ipr_dev *dev, u8 mode, void *buff, int length, struct sense_data_t *sense_data) { - char *name = get_write_buffer_dev(dev); u32 direction = length ? SG_DXFER_TO_DEV : SG_DXFER_NONE; u8 cdb[IPR_CCB_CDB_LEN]; - int fd, rc; + int rc; - if (strlen(name) == 0) + if ((strlen(dev->dev_name) == 0) && (strlen(dev->gen_name) == 0)) return -ENOENT; - fd = open(name, O_RDWR); - if (fd <= 1) { - if (!strcmp(tool_name, "iprconfig") || ipr_debug) - syslog(LOG_ERR, "Could not open %s.\n", name); - return errno; - } - memset(cdb, 0, IPR_CCB_CDB_LEN); cdb[0] = WRITE_BUFFER; @@ -2899,14 +2908,31 @@ cdb[7] = (length & 0x00ff00) >> 8; cdb[8] = length & 0x0000ff; - rc = sg_ioctl(fd, cdb, buff, - length, direction, - sense_data, IPR_WRITE_BUFFER_TIMEOUT); - - if (rc != 0) - scsi_cmd_err(dev, sense_data, "Write buffer", rc); + rc = sg_ioctl_by_name(dev->dev_name, cdb, buff, + length, direction, + sense_data, IPR_WRITE_BUFFER_TIMEOUT); + if (rc != 0) { + if ((rc == -ENOENT) || (rc == -EIO)) { + syslog_dbg("Write buffer failed on sd device %s. %m\n", dev->dev_name); + rc = sg_ioctl_by_name(dev->gen_name, cdb, buff, + length, direction, + sense_data, IPR_WRITE_BUFFER_TIMEOUT); + if (rc != 0) { + scsi_cmd_err(dev, sense_data, + "Write buffer using sg device", rc); + if (rc == -ENOMEM) + syslog(LOG_ERR, + "Cannot get enough memory to " + "perform microcode download " + "through %s. Reduce system " + "memory usage and try again.\n", + dev->gen_name); + } + } else + scsi_cmd_err(dev, sense_data, + "Write buffer using sd device", rc); + } - close(fd); return rc; } @@ -3261,8 +3287,15 @@ return 0; } +/* + * Scatter/gather list buffers are checked against the value returned + * by queue_dma_alignment(), which defaults to 511 in Linux 2.6, + * for alignment if a SG_IO ioctl request is sent through a /dev/sdX device. + */ +#define IPR_S_G_BUFF_ALIGNMENT 512 #define IPR_MAX_XFER 0x8000 + const int cdb_size[] ={6, 10, 10, 0, 16, 12, 16, 16}; static int _sg_ioctl(int fd, u8 cdb[IPR_CCB_CDB_LEN], void *data, u32 xfer_len, u32 data_direction, @@ -3287,7 +3320,7 @@ segment_size = IPR_MAX_XFER; for (i = 0; (i < iovec_count) && (buff_len != 0); i++) { - iovec[i].iov_base = malloc(segment_size); + posix_memalign(&(iovec[i].iov_base), IPR_S_G_BUFF_ALIGNMENT, segment_size); if (data_direction == SG_DXFER_TO_DEV) memcpy(iovec[i].iov_base, data + (IPR_MAX_XFER * i), segment_size); iovec[i].iov_len = segment_size; @@ -3366,6 +3399,31 @@ sense_data, timeout_in_sec, 0); }; +static int sg_ioctl_by_name(char *name, u8 cdb[IPR_CCB_CDB_LEN], + void *data, u32 xfer_len, u32 data_direction, + struct sense_data_t *sense_data, + u32 timeout_in_sec) +{ + int fd, rc; + + if (strlen(name) <= 0) + return -ENOENT; + + fd = open(name, O_RDWR); + if (fd <= 1) { + if (!strcmp(tool_name, "iprconfig") || ipr_debug) + syslog(LOG_ERR, "Could not open %s.\n", name); + return errno; + } + + rc = sg_ioctl(fd, cdb, data, + xfer_len, data_direction, + sense_data, timeout_in_sec); + close(fd); + + return rc; +} + int ipr_set_ha_mode(struct ipr_ioa *ioa, int gscsi_only_ha) { int rc, len; |
From: Roman R. <rr...@re...> - 2008-04-14 13:34:43
|
Hi. I'm new maintainer of iprutils in Red Hat. Now I have feature request in bugzilla: Update iprutil to support the PCI-E SAS RAID and non-RAID adapters on power6. on page https://bugzilla.redhat.com/show_bug.cgi?id=439437 you can see more details. Is this feature acceptable? Is there any other necessary things that I forgot? |
From: Tseng-Hui \(Frank\) L. <tse...@us...> - 2008-04-09 20:08:31
|
Update of /cvsroot/iprdd/iprutils In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6793/iprutils Modified Files: version.mk Log Message: Release 2.2.9 Index: version.mk =================================================================== RCS file: /cvsroot/iprdd/iprutils/version.mk,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- version.mk 9 Apr 2008 19:54:41 -0000 1.67 +++ version.mk 9 Apr 2008 20:07:50 -0000 1.68 @@ -6,8 +6,8 @@ IPR_MAJOR_RELEASE=2 IPR_MINOR_RELEASE=2 -IPR_FIX_LEVEL=8 -IPR_RELEASE=2 +IPR_FIX_LEVEL=9 +IPR_RELEASE=1 IPR_FIX_DATE=(April 9, 2008) IPR_VERSION_STR=$(IPR_MAJOR_RELEASE).$(IPR_MINOR_RELEASE).$(IPR_FIX_LEVEL) $(IPR_FIX_DATE) |
From: Tseng-Hui \(Frank\) L. <tse...@us...> - 2008-04-09 19:57:24
|
Update of /cvsroot/iprdd/iprutils/spec In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv1376/iprutils/spec Modified Files: iprutils.spec Log Message: Release 2.2.9 Index: iprutils.spec =================================================================== RCS file: /cvsroot/iprdd/iprutils/spec/iprutils.spec,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- iprutils.spec 20 Sep 2007 15:59:51 -0000 1.88 +++ iprutils.spec 9 Apr 2008 19:55:20 -0000 1.89 @@ -1,6 +1,6 @@ Summary: Utilities for the IBM Power Linux RAID adapters Name: iprutils -Version: 2.2.8 +Version: 2.2.9 Release: 1 License: CPL Group: System Environment/Base @@ -81,6 +81,10 @@ %{_sysconfdir}/ha.d/resource.d/iprha %changelog +* Thu Apr 09 2008 Tseng-Hui Lin <tse...@us...> 2.2.9 +- Release 2.2.9 +- Do not save preferred primary attribute to fix an infinite failover + problem in HA two system RAID configuration. * Thu Sep 20 2007 Brian King <br...@us...> 2.2.8 - Release 2.2.8 * Mon Aug 27 2007 Brian King <br...@us...> |
From: Tseng-Hui \(Frank\) L. <tse...@us...> - 2008-04-09 19:57:20
|
Update of /cvsroot/iprdd/iprutils In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv24406/iprutils Modified Files: iprlib.c Log Message: Do not save preferred_primary attribute Index: iprlib.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.c,v retrieving revision 1.116 retrieving revision 1.117 diff -u -d -r1.116 -r1.117 --- iprlib.c 4 Sep 2007 21:05:10 -0000 1.116 +++ iprlib.c 9 Apr 2008 19:34:51 -0000 1.117 @@ -3448,7 +3448,6 @@ sprintf(temp, "%d", preferred_primary); if (ipr_set_preferred_primary(ioa, preferred_primary)) return -EIO; - ipr_save_ioa_attr(ioa, IPR_DA_PREFERRED_PRIMARY, temp, 1); return 0; } @@ -4549,9 +4548,6 @@ char temp[100]; int rc; - rc = ipr_get_saved_ioa_attr(ioa, IPR_DA_PREFERRED_PRIMARY, temp); - if (rc == RC_SUCCESS) - sscanf(temp, "%d", &attr->preferred_primary); rc = ipr_get_saved_ioa_attr(ioa, IPR_GSCSI_HA_ONLY, temp); if (rc == RC_SUCCESS) sscanf(temp, "%d", &attr->gscsi_only_ha); @@ -4614,8 +4610,6 @@ sprintf(temp, "%d", attr->preferred_primary); if (ipr_set_preferred_primary(ioa, attr->preferred_primary)) return -EIO; - if (save) - ipr_save_ioa_attr(ioa, IPR_DA_PREFERRED_PRIMARY, temp, 1); } if (attr->gscsi_only_ha != old_attr.gscsi_only_ha) { |