changeset 12834:0bbdeb5a954e

6967440 ixgbe can't receive packets after cpu binding with dladm 6968238 X4800 panics on hotplug offline operation when interrupt remapping is enabled
author Judy Chen <Judy.Chen@Sun.COM>
date Wed, 14 Jul 2010 17:14:56 +0800
parents c2b074364dff
children 2541b129e1fc
files usr/src/uts/i86pc/io/apix/apix.c usr/src/uts/i86pc/io/apix/apix_utils.c usr/src/uts/i86pc/io/pcplusmp/apic_introp.c
diffstat 3 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/i86pc/io/apix/apix.c	Wed Jul 14 01:53:12 2010 -0700
+++ b/usr/src/uts/i86pc/io/apix/apix.c	Wed Jul 14 17:14:56 2010 +0800
@@ -1609,7 +1609,7 @@
 	dev_info_t *dip;
 	int inum, cap_ptr;
 	ddi_acc_handle_t handle;
-	ddi_intr_msix_t *msix_p;
+	ddi_intr_msix_t *msix_p = NULL;
 	ushort_t msix_ctrl;
 	uintptr_t off;
 	uint32_t mask;
@@ -1628,7 +1628,7 @@
 	/*
 	 * Mask MSI-X. It's unmasked when MSI-X gets enabled.
 	 */
-	if (vecp->v_type == APIX_TYPE_MSIX) {
+	if (vecp->v_type == APIX_TYPE_MSIX && IS_VECT_ENABLED(vecp)) {
 		if ((dip = APIX_GET_DIP(vecp)) == NULL)
 			return (NULL);
 		inum = vecp->v_devp->dv_inum;
@@ -1651,10 +1651,13 @@
 	}
 
 	*result = 0;
-
 	if ((newp = apix_rebind(vecp, new_cpu, 1)) == NULL)
 		*result = EIO;
 
+	/* Restore mask bit */
+	if (msix_p != NULL)
+		ddi_put32(msix_p->msix_tbl_hdl, (uint32_t *)off, mask);
+
 	return (newp);
 }
 
--- a/usr/src/uts/i86pc/io/apix/apix_utils.c	Wed Jul 14 01:53:12 2010 -0700
+++ b/usr/src/uts/i86pc/io/apix/apix_utils.c	Wed Jul 14 17:14:56 2010 +0800
@@ -312,7 +312,8 @@
 	msi_regs.mr_data = vector;
 	msi_regs.mr_addr = target_apic_id;
 
-	intrmap_tbl[0] = vecp->v_intrmap_private;
+	for (i = 0; i < count; i++)
+		intrmap_tbl[i] = xv_intrmap_private(vecp->v_cpuid, vector + i);
 	apic_vt_ops->apic_intrmap_alloc_entry(intrmap_tbl, dip, type,
 	    count, 0xff);
 	for (i = 0; i < count; i++)
--- a/usr/src/uts/i86pc/io/pcplusmp/apic_introp.c	Wed Jul 14 01:53:12 2010 -0700
+++ b/usr/src/uts/i86pc/io/pcplusmp/apic_introp.c	Wed Jul 14 17:14:56 2010 +0800
@@ -75,7 +75,10 @@
 	msi_regs.mr_data = vector;
 	msi_regs.mr_addr = target_apic_id;
 
-	intrmap_tbl[0] = irq_ptr->airq_intrmap_private;
+	for (i = 0; i < count; i++) {
+		irqno = apic_vector_to_irq[vector + i];
+		intrmap_tbl[i] = apic_irq_table[irqno]->airq_intrmap_private;
+	}
 	apic_vt_ops->apic_intrmap_alloc_entry(intrmap_tbl, dip, type,
 	    count, 0xff);
 	for (i = 0; i < count; i++) {