Re: problems with altq

From: Divacky Roman <xdivac02_at_stud.fit.vutbr.cz>
Date: Thu, 5 Aug 2004 12:50:48 +0200
On Wed, Aug 04, 2004 at 08:03:00PM +0200, Max Laier wrote:
> On Wednesday 04 August 2004 15:05, Divacky Roman wrote:
> >                 struct pf_altq          *altq, *a;
> >
> >                 if (pa->ticket != ticket_altqs_inactive) {
> >                         error = EBUSY;
> >                         break;
> >                 }
> >                 altq = pool_get(&pf_altq_pl, PR_NOWAIT);
> > 			         ^^^^^^^^^^
> > shouldnt this be initalized to NULL? at least its not nice to have it
> > uninitalized...
> 
> hum?
> $ cd /usr/src/sys/contrib/pf/net && grep pf_altq_pl *
> <...>
> pf_ioctl.c:     pf_state_pl = pf_altq_pl = pf_pooladdr_pl = NULL;
> pf_ioctl.c:     UMA_DESTROY(pf_altq_pl);
> pf_ioctl.c:             UMA_CREATE(pf_altq_pl,    struct pf_altq, "pfaltqpl");
> <...>
> 
> Or what are you thinking about?

pf/net/pf_ioctl.c:2032 and below 

hm... I got it wrong. I looked at it again and I changed type with variable
name ;(

hysteria.sk/~neologism/NEOLOGISM is my kernel config
hysteria.sk/~neologism/pf.conf is my whole pf config

I am compiling kernel with -Os (I know its not supported) I'll try with plain
-O
 
btw: why does the malloc has to be NOWAIT?

> Just like Dan Cojocar said in his reply, I can't reproduce your problem 
> here :-\

I can provide you any information you'll ask for

> > On Wed, Aug 04, 2004 at 02:56:40PM +0200, Divacky Roman wrote:
> > > I am getting this
> > > pfctl: DIOCADDALTQ: Cannot allocate memory
> > > if I try to enable altq on pf configured as
> > >
> > >    altq on $ext_if bandwidth 256Kb cbq queue { ssh_i web other}
> > >    queue ssh_i bandwidth 25% cbq(borrow red)
> > >    queue web bandwidth 25% cbq(borrow red)
> > >    queue other bandwidth 50% cbq(borrow default red)
> > >
> > >
> > > without that "red" it works ok...
> 
> Now that is strange as it makes no difference in the DIOCADDALTQ call path 
> whether you use RED or not. Might it be possible that you really are short on 
> (kernel) memory?

vm.kvm_free: 562032640
vm.kvm_size: 1073737728
witten ~# vmstat
 procs      memory      page                    disks     faults      cpu
  r b w     avm    fre  flt  re  pi  po  fr  sr ad0 ad1   in   sy  cs us sy id
   1 1 0  124936 189072   10   0   0   0   8   0   0   0  903 1010 1733  2  2
   96
   
   witten ~# /etc/rc.d/pf restart
   Disabling pf.
   pf disabled
   Enabling pf.
   pfctl: DIOCADDALTQ: Cannot allocate memory
   pf enabled
   witten ~#

if this is what I think it is I should have enough kernel memory, shouldnt I?

roman
Received on Thu Aug 05 2004 - 08:50:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:04 UTC