changeset 9047:a54fa242f4f8

6816730 nxge does not build RX packet chains when operating in interrupt mode 6817424 rdc tables for nxge not programmed properly for hybrid IO operation
author Michael Speer <Michael.Speer@Sun.COM>
date Mon, 16 Mar 2009 13:52:35 -0700
parents a9168e702794
children b88ed0d7ccbf
files usr/src/uts/common/io/nxge/nxge_fzc.c usr/src/uts/common/io/nxge/nxge_hio.c usr/src/uts/common/io/nxge/nxge_main.c usr/src/uts/common/io/nxge/nxge_rxdma.c usr/src/uts/common/io/nxge/nxge_virtual.c usr/src/uts/common/sys/nxge/nxge_fzc.h
diffstat 6 files changed, 17 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/nxge/nxge_fzc.c	Mon Mar 16 14:35:31 2009 -0600
+++ b/usr/src/uts/common/io/nxge/nxge_fzc.c	Mon Mar 16 13:52:35 2009 -0700
@@ -18,8 +18,9 @@
  *
  * CDDL HEADER END
  */
+
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -760,6 +761,7 @@
 	npi_handle_t	handle;
 	npi_status_t	rs = NPI_SUCCESS;
 	nxge_status_t	status = NXGE_OK;
+	nxge_rdc_grp_t	*rdc_grp_p;
 	clock_t		lbolt;
 	int		table;
 
@@ -808,8 +810,10 @@
 	hardware = &nxgep->pt_config.hw_config;
 	for (table = 0; table < NXGE_MAX_RDC_GRPS; table++) {
 		/* Does this table belong to <nxgep>? */
-		if (hardware->grpids[table] == (nxgep->function_num + 256))
-			status = nxge_init_fzc_rdc_tbl(nxgep, table);
+		if (hardware->grpids[table] == (nxgep->function_num + 256)) {
+			rdc_grp_p = &nxgep->pt_config.rdc_grps[table];
+			status = nxge_init_fzc_rdc_tbl(nxgep, rdc_grp_p, table);
+		}
 	}
 
 	/* Ethernet Timeout Counter (?) */
@@ -821,11 +825,10 @@
 }
 
 nxge_status_t
-nxge_init_fzc_rdc_tbl(p_nxge_t nxge, int rdc_tbl)
+nxge_init_fzc_rdc_tbl(p_nxge_t nxge, nxge_rdc_grp_t *group, int rdc_tbl)
 {
 	nxge_hio_data_t *nhd = (nxge_hio_data_t *)nxge->nxge_hw_p->hio;
 	nx_rdc_tbl_t	*table;
-	nxge_rdc_grp_t	*group;
 	npi_handle_t	handle;
 
 	npi_status_t	rs = NPI_SUCCESS;
@@ -833,8 +836,6 @@
 
 	NXGE_DEBUG_MSG((nxge, DMA_CTL, "==> nxge_init_fzc_rdc_tbl(%d)", table));
 
-	group = &nxge->pt_config.rdc_grps[rdc_tbl];
-
 	/* This RDC table must have been previously bound to <nxge>. */
 	MUTEX_ENTER(&nhd->lock);
 	table = &nhd->rdc_tbl[rdc_tbl];
--- a/usr/src/uts/common/io/nxge/nxge_hio.c	Mon Mar 16 14:35:31 2009 -0600
+++ b/usr/src/uts/common/io/nxge/nxge_hio.c	Mon Mar 16 13:52:35 2009 -0700
@@ -1248,6 +1248,7 @@
 nxge_hio_group_start(mac_group_driver_t gdriver)
 {
 	nxge_ring_group_t	*group = (nxge_ring_group_t *)gdriver;
+	nxge_rdc_grp_t		*rdc_grp_p;
 	int			rdctbl;
 	int			dev_gindex;
 
@@ -1262,6 +1263,7 @@
 	mutex_enter(group->nxgep->genlock);
 	dev_gindex = group->nxgep->pt_config.hw_config.def_mac_rxdma_grpid +
 	    group->gindex;
+	rdc_grp_p = &group->nxgep->pt_config.rdc_grps[dev_gindex];
 
 	/*
 	 * Get an rdc table for this group.
@@ -1285,7 +1287,7 @@
 
 	group->rdctbl = rdctbl;
 
-	(void) nxge_init_fzc_rdc_tbl(group->nxgep, rdctbl);
+	(void) nxge_init_fzc_rdc_tbl(group->nxgep, rdc_grp_p, rdctbl);
 
 	group->started = B_TRUE;
 	mutex_exit(group->nxgep->genlock);
@@ -2216,17 +2218,9 @@
 	}
 
 	/*
-	 * We have to initialize the guest's RDC table, too.
-	 * -----------------------------------------------------
+	 * Update the RDC group.
 	 */
 	rdc_grp = &nxge->pt_config.rdc_grps[vr->rdc_tbl];
-	if (rdc_grp->max_rdcs == 0) {
-		rdc_grp->start_rdc = (uint8_t)channel;
-		rdc_grp->def_rdc = (uint8_t)channel;
-		rdc_grp->max_rdcs = 1;
-	} else {
-		rdc_grp->max_rdcs++;
-	}
 	NXGE_DC_SET(rdc_grp->map, channel);
 
 	NXGE_DEBUG_MSG((nxge, HIO_CTL, "<== nxge_hio_rdc_share"));
--- a/usr/src/uts/common/io/nxge/nxge_main.c	Mon Mar 16 14:35:31 2009 -0600
+++ b/usr/src/uts/common/io/nxge/nxge_main.c	Mon Mar 16 13:52:35 2009 -0700
@@ -5628,7 +5628,7 @@
 		rdc_grp->map |= (1 << channel);
 		rdc_grp->max_rdcs++;
 
-		(void) nxge_init_fzc_rdc_tbl(nxge, rgroup->rdctbl);
+		(void) nxge_init_fzc_rdc_tbl(nxge, rdc_grp, rgroup->rdctbl);
 		break;
 	}
 }
@@ -5673,7 +5673,7 @@
 		rdc_grp->map &= ~(1 << channel);
 		rdc_grp->max_rdcs--;
 
-		(void) nxge_init_fzc_rdc_tbl(nxge, rgroup->rdctbl);
+		(void) nxge_init_fzc_rdc_tbl(nxge, rdc_grp, rgroup->rdctbl);
 		break;
 	}
 }
--- a/usr/src/uts/common/io/nxge/nxge_rxdma.c	Mon Mar 16 14:35:31 2009 -0600
+++ b/usr/src/uts/common/io/nxge/nxge_rxdma.c	Mon Mar 16 13:52:35 2009 -0700
@@ -39,13 +39,6 @@
 	(rdc + nxgep->pt_config.hw_config.start_rdc)
 
 /*
- * XXX: This is a tunable to limit the number of packets each interrupt
- * handles.  0 (default) means that each interrupt takes as much packets
- * as it finds.
- */
-extern int	nxge_max_intr_pkts;
-
-/*
  * Globals: tunable parameters (/etc/system or adb)
  *
  */
@@ -2236,13 +2229,6 @@
 		    (totallen >= bytes_to_pickup)) {
 			break;
 		}
-
-		/* limit the number of packets for interrupt */
-		if (!(rcr_p->poll_flag)) {
-			if (npkt_read == nxge_max_intr_pkts) {
-				break;
-			}
-		}
 	}
 
 	rcr_p->rcr_desc_rd_head_pp = rcr_desc_rd_head_pp;
--- a/usr/src/uts/common/io/nxge/nxge_virtual.c	Mon Mar 16 14:35:31 2009 -0600
+++ b/usr/src/uts/common/io/nxge/nxge_virtual.c	Mon Mar 16 13:52:35 2009 -0700
@@ -85,12 +85,6 @@
 
 extern npi_status_t npi_mac_altaddr_disable(npi_handle_t, uint8_t, uint8_t);
 
-/*
- * XXX: Use temporarily to specify the number of packets each interrupt process
- * By default, the number of packet processed per interrupt is 1.
- */
-int	nxge_max_intr_pkts;
-
 static uint8_t p2_tx_fair[2] = {12, 12};
 static uint8_t p2_tx_equal[2] = {12, 12};
 static uint8_t p4_tx_fair[4] = {6, 6, 6, 6};
@@ -1630,14 +1624,6 @@
 	}
 
 	/*
-	 * XXX: read-in the config file to determine the number of packet
-	 * to process by each interrupt.
-	 */
-	nxge_max_intr_pkts = ddi_getprop(DDI_DEV_T_ANY, nxgep->dip,
-	    DDI_PROP_CANSLEEP | DDI_PROP_DONTPASS, "max_intr_pkts", 1);
-
-
-	/*
 	 * Get info on how many ports Neptune card has.
 	 */
 	nxgep->nports = nxge_get_nports(nxgep);
--- a/usr/src/uts/common/sys/nxge/nxge_fzc.h	Mon Mar 16 14:35:31 2009 -0600
+++ b/usr/src/uts/common/sys/nxge/nxge_fzc.h	Mon Mar 16 13:52:35 2009 -0700
@@ -18,16 +18,15 @@
  *
  * CDDL HEADER END
  */
+
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
 #ifndef	_SYS_NXGE_NXGE_FZC_H
 #define	_SYS_NXGE_NXGE_FZC_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #ifdef	__cplusplus
 extern "C" {
 #endif
@@ -57,7 +56,7 @@
 nxge_status_t nxge_init_fzc_rx_common(p_nxge_t);
 nxge_status_t nxge_init_fzc_rxdma_port(p_nxge_t);
 
-nxge_status_t nxge_init_fzc_rdc_tbl(nxge_t *, int);
+nxge_status_t nxge_init_fzc_rdc_tbl(nxge_t *, nxge_rdc_grp_t *, int);
 
 int nxge_fzc_rdc_tbl_bind(nxge_t *, int, int);
 int nxge_fzc_rdc_tbl_unbind(p_nxge_t, int);