net_rx_action() query in dev.c?

22 views
Skip to first unread message

pradeep singh

unread,
Apr 25, 2007, 6:00:56 AM4/25/07
to kernel newbies
Hi All,

I was going through the implementation code for net_rx_action, whcih
is invoked everytime the NET_RX_SOFTIRQ gets to run.

The logic at line number 1916 in file net/core/dev.c is -

while(!list_empty(&queue->poll_list)) {
/*something here*/
if(budget <= 0 || jiffies - start_time > 1) <- line 1916
goto softnet_break;

/*something here*/
}

if budget <= 0 we must go to softnet_break is understandable but why
if budget is > 0 we must check for the time elapsed??
And if the difference is > 1, why we should goto softnet_break?

I didn't quite get it.

Any help?

Thanks
~psr

--
play the game

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to eca...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Ajay Singh (ajaysi)

unread,
May 1, 2007, 10:21:23 AM5/1/07
to pradeep singh, kernel newbies

> -----Original Message-----
> From: kernelnewb...@nl.linux.org
> [mailto:kernelnewb...@nl.linux.org] On Behalf Of pradeep singh
> Sent: Wednesday, April 25, 2007 3:31 PM
> To: kernel newbies
> Subject: net_rx_action() query in dev.c?
>
> Hi All,
>
> I was going through the implementation code for
> net_rx_action, whcih is invoked everytime the NET_RX_SOFTIRQ
> gets to run.
>
> The logic at line number 1916 in file net/core/dev.c is -
>
> while(!list_empty(&queue->poll_list)) {
> /*something here*/
> if(budget <= 0 || jiffies - start_time > 1) <- line 1916
> goto softnet_break;
>
> /*something here*/
> }
>
> if budget <= 0 we must go to softnet_break is understandable
> but why if budget is > 0 we must check for the time elapsed??
> And if the difference is > 1, why we should goto softnet_break?
>

The loop is getting only '1 jiffy' for processing the packets and the
maximum number of packets it can process is netdev_budget (which is
assigned value of 300).
So if either of the condition is true it breaks the loop and queues the
softirq again.

pradeep singh

unread,
May 1, 2007, 11:42:35 PM5/1/07
to Ajay Singh (ajaysi), kernel newbies

Ok, got it.
Thanks a lot ajay :-)

~psr

Reply all
Reply to author
Forward
0 new messages