Mercurial > illumos > illumos-gate
changeset 13072:9c2bff94c54d
PSARC 2010/182 Multiple IPoIB instances per PKEY
6949953 Add support for multiple IPoIB instances per PKEY
author | Pavan Chandrashekar <Pavan.Chandrashekar@Sun.COM> |
---|---|
date | Tue, 10 Aug 2010 17:27:21 -0400 |
parents | 07ea2c89e2a2 |
children | ee5bbe6d9a1a |
files | usr/src/uts/common/io/ib/clients/ibd/ibd.c usr/src/uts/common/io/ib/clients/ibd/ibd_cm.c |
diffstat | 2 files changed, 14 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/common/io/ib/clients/ibd/ibd.c Tue Aug 10 17:06:51 2010 -0400 +++ b/usr/src/uts/common/io/ib/clients/ibd/ibd.c Tue Aug 10 17:27:21 2010 -0400 @@ -598,16 +598,20 @@ ibd_print_warn(ibd_state_t *state, char *fmt, ...) { ib_guid_t hca_guid; - char ibd_print_buf[256]; + char ibd_print_buf[MAXNAMELEN + 256]; int len; va_list ap; + char part_name[MAXNAMELEN]; + datalink_id_t linkid = state->id_plinkid; hca_guid = ddi_prop_get_int64(DDI_DEV_T_ANY, state->id_dip, 0, "hca-guid", 0); + (void) dls_mgmt_get_linkinfo(linkid, part_name, NULL, NULL, NULL); len = snprintf(ibd_print_buf, sizeof (ibd_print_buf), - "%s%d: HCA GUID %016llx port %d PKEY %02x ", + "%s%d: HCA GUID %016llx port %d PKEY %02x link %s ", ddi_driver_name(state->id_dip), ddi_get_instance(state->id_dip), - (u_longlong_t)hca_guid, state->id_port, state->id_pkey); + (u_longlong_t)hca_guid, state->id_port, state->id_pkey, + part_name); va_start(ap, fmt); (void) vsnprintf(ibd_print_buf + len, sizeof (ibd_print_buf) - len, fmt, ap); @@ -2870,8 +2874,8 @@ state->id_rx_list.dl_cnt = 0; mutex_init(&state->id_rx_list.dl_mutex, NULL, MUTEX_DRIVER, NULL); mutex_init(&state->id_rx_free_list.dl_mutex, NULL, MUTEX_DRIVER, NULL); - (void) sprintf(buf, "ibd_req%d_%x", ddi_get_instance(dip), - state->id_pkey); + (void) sprintf(buf, "ibd_req%d_%x_%u", ddi_get_instance(dip), + state->id_pkey, state->id_plinkid); state->id_req_kmc = kmem_cache_create(buf, sizeof (ibd_req_t), 0, NULL, NULL, NULL, NULL, NULL, 0); @@ -8222,7 +8226,8 @@ mutex_enter(&ibd_objlist_lock); for (p = ibd_objlist_head; p; p = p->id_next) { if ((p->id_port_inst == cmd->ibdioc.ioc_port_inst) && - (p->id_pkey == cmd->ioc_pkey)) { + (p->id_pkey == cmd->ioc_pkey) && + (p->id_plinkid == cmd->ioc_partid)) { mutex_exit(&ibd_objlist_lock); rval = EEXIST; cmd->ibdioc.ioc_status = IBD_PARTITION_EXISTS; @@ -8334,7 +8339,7 @@ mutex_enter(&ibd_objlist_lock); node = ibd_objlist_head; - /* Find the ibd state structure corresponding the partion */ + /* Find the ibd state structure corresponding to the partition */ while (node != NULL) { if (node->id_plinkid == cmd->ioc_partid) break;
--- a/usr/src/uts/common/io/ib/clients/ibd/ibd_cm.c Tue Aug 10 17:06:51 2010 -0400 +++ b/usr/src/uts/common/io/ib/clients/ibd/ibd_cm.c Tue Aug 10 17:27:21 2010 -0400 @@ -465,8 +465,8 @@ * Create and init kstat */ inst = ddi_get_instance(state->id_dip); - (void) snprintf(stat_name, KSTAT_STRLEN, "statistics%d_%x", inst, - state->id_pkey); + (void) snprintf(stat_name, KSTAT_STRLEN, "statistics%d_%x_%u", inst, + state->id_pkey, state->id_plinkid); ksp = kstat_create("ibd", 0, stat_name, "net", KSTAT_TYPE_NAMED, sizeof (ibd_rc_stat_t) / sizeof (kstat_named_t), 0);