changeset 2893:6f6187d05358

6472389 gldv3 drivers hang during ifconfig -a modlist after ifconfig down ifconfig up
author ja97890
date Tue, 10 Oct 2006 06:05:36 -0700
parents d74b72d9df2e
children 464fc76e8ce1
files usr/src/uts/common/inet/ip.h usr/src/uts/common/inet/ip/ip.c usr/src/uts/common/inet/ip/ip_if.c usr/src/uts/common/inet/ip/ip_multi.c usr/src/uts/common/inet/ip/ip_ndp.c usr/src/uts/common/io/dls/dls_soft_ring.c
diffstat 6 files changed, 52 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/inet/ip.h	Tue Oct 10 01:33:41 2006 -0700
+++ b/usr/src/uts/common/inet/ip.h	Tue Oct 10 06:05:36 2006 -0700
@@ -1845,13 +1845,13 @@
 	uint_t	ill_frag_free_num_pkts;	 /* num of fragmented packets to free */
 	clock_t	ill_last_frag_clean_time; /* time when frag's were pruned */
 	int	ill_type;		/* From <net/if_types.h> */
-	uint_t	ill_dlpi_multicast_state;	/* See below IDMS_* */
-	uint_t	ill_dlpi_fastpath_state;	/* See below IDMS_* */
+	uint_t	ill_dlpi_multicast_state;	/* See below IDS_* */
+	uint_t	ill_dlpi_fastpath_state;	/* See below IDS_* */
 
 	/*
 	 * Capabilities related fields.
 	 */
-	uint_t  ill_capab_state;	/* State of capability query, IDMS_* */
+	uint_t  ill_dlpi_capab_state;	/* State of capability query, IDS_* */
 	uint64_t ill_capabilities;	/* Enabled capabilities, ILL_CAPAB_* */
 	ill_mdt_capab_t	*ill_mdt_capab;	/* Multidata Transmit capabilities */
 	ill_ipsec_capab_t *ill_ipsec_capab_ah;	/* IPsec AH capabilities */
@@ -2135,12 +2135,13 @@
  * State for detecting if a driver supports certain features.
  * Support for DL_ENABMULTI_REQ uses ill_dlpi_multicast_state.
  * Support for DLPI M_DATA fastpath uses ill_dlpi_fastpath_state.
+ * Support for DL_CAPABILITY_REQ uses ill_dlpi_capab_state.
  */
-#define	IDMS_UNKNOWN	0	/* No DL_ENABMULTI_REQ sent */
-#define	IDMS_INPROGRESS	1	/* Sent DL_ENABMULTI_REQ */
-#define	IDMS_OK		2	/* DL_ENABMULTI_REQ ok */
-#define	IDMS_FAILED	3	/* DL_ENABMULTI_REQ failed */
-#define	IDMS_RENEG	4	/* Driver asked for a renegotiation */
+#define	IDS_UNKNOWN	0	/* No DLPI request sent */
+#define	IDS_INPROGRESS	1	/* DLPI request sent */
+#define	IDS_OK		2	/* DLPI request completed successfully */
+#define	IDS_FAILED	3	/* DLPI request failed */
+#define	IDS_RENEG	4	/* Driver asked for a renegotiation */
 
 /* Named Dispatch Parameter Management Structure */
 typedef struct ipparam_s {
--- a/usr/src/uts/common/inet/ip/ip.c	Tue Oct 10 01:33:41 2006 -0700
+++ b/usr/src/uts/common/inet/ip/ip.c	Tue Oct 10 06:05:36 2006 -0700
@@ -14972,8 +14972,8 @@
 			    CUR_OP, B_FALSE);
 			return;
 		case DL_ENABMULTI_REQ:
-			if (ill->ill_dlpi_multicast_state == IDMS_INPROGRESS)
-				ill->ill_dlpi_multicast_state = IDMS_OK;
+			if (ill->ill_dlpi_multicast_state == IDS_INPROGRESS)
+				ill->ill_dlpi_multicast_state = IDS_OK;
 			break;
 
 		}
@@ -15119,9 +15119,9 @@
 		case DL_ENABMULTI_REQ:
 			ip1dbg(("DL_ERROR_ACK to enabmulti\n"));
 
-			if (ill->ill_dlpi_multicast_state == IDMS_INPROGRESS)
-				ill->ill_dlpi_multicast_state = IDMS_FAILED;
-			if (ill->ill_dlpi_multicast_state == IDMS_FAILED) {
+			if (ill->ill_dlpi_multicast_state == IDS_INPROGRESS)
+				ill->ill_dlpi_multicast_state = IDS_FAILED;
+			if (ill->ill_dlpi_multicast_state == IDS_FAILED) {
 				ipif_t *ipif;
 
 				log = B_FALSE;
@@ -15156,7 +15156,7 @@
 			ip1dbg(("ip_rput_dlpi_writer: got DL_ERROR_ACK for "
 			    "DL_CAPABILITY/CONTROL REQ\n"));
 			ill_dlpi_done(ill, dlea->dl_error_primitive);
-			ill->ill_capab_state = IDMS_FAILED;
+			ill->ill_dlpi_capab_state = IDS_FAILED;
 			freemsg(mp);
 			return;
 		}
@@ -15203,10 +15203,10 @@
 		 * Check if the ACK is due to renegotiation case since we
 		 * will need to send a new CAPABILITY_REQ later.
 		 */
-		if (ill->ill_capab_state == IDMS_RENEG) {
+		if (ill->ill_dlpi_capab_state == IDS_RENEG) {
 			/* This is the ack for a renogiation case */
 			reneg_flag = B_TRUE;
-			ill->ill_capab_state = IDMS_UNKNOWN;
+			ill->ill_dlpi_capab_state = IDS_UNKNOWN;
 		}
 		ill_capability_ack(ill, mp);
 		if (reneg_flag)
@@ -15622,12 +15622,12 @@
 			 * port got added or went away.
 			 *
 			 * We reset the capabilities and set the
-			 * state to IDMS_RENG so that when the ack
+			 * state to IDS_RENG so that when the ack
 			 * comes back, we can start the
 			 * renegotiation process.
 			 */
 			ill_capability_reset(ill);
-			ill->ill_capab_state = IDMS_RENEG;
+			ill->ill_dlpi_capab_state = IDS_RENEG;
 			break;
 		default:
 			ip0dbg(("ip_rput_dlpi_writer: unknown notification "
@@ -15976,8 +15976,8 @@
 			 * fastpath probing.
 			 */
 			mutex_enter(&ill->ill_lock);
-			if (ill->ill_dlpi_fastpath_state == IDMS_INPROGRESS) {
-				ill->ill_dlpi_fastpath_state = IDMS_FAILED;
+			if (ill->ill_dlpi_fastpath_state == IDS_INPROGRESS) {
+				ill->ill_dlpi_fastpath_state = IDS_FAILED;
 				mutex_exit(&ill->ill_lock);
 				ill_fastpath_nack(ill);
 				ip1dbg(("ip_rput: DLPI fastpath off on "
--- a/usr/src/uts/common/inet/ip/ip_if.c	Tue Oct 10 01:33:41 2006 -0700
+++ b/usr/src/uts/common/inet/ip/ip_if.c	Tue Oct 10 06:05:36 2006 -0700
@@ -1699,8 +1699,8 @@
 	 * If this was the first attempt turn on the fastpath probing.
 	 */
 	mutex_enter(&ill->ill_lock);
-	if (ill->ill_dlpi_fastpath_state == IDMS_INPROGRESS)
-		ill->ill_dlpi_fastpath_state = IDMS_OK;
+	if (ill->ill_dlpi_fastpath_state == IDS_INPROGRESS)
+		ill->ill_dlpi_fastpath_state = IDS_OK;
 	mutex_exit(&ill->ill_lock);
 
 	/* Free the M_IOCACK mblk, hold on to the data */
@@ -1771,16 +1771,16 @@
 
 	mutex_enter(&ill->ill_lock);
 	switch (ill->ill_dlpi_fastpath_state) {
-	case IDMS_FAILED:
+	case IDS_FAILED:
 		/*
 		 * Driver NAKed the first fastpath ioctl - assume it doesn't
 		 * support it.
 		 */
 		mutex_exit(&ill->ill_lock);
 		return (ENOTSUP);
-	case IDMS_UNKNOWN:
+	case IDS_UNKNOWN:
 		/* This is the first probe */
-		ill->ill_dlpi_fastpath_state = IDMS_INPROGRESS;
+		ill->ill_dlpi_fastpath_state = IDS_INPROGRESS;
 		break;
 	default:
 		break;
@@ -1810,11 +1810,11 @@
 	 * Do so only if negotiation is enabled, capabilities are unknown,
 	 * and a capability negotiation is not already in progress.
 	 */
-	if (ill->ill_capab_state != IDMS_UNKNOWN &&
-	    ill->ill_capab_state != IDMS_RENEG)
-		return;
-
-	ill->ill_capab_state = IDMS_INPROGRESS;
+	if (ill->ill_dlpi_capab_state != IDS_UNKNOWN &&
+	    ill->ill_dlpi_capab_state != IDS_RENEG)
+		return;
+
+	ill->ill_dlpi_capab_state = IDS_INPROGRESS;
 	ip1dbg(("ill_capability_probe: starting capability negotiation\n"));
 	ill_capability_proto(ill, DL_CAPABILITY_REQ, NULL);
 }
@@ -1834,9 +1834,9 @@
 	 * also handle the case where the driver doesn't send us back
 	 * a DL_CAPABILITY_ACK in response, since the "probe" routine
 	 * requires the state to be in UNKNOWN anyway.  In any case, all
-	 * features are turned off until the state reaches IDMS_OK.
-	 */
-	ill->ill_capab_state = IDMS_UNKNOWN;
+	 * features are turned off until the state reaches IDS_OK.
+	 */
+	ill->ill_dlpi_capab_state = IDS_UNKNOWN;
 
 	/*
 	 * Disable sub-capabilities and request a list of sub-capability
@@ -2634,7 +2634,7 @@
 	 * instructed the driver to disable its advertised capabilities,
 	 * so there's no point in accepting any response at this moment.
 	 */
-	if (ill->ill_capab_state == IDMS_UNKNOWN)
+	if (ill->ill_dlpi_capab_state == IDS_UNKNOWN)
 		return;
 
 	/*
@@ -3445,8 +3445,8 @@
 	dl_capability_ack_t *capp;
 	dl_capability_sub_t *subp, *endp;
 
-	if (ill->ill_capab_state == IDMS_INPROGRESS)
-		ill->ill_capab_state = IDMS_OK;
+	if (ill->ill_dlpi_capab_state == IDS_INPROGRESS)
+		ill->ill_dlpi_capab_state = IDS_OK;
 
 	capp = (dl_capability_ack_t *)mp->b_rptr;
 
@@ -17661,12 +17661,18 @@
 {
 	/*
 	 * The ill is down; unbind but stay attached since we're still
-	 * associated with a PPA.
+	 * associated with a PPA. If we have negotiated DLPI capabilites
+	 * with the data link service provider (IDS_OK) then reset them.
+	 * The interval between unbinding and rebinding is potentially
+	 * unbounded hence we cannot assume things will be the same.
+	 * The DLPI capabilities will be probed again when the data link
+	 * is brought up.
 	 */
 	mblk_t	*mp = ill->ill_unbind_mp;
 
+	ip1dbg(("ill_dl_down(%s)\n", ill->ill_name));
+
 	ill->ill_unbind_mp = NULL;
-	ip1dbg(("ill_dl_down(%s)\n", ill->ill_name));
 	if (mp != NULL) {
 		ip1dbg(("ill_dl_down: %s (%u) for %s\n",
 		    dlpi_prim_str(*(int *)mp->b_rptr), *(int *)mp->b_rptr,
@@ -17674,6 +17680,8 @@
 		mutex_enter(&ill->ill_lock);
 		ill->ill_state_flags |= ILL_DL_UNBIND_IN_PROGRESS;
 		mutex_exit(&ill->ill_lock);
+		if (ill->ill_dlpi_capab_state == IDS_OK)
+			ill_capability_reset(ill);
 		ill_dlpi_send(ill, mp);
 	}
 
--- a/usr/src/uts/common/inet/ip/ip_multi.c	Tue Oct 10 01:33:41 2006 -0700
+++ b/usr/src/uts/common/inet/ip/ip_multi.c	Tue Oct 10 06:05:36 2006 -0700
@@ -1376,8 +1376,8 @@
 	switch (((union DL_primitives *)mp->b_rptr)->dl_primitive) {
 	case DL_ENABMULTI_REQ:
 		/* Track the state if this is the first enabmulti */
-		if (ill->ill_dlpi_multicast_state == IDMS_UNKNOWN)
-			ill->ill_dlpi_multicast_state = IDMS_INPROGRESS;
+		if (ill->ill_dlpi_multicast_state == IDS_UNKNOWN)
+			ill->ill_dlpi_multicast_state = IDS_INPROGRESS;
 		ip1dbg(("ip_wput_ctl: ENABMULTI\n"));
 		break;
 	case DL_DISABMULTI_REQ:
--- a/usr/src/uts/common/inet/ip/ip_ndp.c	Tue Oct 10 01:33:41 2006 -0700
+++ b/usr/src/uts/common/inet/ip/ip_ndp.c	Tue Oct 10 06:05:36 2006 -0700
@@ -1336,8 +1336,8 @@
 	switch (((union DL_primitives *)mp->b_rptr)->dl_primitive) {
 	case DL_ENABMULTI_REQ:
 		/* Track the state if this is the first enabmulti */
-		if (ill->ill_dlpi_multicast_state == IDMS_UNKNOWN)
-			ill->ill_dlpi_multicast_state = IDMS_INPROGRESS;
+		if (ill->ill_dlpi_multicast_state == IDS_UNKNOWN)
+			ill->ill_dlpi_multicast_state = IDS_INPROGRESS;
 		ip1dbg(("ndp_mcastreq: ENABMULTI\n"));
 		break;
 	case DL_DISABMULTI_REQ:
--- a/usr/src/uts/common/io/dls/dls_soft_ring.c	Tue Oct 10 01:33:41 2006 -0700
+++ b/usr/src/uts/common/io/dls/dls_soft_ring.c	Tue Oct 10 06:05:36 2006 -0700
@@ -202,7 +202,7 @@
 	int 		i;
 	soft_ring_t	*ringp;
 	timeout_id_t 	tid;
-	kt_did_t	t_did;
+	kt_did_t	t_did = 0;
 
 	for (i = 0; i < cnt; i++) {
 		ringp = ringp_set[i];