From 87dcbdbdce8044d5199e015edd8fb347d16ee0b5 Mon Sep 17 00:00:00 2001 From: Kevin Yu Date: Thu, 3 Dec 2009 11:04:52 +0800 Subject: 6902058 Panic found while running 'fcadm create-fcoe-port -t nxge1' 6905824 fcoet should register port_fca_version to fct via fct_register_local_port --- usr/src/uts/common/io/comstar/port/fcoet/fcoet.c | 1 + usr/src/uts/common/io/comstar/port/fcoet/fcoet.h | 2 +- usr/src/uts/common/io/fcoe/fcoe.c | 27 +++++++++++++++++++++--- 3 files changed, 26 insertions(+), 4 deletions(-) (limited to 'usr/src') diff --git a/usr/src/uts/common/io/comstar/port/fcoet/fcoet.c b/usr/src/uts/common/io/comstar/port/fcoet/fcoet.c index 6271f35b86..60362ef123 100644 --- a/usr/src/uts/common/io/comstar/port/fcoet/fcoet.c +++ b/usr/src/uts/common/io/comstar/port/fcoet/fcoet.c @@ -548,6 +548,7 @@ fcoet_attach_init(fcoet_soft_state_t *ss) * port_fct_private and port_lport have been initialized by fct_alloc */ port->port_fca_private = ss; + port->port_fca_version = FCT_FCA_MODREV_1; bcopy(ss->ss_eport->eport_nodewwn, port->port_nwwn, 8); bcopy(ss->ss_eport->eport_portwwn, port->port_pwwn, 8); port->port_default_alias = ss->ss_alias; diff --git a/usr/src/uts/common/io/comstar/port/fcoet/fcoet.h b/usr/src/uts/common/io/comstar/port/fcoet/fcoet.h index d1bf7db1ff..b5e5154583 100644 --- a/usr/src/uts/common/io/comstar/port/fcoet/fcoet.h +++ b/usr/src/uts/common/io/comstar/port/fcoet/fcoet.h @@ -33,7 +33,7 @@ extern "C" { #ifdef _KERNEL -#define FCOET_VERSION "v20090729-1.01" +#define FCOET_VERSION "v20091123-1.02" #define FCOET_NAME "COMSTAR FCoET " #define FCOET_MOD_NAME FCOET_NAME FCOET_VERSION diff --git a/usr/src/uts/common/io/fcoe/fcoe.c b/usr/src/uts/common/io/fcoe/fcoe.c index f4cc784350..5c58dfb01c 100644 --- a/usr/src/uts/common/io/fcoe/fcoe.c +++ b/usr/src/uts/common/io/fcoe/fcoe.c @@ -123,6 +123,7 @@ static void fcoe_worker_init(); static int fcoe_worker_fini(); static void fcoe_worker_frame(); static int fcoe_get_port_list(fcoe_port_instance_t *ports, int count); +static boolean_t fcoe_mac_existed(fcoe_mac_t *pmac); /* * Driver identificaton stuff @@ -195,7 +196,7 @@ static struct dev_ops fcoe_ops = { ddi_quiesce_not_needed }; -#define FCOE_VERSION "20090729-1.01" +#define FCOE_VERSION "20091123-1.02" #define FCOE_NAME "FCoE Transport v" FCOE_VERSION #define TASKQ_NAME_LEN 32 @@ -748,8 +749,10 @@ fcoe_iocmd(fcoe_soft_state_t *ss, intptr_t data, int mode) fcoe_mac, (param->fcp_port_type == FCOE_CLIENT_TARGET)); if (ret != 0) { - (void) fcoe_close_mac(fcoe_mac); - fcoe_destroy_mac(fcoe_mac); + if (fcoe_mac_existed(fcoe_mac) == B_TRUE) { + (void) fcoe_close_mac(fcoe_mac); + fcoe_destroy_mac(fcoe_mac); + } fcoeio->fcoeio_status = FCOEIOE_CREATE_PORT; ret = EIO; } @@ -950,6 +953,24 @@ fcoe_lookup_mac_by_id(datalink_id_t linkid) return (NULL); } +/* + * Return B_TRUE if mac exists, or else return B_FALSE + */ +static boolean_t +fcoe_mac_existed(fcoe_mac_t *pmac) +{ + fcoe_mac_t *mac = NULL; + + ASSERT(MUTEX_HELD(&fcoe_global_ss->ss_ioctl_mutex)); + for (mac = list_head(&fcoe_global_ss->ss_mac_list); mac; + mac = list_next(&fcoe_global_ss->ss_mac_list, mac)) { + if (mac == pmac) { + return (B_TRUE); + } + } + return (B_FALSE); +} + /* * port wwn will start with 20:..., node wwn will start with 10:... */ -- cgit v1.2.3