Getting an error display, vp_freepkt: Bad file descriptor.

Hello all,

We have developed a bandwidth regulating software in QNX4.5(In
application space). We are getting the network packets into the
application space using the Virtual Packet Interface(VPI) and
regulating them and send it back using the same VPI.

It’s working fine with moderate network traffic. But in the case of
heavy traffic, it’s working but displays the following error message
continuously.

vp_freepkt: Bad file descriptor.

If anybody have any idea about this, please let me know.

Thanks in advance
Jith.

use /boot/sys/Proc32
and look for the -f option. Try to increase that.

Hi all.

As sugggested by Noc, I have build a new boot image with a maximum of 2048 file descripters/process ( Proc32 -f 16 2048 8000) and tried. But no effect.

Our Bandwidth Manager is showing around 20 times the error message
“vp_freepkt: Bad file descriptor.” while transfering a 5MB file at a
bandwidth regulation of 1Mbits/sec, irespective of the available no.of
file descripters/process.(even I have tied with Proc32 -f 16 10240 20480,
then too I got around 20 error messages.).

We have implemented a queueing discipline (CBQ) in the application space, where we are getting network packets using the VPI (Virtual Packet
Interface) as a IP FILTER. These queueing disciplines keeps the netwoks
packets for a while and send them back in a random order(not in the
sequeuece in which packets are received). Will this make any problem in VPI (keeping packets for a while in memory and send them back in a random order)?
Or is there any way to configure the Virtual Packet Interface?

Please give us some solution/suggestion/comments.

Thanks in advance
Jith.

Maybe you should increase the FD_SETSIZE ?
The default one is only 32 as defined in your <sys/select.h>. In your code, you should define it to a bigger number, say 256, before you include <sys/select.h>, and recompile your code.

Hi,

I have tried by FD_SIZE as 256. but no effect.

I am creating a thread in our code and using VPI library functions across the thread. ( I found, none of the VPI library functions are thread safe. Will this be the problem?)

But I feel, once when I was doing a stress test on VPI using a program (without thread), I got he same error (vp_freepkt: Bad file descriptor.) If I get that program I will let u all know.

-Jith.

If you use TCP?IP calles only in the thread I guess it should be ok. But still I would not do that because the TCP/IP stack can be using a function that is NOT thread safe (like strtok) then you could get strange behavior.