PERFORCE change 125365 for review

Kip Macy kmacy at FreeBSD.org
Sun Aug 19 14:04:28 PDT 2007


http://perforce.freebsd.org/chv.cgi?CH=125365

Change 125365 by kmacy at kip-macys-computer:opentoe_mbpro on 2007/08/19 21:03:32

	synchronize missed changes between vendor updates - most notably servicing of receives 
	for ports 3 and 4 when line interrupts are in use

Affected files ...

.. //depot/projects/opentoe/sys/dev/cxgb/cxgb_main.c#16 edit
.. //depot/projects/opentoe/sys/dev/cxgb/cxgb_offload.c#14 edit
.. //depot/projects/opentoe/sys/dev/cxgb/cxgb_sge.c#27 edit

Differences ...

==== //depot/projects/opentoe/sys/dev/cxgb/cxgb_main.c#16 (text+ko) ====

@@ -441,7 +441,8 @@
 	sc->bt = rman_get_bustag(sc->regs_res);
 	sc->bh = rman_get_bushandle(sc->regs_res);
 	sc->mmio_len = rman_get_size(sc->regs_res);
-
+	memset(adapter->rrss_map, 0xff, sizeof(adapter->rrss_map));
+	
 	if (t3_prep_adapter(sc, ai, 1) < 0) {
 		printf("prep adapter failed\n");
 		error = ENODEV;

==== //depot/projects/opentoe/sys/dev/cxgb/cxgb_offload.c#14 (text+ko) ====

@@ -81,7 +81,7 @@
 
 
 static const unsigned int MAX_ATIDS = 64 * 1024;
-static const unsigned int ATID_BASE = 0x100000;
+static const unsigned int ATID_BASE = 0x10000;
 static int inited = 0;
 
 static inline int
@@ -372,6 +372,8 @@
 	struct iff_mac *iffmacp;
 	struct ddp_params *ddpp;
 	struct adap_ports *ports;
+	struct ofld_page_info *rx_page_info;
+	struct tp_params *tp = &adapter->params.tp;
 	int port;
 
 	switch (req) {
@@ -402,6 +404,15 @@
 	case GET_L2T_CAPACITY:
 		*(unsigned int *)data = 2048;
 		break;
+	case GET_CPUIDX_OF_QSET: {
+		unsigned int qset = *(unsigned int *)data;
+
+		if (qset >= SGE_QSETS ||
+		    adapter->rrss_map[qset] >= RSS_TABLE_SIZE)
+			return -EINVAL;
+		*(unsigned int *)data = adapter->rrss_map[qset];
+		break;
+	}		
 	case GET_MTUS:
 		mtup = data;
 		mtup->size = NMTUS;
@@ -436,6 +447,11 @@
 	case FAILOVER_CLEAR:
 		t3_failover_clear(adapter);
 		break;
+	case GET_RX_PAGE_INFO:
+		rx_page_info = data;
+		rx_page_info->page_size = tp->rx_pg_size;
+		rx_page_info->num = tp->rx_num_pgs;
+		break;
 	case ULP_ISCSI_GET_PARAMS:
 	case ULP_ISCSI_SET_PARAMS:
 		if (!offload_running(adapter))
@@ -704,8 +720,16 @@
 	union opcode_tid *p = cplhdr(m);
 	unsigned int stid = G_TID(ntohl(p->opcode_tid));
 	struct toe_tid_entry *toe_tid;
+	const struct tid_info *t = &(TOE_DATA(dev))->tid_maps;
 
-	toe_tid = lookup_stid(&(TOE_DATA(dev))->tid_maps, stid);
+	/*
+	 * We get these messages also when setting up HW filters.  Throw
+	 * those away silently.
+	 */
+	if (stid >= t->stid_base + t->nstids)
+		return CPL_RET_BUF_DONE;
+	
+	toe_tid = lookup_stid(t, stid);
 	if (toe_tid->ctx && toe_tid->client->handlers &&
 		toe_tid->client->handlers[p->opcode]) {
 		return toe_tid->client->handlers[p->opcode] (dev, m, toe_tid->ctx);
@@ -746,16 +770,26 @@
 {
 	struct cpl_pass_accept_req *req = cplhdr(m);
 	unsigned int stid = G_PASS_OPEN_TID(ntohl(req->tos_tid));
+	struct tid_info *t = &(T3C_DATA(dev))->tid_maps;
 	struct toe_tid_entry *toe_tid;
+	unsigned int tid = GET_TID(req);
+
+	if (unlikely(tid >= t->ntids)) {
+		CH_MSG("%s: passive open TID %u too large\n",
+		    dev->name, tid);
+		t3_fatal_err(tdev2adap(dev));
+		return CPL_RET_BUF_DONE;
+	}
 
-	toe_tid = lookup_stid(&(TOE_DATA(dev))->tid_maps, stid);
-	if (toe_tid->ctx && toe_tid->client->handlers &&
+	toe_tid = lookup_stid(t, stid);
+	if (toe_tid && toe_tid->ctx && toe_tid->client->handlers &&
 		toe_tid->client->handlers[CPL_PASS_ACCEPT_REQ]) {
 		return toe_tid->client->handlers[CPL_PASS_ACCEPT_REQ]
 						(dev, m, toe_tid->ctx);
 	} else {
-		log(LOG_ERR, "%s: received clientless CPL command 0x%x\n",
-			dev->name, CPL_PASS_ACCEPT_REQ);
+		CH_MSG(tdev2adap(dev), DEBUG, OFLD,
+		       "%s: received clientless CPL command 0x%x\n",
+		    dev->name, CPL_PASS_ACCEPT_REQ);
 		return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG;
 	}
 }
@@ -804,8 +838,17 @@
 {
 	struct cpl_act_establish *req = cplhdr(m);
 	unsigned int atid = G_PASS_OPEN_TID(ntohl(req->tos_tid));
+	struct tid_info *t = &(TOE_DATA(dev))->tid_maps;
 	struct toe_tid_entry *toe_tid;
+	unsigned int tid = GET_TID(req);
 
+	if (unlikely(tid >= t->ntids)) {
+		CH_MSG("%s: active establish TID %u too large\n",
+		       dev->name, tid);
+		t3_fatal_err(tdev2adap(dev));
+		return CPL_RET_BUF_DONE;
+	}
+	
 	toe_tid = lookup_atid(&(TOE_DATA(dev))->tid_maps, atid);
 	if (toe_tid->ctx && toe_tid->client->handlers &&
 		toe_tid->client->handlers[CPL_ACT_ESTABLISH]) {
@@ -813,7 +856,7 @@
 						(dev, m, toe_tid->ctx);
 	} else {
 		log(LOG_ERR, "%s: received clientless CPL command 0x%x\n",
-			dev->name, CPL_PASS_ACCEPT_REQ);
+			dev->name, CPL_ACT_ESTABLISH);
 		return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG;
 	}
 }

==== //depot/projects/opentoe/sys/dev/cxgb/cxgb_sge.c#27 (text+ko) ====

@@ -353,6 +353,10 @@
 			 (v >> S_RSPQ0DISABLED) & 0xff);
 	}
 
+	if (status & (F_HIPIODRBDROPERR | F_LOPIODRBDROPERR))
+		CH_ALERT(adapter, "SGE dropped %s priority doorbell\n",
+		    status & F_HIPIODRBDROPERR ? "high" : "lo");
+	
 	t3_write_reg(adapter, A_SG_INT_CAUSE, status);
 	if (status & (F_RSPQCREDITOVERFOW | F_RSPQDISABLED))
 		t3_fatal_err(adapter);
@@ -2535,6 +2539,7 @@
 	adapter_t *adap = data;
 	struct sge_rspq *q0 = &adap->sge.qs[0].rspq;
 	struct sge_rspq *q1 = &adap->sge.qs[1].rspq;
+	int i;
 	
 	t3_write_reg(adap, A_PL_CLI, 0);
 	map = t3_read_reg(adap, A_SG_DATA_INTR);
@@ -2546,13 +2551,10 @@
 		taskqueue_enqueue(adap->tq, &adap->slow_intr_task);
 	
 	mtx_lock(&q0->lock);
-	
-	if (__predict_true(map & 1))
-		process_responses_gts(adap, q0);
-	
-	if (map & 2)
-		process_responses_gts(adap, q1);
 
+	for_each_port(adap, i)
+	    if (map & (1 << i)) 
+		    process_responses_gts(adap, &adap->sge.qs[i].rspq);
 	mtx_unlock(&q0->lock);
 }
 


More information about the p4-projects mailing list