[Iprdd-commit] iprutils Makefile, 1.27, 1.28 iprconfig.c, 1.137, 1.138 iprconfig.h, 1.52, 1.53 iprl
Brought to you by:
brking
|
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) |