changeset 2927:24b93d531b71

6471451 Thumper: kernel panic occurred after running ttcp stress test for a few hours
author pramodbg
date Mon, 16 Oct 2006 11:43:32 -0700
parents acfcfefbc60d
children b5d8eb79c7da
files usr/src/uts/common/io/ib/mgt/ibdm/ibdm.c usr/src/uts/common/sys/ib/mgt/ibdm/ibdm_impl.h
diffstat 2 files changed, 35 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/ib/mgt/ibdm/ibdm.c	Mon Oct 16 10:35:01 2006 -0700
+++ b/usr/src/uts/common/io/ib/mgt/ibdm/ibdm.c	Mon Oct 16 11:43:32 2006 -0700
@@ -896,6 +896,7 @@
 ibdm_handle_hca_detach(ib_guid_t hca_guid)
 {
 	ibdm_hca_list_t		*head, *prev = NULL;
+	size_t			len;
 	ibdm_dp_gidinfo_t	*gidinfo;
 
 	IBTF_DPRINTF_L4("ibdm",
@@ -941,6 +942,11 @@
 				else
 					prev->hl_next = head->hl_next;
 
+				len = sizeof (ibdm_hca_list_t) +
+				    (head->hl_nports *
+				    sizeof (ibdm_port_attr_t));
+				kmem_free(head, len);
+
 				break;
 			}
 			prev = head;
@@ -4292,7 +4298,8 @@
 void
 ibdm_ibnex_free_hca_list(ibdm_hca_list_t *hca_list)
 {
-	int			ii, len;
+	int			ii;
+	size_t			len;
 	ibdm_hca_list_t 	*temp;
 	ibdm_port_attr_t	*port;
 
@@ -5980,13 +5987,26 @@
 			IBTF_DPRINTF_L4(ibdm_string, "\tevent_hdlr "
 			    "checking gidinfo %p", gid_info);
 
-			if (gid_info->gl_nodeguid != 0 &&
-			    gid_info->gl_sa_hdl == port_sa_hdl) {
+			if (gid_info->gl_sa_hdl == port_sa_hdl) {
 				IBTF_DPRINTF_L3(ibdm_string,
 				    "\tevent_hdlr: down HCA port hdl "
 				    "matches gid %p", gid_info);
 
-				ibdm_reset_gidinfo(gid_info);
+				/*
+				 * The non-DM GIDs can come back
+				 * with a new subnet prefix, when
+				 * the HCA port commes up again. To
+				 * avoid issues, delete non-DM
+				 * capable GIDs, if the gid was
+				 * discovered using the HCA port
+				 * going down. This is ensured by
+				 * setting gl_disconnected to 1.
+				 */
+				if (gid_info->gl_nodeguid != 0)
+					gid_info->gl_disconnected = 1;
+				else
+					ibdm_reset_gidinfo(gid_info);
+
 				if (gid_info->gl_disconnected) {
 					IBTF_DPRINTF_L3(ibdm_string,
 					    "\tevent_hdlr: deleting"
@@ -6121,7 +6141,8 @@
 	 * != NULL, if gidinfo is the list.
 	 */
 	if (gidinfo->gl_prev != NULL ||
-	    gidinfo->gl_next != NULL)
+	    gidinfo->gl_next != NULL ||
+	    ibdm.ibdm_dp_gidlist_head == gidinfo)
 		in_gidlist = 1;
 
 	ioc_list = ibdm_update_ioc_gidlist(gidinfo, 0);
@@ -6138,6 +6159,11 @@
 		mutex_exit(&gidinfo->gl_mutex);
 	}
 
+	/* Delete gl_hca_list */
+	mutex_exit(&ibdm.ibdm_mutex);
+	ibdm_delete_glhca_list(gidinfo);
+	mutex_enter(&ibdm.ibdm_mutex);
+
 	if (in_gidlist) {
 		if (gidinfo->gl_prev != NULL)
 			gidinfo->gl_prev->gl_next = gidinfo->gl_next;
--- a/usr/src/uts/common/sys/ib/mgt/ibdm/ibdm_impl.h	Mon Oct 16 10:35:01 2006 -0700
+++ b/usr/src/uts/common/sys/ib/mgt/ibdm/ibdm_impl.h	Mon Oct 16 11:43:32 2006 -0700
@@ -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,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -213,7 +212,7 @@
  * The limits are sufficient for practical configurations.
  */
 #define	IBDM_GID_TRANSACTIONID_SHIFT	((ulong_t)32)
-#define	IBDM_GID_TRANSACTIONID_MASK	0xFFFFFFFF00000000
+#define	IBDM_GID_TRANSACTIONID_MASK	0xFFFFFFFF00000000ULL
 
 typedef struct ibdm_s {
 	/* Protects IBDM's critical data */