# PF and Custom Kernel



## cj (Jun 20, 2012)

Hello,

I recompiled a custom kernel with PF ALTQ support.  And added the following to my KERNCONF:


```
device pf
device pflog
device pfsync

options         ALTQ
options         ALTQ_CBQ        # Class Bases Queuing (CBQ)
options         ALTQ_RED        # Random Early Detection (RED)
options         ALTQ_RIO        # RED In/Out
options         ALTQ_HFSC       # Hierarchical Packet Scheduler (HFSC)
options         ALTQ_PRIQ       # Priority Queuing (PRIQ)
options         ALTQ_NOPCC      # Required for SMP build
```

The server booted just fine but when I tried to start PF I get this message: 


```
Enabling pfpfctl: DIOCADDRULE: Operation not supported by device
```
 
The log files are clean; there is no output or errors related to PF. Would someone kindly provide some pointers or clues on where to start in my quest to fix this problem? I know this post is lacking some details but I'm will to provide more info as needed.

Thanks,

CJ


----------



## SirDice (Jun 21, 2012)

What version of FreeBSD are you using? Post the output of [cmd=]uname -a[/cmd]


----------



## suntzu (Jun 21, 2012)

I believe the kernel is not in sync with the world.


----------



## cj (Jun 21, 2012)

`# uname -a`


```
FreeBSD 10.0-CURRENT FreeBSD 10.0-CURRENT #0: Wed Jun 20 13:42:08 EDT 2012 /usr/obj/usr/src/sys/ISECUSTKERN  amd64
```


----------



## SirDice (Jun 22, 2012)

Why are you running -CURRENT? And, as suntzu noted, is your kernel in sync with your world?


----------



## cj (Jun 22, 2012)

The tone of your reply gave me the answers I needed to resolved this issue. I re-installed FreeBSD 9.0 and of course installed the sources from the image.  I then made the changes to my kernel and added options and devices and commented out the unnecessary.  Compiled the custom kernel with the ALTQ options and it works!

`# uname -a`


```
FreeBSD 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Fri Jun 22 19:43:43 EDT 2012/usr/obj/usr/src/sys/ISEKERN01  amd64
```

Thanks,

CJ


----------



## DutchDaemon (Jun 23, 2012)

There is no such thing as 9.0-CURRENT at the moment. How did you end up with that? FreeBSD 9 has a -RELEASE and a -STABLE tree. The -CURRENT tree is always the latest bleeding edge, i.e. FreeBSD 10. Did you pick up an old snapshot or source tree from before 9.0-RELEASE?


----------



## cj (Jun 23, 2012)

I did exactly as I described above.  I used the Freebsd FreeBSD 9.0-RELEASE DVD image and installed the OS with the sources included on the disk *only*.  When it finished I updated the ports tree, and then *cd*'ed into the /usr/src directory.  I created a symlink to my custom kernel into the amd64/conf folder. I added some things and took away others and compiled the kernel. And that is the version it ended as. The first time with FreeBSD 10 I updated the sources.


----------



## Orum (Jun 25, 2012)

One final note, even though the issue is resolved.  The

```
options         ALTQ_NOPCC      # Required for SMP build
```
is actually only "required if the TSC is unusable."

Yes, previous versions of FreeBSD (e.g. 6.0-RELEASE) simply stated that it was "required for SMP builds."  However, if you look at the man pages for more current releases you'll see they've updated the explanation to what I posted above.  I've omitted that option on several SMP systems (all with working TSCs), and have had altq work on them without issues.


----------

