> -----Original Message-----
> From: kernelnewbies-bounce@xxxxxxxxxxxx
> [mailto:kernelnewbies-bounce@xxxxxxxxxxxx] 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.