ALTQ for dynamic interfaces [Re: 7-STABLE panic: mtx_lock() of spin mutex %s @ %s:%d]

Florian Smeets flo at kasimir.com
Tue Nov 27 15:02:36 PST 2007


Max Laier wrote:
> 
> Okay ... try this.  Not final yet, but should be functional.  With this 
> you should be able to:
> 
>  1) Safely remove an interface with active queues
>  2) Re-add the interface and *magically* get the queues back
>  3) Write queue rules for non-existing interfaces
>   - Note that we will assume an MTU of 1500 and you have to specify a 
>     fixed bandwidth as we don't know the interface's native speed
>   - Obviously these queues will be activated as soon as a matching 
>     interface is created.
> 
> BUGS: Doesn't print queues on removed interfaces at all.  Should be 
> changed to something like "queue foo on bar0 (N/A) ...", but it seems I 
> was too strict with the local_flags.  The error handling might need some 
> work in order to avoid panic if something goes wrong while we de-activate 
> queues.
> 
> I'd like to hear back from you in order to see if I at least got the basic 
> workings right enough so you can survive the mpd interface destroy.  

Ok, it survives 20 consecutive restarts now without problems. I didn't 
test more as i'm not 100% sure what my provider will do otherwise...

N.B. This is 8-CURRENT but it had the same problem as the 7-STABLE box.

> Could you - in addition to you current setup w/ if-up script - also test 
> the magic part?  i.e. load the ruleset before loading mpd.  This should 
> now be possible as long as you don't put "set loginterface" or fixed 
> interface-to-address src/dst in it \o/
> 

Yes, the *magic* seems to work (without up-script):

root at fw-pri:~ > pfctl -sq
queue std_out on ng0 qlimit 250 priq( default )
queue tcp_ack_out on ng0 priority 6 qlimit 250
root at fw-pri:~ > /usr/local/etc/rc.d/mpd4 stop
Stopping mpd4.
Waiting for PIDS: 1824.
root at fw-pri:~ > pfctl -sq
root at fw-pri:~ > /usr/local/etc/rc.d/mpd4 start
Starting mpd4.
root at fw-pri:~ > pfctl -sq
queue std_out on ng0 qlimit 250 priq( default )
queue tcp_ack_out on ng0 priority 6 qlimit 250

Max, thanks a lot! Keep up the great work you are doing on pf4freebsd.

Cheers
Florian


More information about the freebsd-pf mailing list