Subject: altq in macppc broken?
To: None <>
From: Andre LaBranche <>
List: tech-net
Date: 09/20/2003 11:30:49
This is the second time I've sent this message; the first time it 
didn't get through, apparently (it was yesterday, and it doesn't show 
up on the archives page) - maybe it was due to the 49K size? I'll omit 
the full ktrace output this time ;) My apologies if you've already read 

Trying to get altq running on a powermac 7500 with 604e upgrade:

Added the following options to the kernel config:

options         ALTQ
options         ALTQ_CBQ
options         ALTQ_HFSC
options         ALTQ_PRIQ
options         ALTQ_WFQ
options         ALTQ_FIFOQ
options         ALTQ_RED
options         ALTQ_BLUE
options         ALTQ_LOCALQ
options         ALTQ_FLOWVALVE
options         ALTQ_RIO
options         ALTQ_CDNR

floe# uname -a
NetBSD floe 1.6.1 NetBSD 1.6.1 (altq) #0: Wed Sep 10 18:56:13 PDT 2003  
    root@floe:/usr/src/sys/arch/macppc/compile/altq macppc

Attempting to run altqd with a basic config file that contains (for 
now), simply:

interface mc0 bandwidth 10000000 wfq

floe% sudo altqd -d
ALTQ config file is /etc/altq.conf
altqd: can't open altq device: No such file or directory

I looked and did see a directory called /dev/altq, but it didn't appear 
as a device file.
I got a script from a guy to make the nodes within /dev/altq:

floe% cat /dev/mkalt
mkdir altq 2>/dev/null
chmod 755 altq
for dev in altq cbq wfq afm fifoq red rio localq hfsc \
cdnr blue priq; do
rm -f altq/$dev
mknod altq/$dev c 77 $unit
chmod 644 altq/$dev
unit=$(($unit + 1))

So, I run that to end up with:

floe% ls -al /dev/altq
total 40
drwxr-xr-x  2 root  wheel     512 Sep 13 14:11 .
drwxr-xr-x  4 root  wheel   18944 Sep 13 14:11 ..
crw-r--r--  1 root  wheel  77,  3 Sep 13 14:11 afm
crw-r--r--  1 root  wheel  77,  0 Sep 13 14:11 altq
crw-r--r--  1 root  wheel  77, 10 Sep 13 14:11 blue
crw-r--r--  1 root  wheel  77,  1 Sep 13 14:11 cbq
crw-r--r--  1 root  wheel  77,  9 Sep 13 14:11 cdnr
crw-r--r--  1 root  wheel  77,  4 Sep 13 14:11 fifoq
crw-r--r--  1 root  wheel  77,  8 Sep 13 14:11 hfsc
crw-r--r--  1 root  wheel  77,  7 Sep 13 14:11 localq
crw-r--r--  1 root  wheel  77, 11 Sep 13 14:11 priq
crw-r--r--  1 root  wheel  77,  5 Sep 13 14:11 red
crw-r--r--  1 root  wheel  77,  6 Sep 13 14:11 rio
crw-r--r--  1 root  wheel  77,  2 Sep 13 14:11 wfq

Now trying to run altqd:

floe% sudo altqd -d
ALTQ config file is /etc/altq.conf
altqd: can't open altq device: Device not configured

Also, I did not see any altq messages at startup, however it is 
definitely in the kernel:

floe# nm /netbsd | grep altq
0010edec T altq_assert
0010eb48 T altq_attach
002fad80 G altq_cdnr_enabled
00103404 t altq_cdnr_input
0010ebb8 T altq_detach
0010ed14 T altq_disable
0010ec18 T altq_enable
001f3f68 T altq_etherclassify
0010f3e4 T altq_extractflow
002fada8 G altq_input
0010eaf4 T altq_lookup
00101344 T altqclose
001013ac T altqioctl
001012dc T altqopen
002f2894 d altqsw
002fad74 G naltqsw

With the help of a generous person on #netbsd / freenode, I also ran 
ktrace while attempting to run altqd. I believe the relevant lines are:

    217 altqd    NAMI  "/dev/altq/altq"
    217 altqd    RET   open -1 errno 6 Device not configured

According to this person, either 1) support isn't really in the kernel 
(I think I have shown otherwise), 2) the major / minor numbers are 
incorrect (I do not know how to diagnose this), or 3) altq is simply 
broken in macppc. I have been googling / researching this for several 
weeks, so I now rely on those more experienced with netbsd than I. I 
have sent this to the macppc list, but no response.

Has *anyone* successfully used altq in macppc?

Thanks very much for your time.