Subject: Re: Changing bandwidth without rebooting on a ALTQ rate controlled interface
To: Dave Poirier <instinc@users.sourceforge.net>
From: Greg A. Woods <woods@weird.com>
List: netbsd-users
Date: 01/20/2005 16:15:51
[ On Thursday, January 20, 2005 at 10:41:00 (+1100), Carl Brewer wrote: ]
> Subject: Re: Changing bandwidth without rebooting on a ALTQ rate controlled interface
>
> Dave Poirier wrote:
> > 
> > using the very simplified configuration file:
> > 
> > [/etc/altq.conf]
> > 
> > interface wm1 bandwidth 1M hfsc
> > class hfsc wm1 def_class root pshare 100 default
> > 
> > [end of /etc/altq.conf]
> > 
> > If I attempt to change the bandwidth and restart ALTQ, I receive the
> > following message in /var/log/messages:
> > 
> > ---
> > Jan 19 02:06:25 pmcnet altqd[565]: tbr is already installed on wm1,
> > using the current setting (rate:1.00M  size:1.46K).
> > ---
> > 
> > Is there a way to modify the tbr rate without rebooting NetBSD?
> 
> Should be, use tbrconfig.  It's just like ifconfig :)

Yesterday I too discovered that when altqd(8) is using the HFSC
scheduler then it installs a TBR on the interface but fails to ever
remove it on reload (or halt) and thus it refuses to change the TBR
settings on the interface on reload or restart too.

This is arguably a bug in altqd(8), but in the mean time the work around
might be to modify /etc/rc.d/altqd to grep for "interface .* hfsc" in
/etc/altq.conf, and if any lines are found to disallow "reload" and on
"stop" to also run "tbrconfig -d $if" for each HFSC-using interface.

Or always do it manually after changing the "bandwidth" specification:

	/etc/rc.d/altqd stop
	tbrconfig -d wm1
	/etc/rc.d/altqd start

Since tbrconfig(8) itself can change the TBR settings on an interface
without deleting the TBR and re-adding it, I don't see why altqd(8)
couldn't do the same, but I don't have time to dig into the code to make
it work.

-- 
						Greg A. Woods

H:+1 416 218-0098  W:+1 416 489-5852 x122  VE3TCP  RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>