Date: Wed, 5 Dec 2007 16:38:39 GMT From: Steve Wise <swise@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 130272 for review Message-ID: <200712051638.lB5GcdfH066071@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=130272 Change 130272 by swise@swise:vic10:iwarp on 2007/12/05 16:38:22 iw_cxgb fixes to enable passive opens - refcount variable not initialized - added code to deal with passing meta-data in mbuf fields Affected files ... .. //depot/projects/iwarp/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_iwch_cm.c#2 edit Differences ... ==== //depot/projects/iwarp/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_iwch_cm.c#2 (text+ko) ==== @@ -286,6 +286,7 @@ epc = malloc(size, M_DEVBUF, flags); if (epc) { memset(epc, 0, size); + refcount_init(&epc->refcount, 1); mtx_init(&epc->lock, "iwch_epc lock", NULL, MTX_DEF); } PDBG("%s alloc ep %p\n", __FUNCTION__, epc); @@ -313,17 +314,16 @@ static void process_task(void *ctx, int pending) { -#ifdef notyet struct mbuf *m = NULL; void *ep; struct t3cdev *tdev; int ret; while ((m = mbufq_dequeue(&rxq))) { -#ifdef notyet - ep = *((void **) (skb->cb)); - tdev = *((struct t3cdev **) (skb->cb + sizeof(void *))); - ret = work_handlers[G_OPCODE(ntohl((__force __be32)skb->csum))](tdev, skb, ep); + ep = m->m_pkthdr.rcvif; + tdev = (struct t3cdev *)m->m_pkthdr.header; + PDBG("%s dequeued mbuf %p ep %p tdev %p\n", __FUNCTION__, m, ep, tdev); + ret = work_handlers[G_OPCODE(ntohl(m->m_pkthdr.csum_data))](tdev, m, ep); if (ret & CPL_RET_BUF_DONE) m_free(m); @@ -331,9 +331,7 @@ * ep was referenced in sched(), and is freed here. */ put_ep((struct iwch_ep_common *)ep); -#endif } -#endif } static int @@ -2109,21 +2107,14 @@ get_ep(epc); -#ifdef notyet - /* - * XXX :-/ - */ - /* - * Save ctx and tdev in the m->cb area. - */ - *((void **) skb->cb) = ctx; - *((struct t3cdev **) (skb->cb + sizeof(void *))) = tdev; + m->m_pkthdr.rcvif = (void *)ctx; + m->m_pkthdr.header = tdev; -#endif /* * Queue the mbuf and schedule the worker thread. */ mbufq_tail(&rxq, m); + PDBG("%s enqueued mbuf %p ep %p tdev %p\n", __FUNCTION__, m, epc, tdev); taskqueue_enqueue(mbuf_taskq, &mbuf_task); return 0; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712051638.lB5GcdfH066071>