From owner-p4-projects@FreeBSD.ORG Fri Nov 2 04:58:36 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id ECFB116A421; Fri, 2 Nov 2007 04:58:35 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DE9416A41A for ; Fri, 2 Nov 2007 04:58:35 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 8D43113C4AA for ; Fri, 2 Nov 2007 04:58:35 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lA24wZcq076692 for ; Fri, 2 Nov 2007 04:58:35 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lA24wZNN076689 for perforce@freebsd.org; Fri, 2 Nov 2007 04:58:35 GMT (envelope-from kmacy@freebsd.org) Date: Fri, 2 Nov 2007 04:58:35 GMT Message-Id: <200711020458.lA24wZNN076689@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 128499 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2007 04:58:36 -0000 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) {