diff options
author | Ramaswamy Tummala <Ramaswamy.Tummala@Sun.COM> | 2008-11-11 13:14:57 -0800 |
---|---|---|
committer | Ramaswamy Tummala <Ramaswamy.Tummala@Sun.COM> | 2008-11-11 13:14:57 -0800 |
commit | 00a3eaf3896a33935e11fd5c5fb5c1714225c067 (patch) | |
tree | 3ea400ad9807f014d695cc03c10ee70584a81fcb /usr/src/lib/cfgadm_plugins | |
parent | 6f02aa444eb77edda1b97ff8a1215c417932a62e (diff) | |
download | illumos-gate-00a3eaf3896a33935e11fd5c5fb5c1714225c067.tar.gz |
6566278 Panic when ibd is configured after HCA is unconfigured and configured
6727497 IB nexus should create one pathinfo node per HCA per IB nexus child
6726179 ls -l /devices/ib shows zero devices nodes after doing rem_drv and add_drv of HCA driver
6368026 IOC enumeration issues in multi HCA system
6745259 Calling ddi_remove_minor_node in async thread causes deadlock
6500304 RDS: Support HCA DR
6739584 The 'cfgadm -x list_clients' command has a display problem
6739581 The output of 'cfgadm -x unconfig_clients' command doesn't display the HCA ap_id correctly
6759972 ibmf_unregister() returned busy during HCA unconfigure operation
6754808 IB Stack should recover from HCA unconfigure failures
6725241 ibdm_handle_hca_detach() should update ibdm.ibdm_hca_list_tail pointer
6751608 panic when configuring an IB HCA child
6607950 raise IB port settling time
Diffstat (limited to 'usr/src/lib/cfgadm_plugins')
-rw-r--r-- | usr/src/lib/cfgadm_plugins/ib/common/cfga_ib.c | 48 | ||||
-rw-r--r-- | usr/src/lib/cfgadm_plugins/ib/common/cfga_ib.h | 11 |
2 files changed, 13 insertions, 46 deletions
diff --git a/usr/src/lib/cfgadm_plugins/ib/common/cfga_ib.c b/usr/src/lib/cfgadm_plugins/ib/common/cfga_ib.c index fe8284cd14..164eb8b5ee 100644 --- a/usr/src/lib/cfgadm_plugins/ib/common/cfga_ib.c +++ b/usr/src/lib/cfgadm_plugins/ib/common/cfga_ib.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "cfga_ib.h" /* @@ -864,8 +862,6 @@ cfga_change_state(cfga_cmd_t state_change_cmd, const char *ap_id, char **errstring, cfga_flags_t flags) { int ret; - int len; - char *msg; char *devpath; nvlist_t *nvl = NULL; boolean_t static_ap_id = B_TRUE; @@ -923,19 +919,10 @@ cfga_change_state(cfga_cmd_t state_change_cmd, const char *ap_id, rv = CFGA_IB_OK; /* Other status don't matter */ - len = strlen(IB_CONFIRM0) + strlen(IB_CONFIRM1) + - strlen("Configure") + strlen(ap_id); - if ((msg = (char *)calloc(len + 3, 1)) != NULL) { - (void) snprintf(msg, len + 3, "Configure %s%s\n%s", - IB_CONFIRM0, ap_id, IB_CONFIRM1); - } - - if (!ib_confirm(confp, msg)) { - free(msg); + if (!ib_confirm(confp, IB_CONFIRM1)) { ib_cleanup_after_devctl_cmd(hdl, nvl); return (CFGA_NACK); } - free(msg); if (devctl_ap_configure(hdl, nvl) != 0) { DPRINTF("cfga_change_state: devctl_ap_configure " @@ -986,19 +973,11 @@ cfga_change_state(cfga_cmd_t state_change_cmd, const char *ap_id, } rv = CFGA_IB_OK; /* Other statuses don't matter */ - len = strlen(IB_CONFIRM0) + strlen(IB_CONFIRM1) + - strlen("Unconfigure") + strlen(ap_id); - if ((msg = (char *)calloc(len + 3, 1)) != NULL) { - (void) snprintf(msg, len + 3, "Unconfigure %s%s\n%s", - IB_CONFIRM0, ap_id, IB_CONFIRM1); - } - if (!ib_confirm(confp, msg)) { - free(msg); + if (!ib_confirm(confp, IB_CONFIRM1)) { ib_cleanup_after_devctl_cmd(hdl, nvl); return (CFGA_NACK); } - free(msg); devpath = ib_get_devicepath(ap_id); if (devpath == NULL) { @@ -1127,7 +1106,7 @@ cfga_private_func(const char *func, const char *ap_id, const char *options, ap_id, errno)); } - if ((msg = (char *)calloc(80, 1)) == NULL) { + if ((msg = (char *)calloc(256, 1)) == NULL) { DPRINTF("cfga_private_func: malloc for msg failed. " "errno: %d\n", errno); return (ib_err_msg(errstring, CFGA_IB_ALLOC_FAIL, @@ -1152,7 +1131,7 @@ cfga_private_func(const char *func, const char *ap_id, const char *options, errno)); } - (void) snprintf(msg, 80, "Ap_Id\t\t\t IB Client\t\t " + (void) snprintf(msg, 256, "Ap_Id\t\t\t IB Client\t\t " "Alternate HCA\n"); cfga_msg(msgp, msg); @@ -1173,7 +1152,7 @@ cfga_private_func(const char *func, const char *ap_id, const char *options, /* check at the end; print message per client found */ if (count == 3) { count = 0; - (void) snprintf(msg, 80, "%-31s%-26s%s\n", + (void) snprintf(msg, 256, "%-30s %-25s %s\n", clnt_apid, clnt_name, alt_hca); cfga_msg(msgp, msg); } @@ -1201,19 +1180,12 @@ cfga_private_func(const char *func, const char *ap_id, const char *options, ap_id, errno)); } - /* Check w/ user if it is ok to do this operation */ - len = strlen(IB_CONFIRM2) + strlen(IB_CONFIRM3) + strlen(ap_id); - if ((msg = (char *)calloc(len + 3, 1)) != NULL) { - (void) snprintf(msg, len + 3, "%s %s\n%s", - IB_CONFIRM2, ap_id, IB_CONFIRM3); - } - - /* If the user fails to confirm, bailout */ - if (!ib_confirm(confp, msg)) { - free(msg); + /* + * Check w/ user if it is ok to do this operation + * If the user fails to confirm, bailout + */ + if (!ib_confirm(confp, IB_CONFIRM3)) return (CFGA_NACK); - } - free(msg); /* Get device-paths of all the IOC/Port/Pseudo devices */ rv = ib_do_control_ioctl((char *)ap_id, IBNEX_UNCFG_CLNTS_SZ, diff --git a/usr/src/lib/cfgadm_plugins/ib/common/cfga_ib.h b/usr/src/lib/cfgadm_plugins/ib/common/cfga_ib.h index a4e9c04fee..1c07e5c013 100644 --- a/usr/src/lib/cfgadm_plugins/ib/common/cfga_ib.h +++ b/usr/src/lib/cfgadm_plugins/ib/common/cfga_ib.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,15 +19,13 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _CFGA_IB_H #define _CFGA_IB_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -200,10 +197,8 @@ typedef enum { /* config */ /* for confirm operation */ -#define IB_CONFIRM0 "the device: " #define IB_CONFIRM1 \ "This operation will suspend activity on the IB device\nContinue" -#define IB_CONFIRM2 "Unconfigure Clients of HCA" #define IB_CONFIRM3 \ "This operation will unconfigure IB clients of this HCA\nContinue" #define IB_CONFIRM4 \ |