tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: altq on a gif tunnel



Hi,

On 2018/11/07 5:31, Tho wrote:
> On Monday  5 Nov 2018, at 19:48, Greg Troxel wrote:
> In particular, if_gif.c uses IFQ_SET_READY() -- quoting altq(9): "ALTQ
> can be enabled only on interfaces with this flag" -- and IFQ_CLASSIFY().
> 
> However, my quick investigations showed that a call to IFQ_ENQUEUE()
> was removed in rev. 119 by knakahara@ to fix some MP issues
> http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/net/if_gif.c.diff?r1=1.118&r2=1.119
> 
> Now, gif_output() eventually calls ip{,6}_output() with no call to
> IFQ_ENQUEUE(), even though there is still the IFQ_CLASSIFY call. I
> think that might be the issue? The rev. 1.33 "make gif ALTQ-capable"
> added such a call, for instance.
> 
> So I wonder if rev. 119 did not introduce a regression (knakahara@,
> what do you think?) and how to fix this ... ? :)

I think if_gif.c:rev. 1.133 introduce this regression.
http://www.nerv.org/netbsd/changeset.cgi?id=20171127T050222Z.d99426c97536a641de05831a6142035cdb523366#src/sys/net/if_gif.c

Because I remove if_transmit_lock() in this commit, the function calls
if.c::if_transmit() which calls IFQ_ENQUEUE() if ALTQ is defined.
Sorry, it's my fault.

Could you try the following patch?
====================
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c
index fa9e63d59fd..169f2013014 100644
--- a/sys/net/if_gif.c
+++ b/sys/net/if_gif.c
@@ -487,7 +487,10 @@ gif_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
        m->m_pkthdr.csum_flags = 0;
        m->m_pkthdr.csum_data = 0;
 
-       error = gif_transmit_direct(var, m);
+       gif_putref_variant(var, &psref);
+       var = NULL;
+       error = if_transmit_lock(ifp, m);
+
 end:
        if (var != NULL)
                gif_putref_variant(var, &psref);
====================


Thanks,

-- 
//////////////////////////////////////////////////////////////////////
Internet Initiative Japan Inc.

Device Engineering Section,
IoT Platform Development Department,
Network Division,
Technology Unit

Kengo NAKAHARA <k-nakahara%iij.ad.jp@localhost>


Home | Main Index | Thread Index | Old Index