PERFORCE change 130272 for review
Steve Wise
swise at FreeBSD.org
Wed Dec 5 08:38:41 PST 2007
http://perforce.freebsd.org/chv.cgi?CH=130272
Change 130272 by swise at 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;
}
More information about the p4-projects
mailing list