Re: [RFC] napi: limit GRO latency

Eric Dumazet
2012-10-08T19:21:58Z

On Mon, 2012-10-08 at 11:58 -0700, Stephen Hemminger wrote:
> Limit the latency of pending GRO in NAPI processing to 2*HZ.
> When the system is under heavy network load, NAPI will go into
> poll mode via soft irq, and only stay in the loop for
> two jiffies. If this occurs, process the GRO pending list
> to make sure and not delay outstanding TCP frames for too long.
>
> Rearrange the exit path to get rid of unnecessary goto logic.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
>
> --- a/net/core/dev.c 2012-10-08 09:21:27.466049785 -0700
> +++ b/net/core/dev.c 2012-10-08 11:56:41.714618745 -0700
> @@ -3937,8 +3937,16 @@ static void net_rx_action(struct softirq
> * Allow this to run for 2 jiffies since which will allow
> * an average latency of 1.5/HZ.
> */
> - if (unlikely(budget <= 0 || time_after(jiffies, time_limit)))
> - goto softnet_break;
> + if (unlikely(budget <= 0 || time_after(jiffies, time_limit))) {
> + /* Cleanup all pending GRO */
> +
> + list_for_each_entry(n, &sd->poll_list, poll_list)
> + napi_gro_flush(n);
> +
> + sd->time_squeeze++;
> + __raise_softirq_irqoff(NET_RX_SOFTIRQ);
> + break;
> + }
>

Hmm, I really dont think its a good idea.

I am working in making GRO storing more packets, so any kind of flushes
like that will completely defeat GRO intent.