Re: [PATCH] net: gro: selective flush of packets

Eric Dumazet
2012-10-07T05:29:53Z

On Sun, 2012-10-07 at 08:32 +0800, Herbert Xu wrote:
> On Sat, Oct 06, 2012 at 08:08:49PM +0200, Eric Dumazet wrote:
> >
> > @@ -3981,8 +3996,17 @@ static void net_rx_action(struct softirq_action *h)
> > local_irq_enable();
> > napi_complete(n);
> > local_irq_disable();
> > - } else
> > + } else {
> > + if (n->gro_list) {
> > + /* flush too old packets
> > + * If HZ < 1000, flush all packets.
> > + */
> > + local_irq_enable();
> > + napi_gro_flush(n, HZ >= 1000);
> > + local_irq_disable();
> > + }
> > list_move_tail(&n->poll_list, &sd->poll_list);
> > + }
>
> Why don't we just always flush everything?

This is what I tried first, but it lowered performance on several
typical workloads.

Using this simple heuristic increases performance.