Date: Wed, 7 Nov 2007 03:43:22 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 128760 for review Message-ID: <200711070343.lA73hMGX075526@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=128760 Change 128760 by kmacy@kmacy:storage:toestack on 2007/11/07 03:42:46 add routine for deferring reply handling Affected files ... .. //depot/projects/toestack/sys/dev/cxgb/ulp/tom/cxgb_tom.c#8 edit Differences ... ==== //depot/projects/toestack/sys/dev/cxgb/ulp/tom/cxgb_tom.c#8 (text+ko) ==== @@ -45,6 +45,7 @@ #include <sys/sysctl.h> #include <sys/syslog.h> #include <sys/socketvar.h> +#include <sys/taskqueue.h> #include <net/if.h> #include <net/route.h> @@ -113,6 +114,24 @@ .redirect = NULL }; + +/* + * Add an skb to the deferred skb queue for processing from process context. + */ +void +t3_defer_reply(struct mbuf *m, struct toedev *dev, defer_handler_t handler) +{ + struct tom_data *td = TOM_DATA(dev); + + m_set_handler(m, handler); + mtx_lock(&td->deferq.lock); + + mbufq_tail(&td->deferq, m); + if (mbufq_len(&td->deferq) == 1) + taskqueue_enqueue(td->tq, &td->deferq_task); + mtx_lock(&td->deferq.lock); +} + void toepcb_init(struct toepcb *toep) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711070343.lA73hMGX075526>