I have an application which uses a device driver which I wrote to receive
UDP/IP messages. This driver does not use interrupts but polls to see if
messages are available. Once a message is detected I call netif_rx to pass
it up the stack. The application running from user space knows that a
message was received and does a recvfrom on my socket. On a 2.2 Kernel, this
works every time. i.e. I see a message and pass it up the stack and the
recvfrom does indeed get the message from the socket. In a 2.4 environment I
see that netif_rx is using softirq to handle the message as opposed to a BH.
There seems to be a latency introduced because of this. The ksoftirqd runs
at a low priority and my application runs at a high priority (nice value of
-10), Now it seems that the message is not waiting for me when I do a
recvfrom. I do not want to yield my program for too long since the
application is real-time intensive (i.e it must process 30 000msgs/second
which it has been able to do on a 2.2 Kernel). Is there any way to increasy
the priority of the softirq daemon or ensure that it is always awoken when a
netif_rx is called? Please CC me directly on any responses.
Jack Bloch
Siemens Carrier Networks
e-mail : [email protected]
phone : (561) 923-6550
Hello!
> the priority of the softirq daemon or ensure that it is always awoken when a
> netif_rx is called?
You should suppound it with local_bh_disable()/enable(), when using
from process context.
Alexey
> > the priority of the softirq daemon or ensure that it is always awoken
> when a
> > netif_rx is called?
>
>You should suppound it with local_bh_disable()/enable(), when using
>from process context.
Actually he should call netif_rx_ni() instead of netif_rx().
_ni stands for non-interrupt context.
Max
I have tried both methods and they work. I would of course like to use the
most real-time efficient and "Kernel standard" methods. Looking into the
code code of netif_rx_ni seems to be logically the most correct way since it
will trigger do_softirq directly after the call to netif_rx.
Jack Bloch
Siemens Carrier Networks
e-mail : [email protected]
phone : (561) 923-6550
-----Original Message-----
From: Maksim (Max) Krasnyanskiy [mailto:[email protected]]
Sent: Wednesday, July 17, 2002 6:32 PM
To: [email protected]; Bloch, Jack
Cc: [email protected]
Subject: Re: Networking question
> > the priority of the softirq daemon or ensure that it is always awoken
> when a
> > netif_rx is called?
>
>You should suppound it with local_bh_disable()/enable(), when using
>from process context.
Actually he should call netif_rx_ni() instead of netif_rx().
_ni stands for non-interrupt context.
Max
Hello!
> code code of netif_rx_ni seems to be logically the most correct way since it
> will trigger do_softirq directly after the call to netif_rx.
Yes, of course. I simply forgot that _ni was evetually added.
Alexey