Date: Thu, 16 Sep 2004 03:43:59 -0000 From: "Max Laier" <max@love2party.net> To: <pf4freebsd@freelists.org> Cc: freebsd-altq@rofug.ro Subject: [pf4freebsd] Patch: if_tun.c (forgot the polling) Message-ID: <003501c35b54$c5187240$01000001@max900>
next in thread | raw e-mail | index | archive | help
Here is a patch for if_tun.c. This should finally enable tun(4) for
queueing. In my earlier patch sent to Dennis I forgot to modify the polling
as well:
<snip>
@@ -838,12 +861,14 @@
struct tun_softc *tp = dev->si_drv1;
struct ifnet *ifp = &tp->tun_if;
int revents = 0;
+ struct mbuf *m;
s = splimp();
TUNDEBUG("%s%d: tunpoll\n", ifp->if_name, ifp->if_unit);
if (events & (POLLIN | POLLRDNORM)) {
- if (ifp->if_snd.ifq_len > 0) {
+ IFQ_POLL_NOLOCK(&ifp->if_snd, m);
+ if (m != NULL) {
TUNDEBUG("%s%d: tunpoll q=%d\n", ifp->if_name,
ifp->if_unit, ifp->if_snd.ifq_len);
revents |= events & (POLLIN | POLLRDNORM);
<snap>
I hope this now really does the trick. Tests with Daniel's ACKPRI-Tutorial
show good results.
@Dennis: What patch format is best for you to incooperate into your release?
This one is a unified diff against unpatched source.
Regards,
Max
-- Binary/unsupported file stripped by Ecartis --
-- Type: application/octet-stream
-- File: if_tun.c.diff
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?003501c35b54$c5187240$01000001>
