Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Prioritising Ethernet packets: (5 Items)
   
Prioritising Ethernet packets  
I am using QNX 6.3.2 core on an intel IXP425 ARMBE.

I have a process (Process 1) which opens a UDP multicast socket and blocks on a recvfrom (2s timeout) until it receives 
a packet for the multicast group. When a packet is received it puts the data into a database and then does a sendto, 
sending data out to the multicast group.
Data is received every 3 or 4ms after sending data to the multcast group.
This process is running at priority 12.

I have another process (Process 2) which runs for 30ms then blocks for 100ms.
This process is running at priority 10 using FIFO scheduling.

I have noticed that the recvfrom in process 1 does not unblock until process 2 blocks, this delays my sendto by upto 
30ms.
If process 2 scheduling is set to round robin then the recvfrom waits until the process 2 timeslices, this delays my 
sendto by upto 4ms.

It looks like the priority 12 process is waiting for the priority 10 process to block or timeslice.
Is this correct/expected?

I need to reply to data received as quickly as possible.

Why does the recvfrom/io-net not inherit the priority of process 1 (12)?

Do I have to raise the priority of io-net to make the recvfrom unblock as soon as a packet of data is received? (io-net 
has one thread at priority 21 and seven threads at priority 10).

Thanks for the help,
Rich
Re: Prioritising Ethernet packets  
On Thu, Jan 03, 2008 at 05:06:06AM -0500, Richard Thompson wrote:
> I am using QNX 6.3.2 core on an intel IXP425 ARMBE.
> 
> I have a process (Process 1) which opens a UDP multicast socket and blocks on a recvfrom (2s timeout) until it 
receives a packet for the multicast group. When a packet is received it puts the data into a database and then does a 
sendto, sending data out to the multicast group.
> Data is received every 3 or 4ms after sending data to the multcast group.
> This process is running at priority 12.
> 
> I have another process (Process 2) which runs for 30ms then blocks for 100ms.
> This process is running at priority 10 using FIFO scheduling.
> 
> I have noticed that the recvfrom in process 1 does not unblock until process 2 blocks, this delays my sendto by upto 
30ms.
> If process 2 scheduling is set to round robin then the recvfrom waits until the process 2 timeslices, this delays my 
sendto by upto 4ms.
> 
> It looks like the priority 12 process is waiting for the priority 10 process to block or timeslice.
> Is this correct/expected?
> 
> I need to reply to data received as quickly as possible.
> 
> Why does the recvfrom/io-net not inherit the priority of process 1 (12)?
> 
> Do I have to raise the priority of io-net to make the recvfrom unblock as soon as a packet of data is received? (io-
net has one thread at priority 21 and seven threads at priority 10).
> 
> Thanks for the help,
> Rich

The only way I could see this happening is if the driver
was processing packets at priority <= 10 but the default
is 21.  If you start io-net with just the driver does
it show a thread at 21?

-seanb
Re: Prioritising Ethernet packets  
This is the way io-net is being started

io-net -v -p tcpip

mount -T io-net -o mac0=0080661026CA,mac1=0080661026CB /proc/boot/devn-ixp42x.so

io-net has 8 threads, one at priority 21 and seven at priority 10 (see attached).

What are the seven priority 10 threads doing?
Could there be a problem with our network driver?

Thanks,
Rich
Attachment: Image io-net.JPG 190.31 KB
Re: Prioritising Ethernet packets  
On Mon, Jan 07, 2008 at 12:53:18PM -0500, Richard Thompson wrote:
> This is the way io-net is being started
> 
> io-net -v -p tcpip
> 
> mount -T io-net -o mac0=0080661026CA,mac1=0080661026CB /proc/boot/devn-ixp42x.so
> 
> io-net has 8 threads, one at priority 21 and seven at priority 10 (see attached).
> 
> What are the seven priority 10 threads doing?
> Could there be a problem with our network driver?
> 
> Thanks,
> Rich
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post4093

Thread 1 is always only present to handle SIGINT.
I suspect thread 2 is the networking stack and
threads 3, 4, 5 are io-net's thread pool (handle
ops on entries under /dev/io-net).  It looks like
threads 6 7 8 are driver threads but it's unusual
to have the threads at prio 10.

-seanb
Re: Prioritising Ethernet packets  
The thread that is semaphore blocked worries me - semaphores don't support
priority inheritance.

Sean Boudreau wrote: 

On Mon, Jan 07, 2008 at 12:53:18PM -0500, Richard Thompson wrote: 
> This is the way io-net is being started 
> 
> io-net -v -p tcpip 
> 
> mount -T io-net -o mac0=0080661026CA,mac1=0080661026CB
/proc/boot/devn-ixp42x.so 
> 
> io-net has 8 threads, one at priority 21 and seven at priority 10 (see
attached). 
> 
> What are the seven priority 10 threads doing? 
> Could there be a problem with our network driver? 
> 
> Thanks, 
> Rich 
> 
> _______________________________________________ 
> Technology 
> http://community.qnx.com/sf/go/post4093
<http://community.qnx.com/sf/go/post4093>;  

Thread 1 is always only present to handle SIGINT. 
I suspect thread 2 is the networking stack and 
threads 3, 4, 5 are io-net's thread pool (handle 
ops on entries under /dev/io-net).  It looks like 
threads 6 7 8 are driver threads but it's unusual 
to have the threads at prio 10. 

-seanb 


_______________________________________________ 
Technology 
http://community.qnx.com/sf/go/post4094
<http://community.qnx.com/sf/go/post4094>;  


-- 

cburgess@qnx.com <mailto:cburgess@qnx.com>;