Re: [PATCH v3 net] net: solve a NAPI race

2017-02-28 Thread Eric Dumazet
On Tue, 2017-02-28 at 08:17 -0800, Stephen Hemminger wrote: > Maybe just as simple as using irqsave/irqrestore in driver. CPU can be differents. irqsave will not help.

Re: [PATCH v3 net] net: solve a NAPI race

2017-02-28 Thread Stephen Hemminger
On Mon, 27 Feb 2017 12:18:31 -0800 Eric Dumazet wrote: > This can happen with busy polling users, or if gro_flush_timeout is > used. But some other uses of napi_schedule() in drivers can cause this > as well. Where were IRQ's re-enabled? > thread 1 thread 2 (cou

Re: [PATCH v3 net] net: solve a NAPI race

2017-02-28 Thread Eric Dumazet
On Tue, 2017-02-28 at 10:14 +, David Laight wrote: > From: Eric Dumazet > > Sent: 27 February 2017 22:35 > > On Mon, 2017-02-27 at 14:14 -0800, Stephen Hemminger wrote: > > > > > The original design (as Davem mentioned) was that IRQ's must be disabled > > > during device polling. If that was t

Re: [PATCH v3 net] net: solve a NAPI race

2017-02-28 Thread Eric Dumazet
On Tue, 2017-02-28 at 10:14 +, David Laight wrote: > From: Eric Dumazet > > Sent: 27 February 2017 22:35 > > On Mon, 2017-02-27 at 14:14 -0800, Stephen Hemminger wrote: > > > > > The original design (as Davem mentioned) was that IRQ's must be disabled > > > during device polling. If that was t

RE: [PATCH v3 net] net: solve a NAPI race

2017-02-28 Thread David Laight
From: Eric Dumazet > Sent: 27 February 2017 22:35 > On Mon, 2017-02-27 at 14:14 -0800, Stephen Hemminger wrote: > > > The original design (as Davem mentioned) was that IRQ's must be disabled > > during device polling. If that was true, then the race above > > would be impossible. > > I would love

Re: [PATCH v3 net] net: solve a NAPI race

2017-02-27 Thread Stephen Hemminger
On Mon, 27 Feb 2017 17:48:54 -0500 (EST) David Miller wrote: > From: Stephen Hemminger > Date: Mon, 27 Feb 2017 14:44:55 -0800 > > > On Mon, 27 Feb 2017 14:35:17 -0800 > > Eric Dumazet wrote: > > > >> On Mon, 2017-02-27 at 14:14 -0800, Stephen Hemminger wrote: > >> > >> > The original de

Re: [PATCH v3 net] net: solve a NAPI race

2017-02-27 Thread David Miller
From: Stephen Hemminger Date: Mon, 27 Feb 2017 14:44:55 -0800 > On Mon, 27 Feb 2017 14:35:17 -0800 > Eric Dumazet wrote: > >> On Mon, 2017-02-27 at 14:14 -0800, Stephen Hemminger wrote: >> >> > The original design (as Davem mentioned) was that IRQ's must be disabled >> > during device polling.

Re: [PATCH v3 net] net: solve a NAPI race

2017-02-27 Thread Stephen Hemminger
On Mon, 27 Feb 2017 14:35:17 -0800 Eric Dumazet wrote: > On Mon, 2017-02-27 at 14:14 -0800, Stephen Hemminger wrote: > > > The original design (as Davem mentioned) was that IRQ's must be disabled > > during device polling. If that was true, then the race above > > would be impossible. > > I w

Re: [PATCH v3 net] net: solve a NAPI race

2017-02-27 Thread Eric Dumazet
On Mon, 2017-02-27 at 14:14 -0800, Stephen Hemminger wrote: > The original design (as Davem mentioned) was that IRQ's must be disabled > during device polling. If that was true, then the race above > would be impossible. I would love to see an alternative patch.

Re: [PATCH v3 net] net: solve a NAPI race

2017-02-27 Thread Stephen Hemminger
On Mon, 27 Feb 2017 12:18:31 -0800 Eric Dumazet wrote: > thread 1 thread 2 (could be on same cpu) > > // busy polling or napi_watchdog() > napi_schedule(); > ... > napi->poll() > > device polling: > read 2 packets from ring buffer >

[PATCH v3 net] net: solve a NAPI race

2017-02-27 Thread Eric Dumazet
From: Eric Dumazet While playing with mlx4 hardware timestamping of RX packets, I found that some packets were received by TCP stack with a ~200 ms delay... Since the timestamp was provided by the NIC, and my probe was added in tcp_v4_rcv() while in BH handler, I was confident it was not a sende