Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Nov 2007 04:58:35 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 128499 for review
Message-ID:  <200711020458.lA24wZNN076689@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=128499

Change 128499 by kmacy@kmacy:storage:toestack on 2007/11/02 04:57:51

	fix mtx_lock call to mtx_unlock
	validate toe_tid before dereferencing
	add some debug printfs

Affected files ...

.. //depot/projects/toestack/sys/dev/cxgb/cxgb_offload.c#14 edit

Differences ...

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

@@ -502,7 +502,7 @@
 	p->next = t->afree;
 	t->afree = p;
 	t->atids_in_use--;
-	mtx_lock(&t->atid_lock);
+	mtx_unlock(&t->atid_lock);
 
 	return ctx;
 }
@@ -808,16 +808,22 @@
 static int
 do_act_establish(struct t3cdev *dev, struct mbuf *m)
 {
-	struct cpl_act_establish *req = cplhdr(m);
-	unsigned int atid = G_PASS_OPEN_TID(ntohl(req->tos_tid));
+	struct cpl_act_establish *req;
+	unsigned int atid;
 	struct toe_tid_entry *toe_tid;
 
+	req = cplhdr(m);
+	atid = G_PASS_OPEN_TID(ntohl(req->tos_tid));
 	toe_tid = lookup_atid(&(T3C_DATA (dev))->tid_maps, atid);
-	if (toe_tid->ctx && toe_tid->client->handlers &&
+	if (toe_tid && toe_tid->ctx && toe_tid->client->handlers &&
 		toe_tid->client->handlers[CPL_ACT_ESTABLISH]) {
+		printf("active establish callback\n");
+		
 		return toe_tid->client->handlers[CPL_ACT_ESTABLISH]
 						(dev, m, toe_tid->ctx);
 	} else {
+		printf("toe_tid=%p\n", toe_tid);
+	
 		log(LOG_ERR, "%s: received clientless CPL command 0x%x\n",
 			dev->name, CPL_PASS_ACCEPT_REQ);
 		return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG;
@@ -961,8 +967,12 @@
 {
 	while (n--) {
 		struct mbuf *m0 = *m++;
-		unsigned int opcode = G_OPCODE(ntohl(m0->m_pkthdr.csum_data));		
-		int ret = cpl_handlers[opcode] (dev, m0);
+		unsigned int opcode = G_OPCODE(ntohl(m0->m_pkthdr.csum_data));
+		int ret;
+
+		printf("processing op=0x%x m=%p data=%p\n", opcode, m0, m0->m_data);
+		
+		ret = cpl_handlers[opcode] (dev, m0);
 
 #if VALIDATE_TID
 		if (ret & CPL_RET_UNKNOWN_TID) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711020458.lA24wZNN076689>