Re: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag

2016-05-10 Thread Lino Sanfilippo
Hi Elad, On 08.05.2016 15:44, Elad Kanfi wrote: > > After reviewing the code and your suggestion, it seems that we can do without > the flag tx_packet_sent and therefor the first issue becomes irrelevant. > The indication that a packet was sent is (tx_skb != NULL) , and the sequence > will

Re: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag

2016-05-10 Thread Lino Sanfilippo
Hi Elad, On 08.05.2016 15:44, Elad Kanfi wrote: > > After reviewing the code and your suggestion, it seems that we can do without > the flag tx_packet_sent and therefor the first issue becomes irrelevant. > The indication that a packet was sent is (tx_skb != NULL) , and the sequence > will

RE: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag

2016-05-08 Thread Elad Kanfi
Hi Lino, > Please see sections "SMP BARRIER PAIRING" and "EXAMPLES OF MEMORY BARRIER > SEQUENCES" in > memory-barriers.txt for a description why smp barriers have to be paired and > a smp write barrier on CPU A without a read barrier on CPU B is _not_ > sufficient. > > Furthermore after having

RE: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag

2016-05-08 Thread Elad Kanfi
Hi Lino, > Please see sections "SMP BARRIER PAIRING" and "EXAMPLES OF MEMORY BARRIER > SEQUENCES" in > memory-barriers.txt for a description why smp barriers have to be paired and > a smp write barrier on CPU A without a read barrier on CPU B is _not_ > sufficient. > > Furthermore after having

Re: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag

2016-05-02 Thread Lino Sanfilippo
Hi Elad, On 02.05.2016 12:21, Elad Kanfi wrote: Since this driver handles one frame at a time, I couldn't find a case that requires the paired barrier. The order of reads is not critical once it is assured that the value is valid. Please see sections "SMP BARRIER PAIRING" and "EXAMPLES

Re: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag

2016-05-02 Thread Lino Sanfilippo
Hi Elad, On 02.05.2016 12:21, Elad Kanfi wrote: Since this driver handles one frame at a time, I couldn't find a case that requires the paired barrier. The order of reads is not critical once it is assured that the value is valid. Please see sections "SMP BARRIER PAIRING" and "EXAMPLES

RE: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag

2016-05-02 Thread Elad Kanfi
-Original Message- From: David Miller [mailto:da...@davemloft.net] Sent: Friday, April 29, 2016 12:11 AM To: Elad Kanfi Cc: Noam Camus; linux-kernel@vger.kernel.org; abrod...@synopsys.com; Tal Zilcer; net...@vger.kernel.org Subject: Re: [PATCH v2 1/2] net: nps_enet: Sync access

RE: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag

2016-05-02 Thread Elad Kanfi
-Original Message- From: David Miller [mailto:da...@davemloft.net] Sent: Friday, April 29, 2016 12:11 AM To: Elad Kanfi Cc: Noam Camus; linux-kernel@vger.kernel.org; abrod...@synopsys.com; Tal Zilcer; net...@vger.kernel.org Subject: Re: [PATCH v2 1/2] net: nps_enet: Sync access

Re: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag

2016-04-28 Thread David Miller
From: Elad Kanfi Date: Wed, 27 Apr 2016 16:18:29 +0300 > From: Elad Kanfi > > Below is a description of a possible problematic > sequence. CPU-A is sending a frame and CPU-B handles > the interrupt that indicates the frame was sent. CPU-B > reads an

Re: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag

2016-04-28 Thread David Miller
From: Elad Kanfi Date: Wed, 27 Apr 2016 16:18:29 +0300 > From: Elad Kanfi > > Below is a description of a possible problematic > sequence. CPU-A is sending a frame and CPU-B handles > the interrupt that indicates the frame was sent. CPU-B > reads an invalid value of tx_packet_sent. > >

Re: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag

2016-04-27 Thread Lino Sanfilippo
Hi, On 27.04.2016 15:18, Elad Kanfi wrote: From: Elad Kanfi Below is a description of a possible problematic sequence. CPU-A is sending a frame and CPU-B handles the interrupt that indicates the frame was sent. CPU-B reads an invalid value of tx_packet_sent.

Re: [PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag

2016-04-27 Thread Lino Sanfilippo
Hi, On 27.04.2016 15:18, Elad Kanfi wrote: From: Elad Kanfi Below is a description of a possible problematic sequence. CPU-A is sending a frame and CPU-B handles the interrupt that indicates the frame was sent. CPU-B reads an invalid value of tx_packet_sent. CPU-A

[PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag

2016-04-27 Thread Elad Kanfi
From: Elad Kanfi Below is a description of a possible problematic sequence. CPU-A is sending a frame and CPU-B handles the interrupt that indicates the frame was sent. CPU-B reads an invalid value of tx_packet_sent. CPU-A CPU-B

[PATCH v2 1/2] net: nps_enet: Sync access to packet sent flag

2016-04-27 Thread Elad Kanfi
From: Elad Kanfi Below is a description of a possible problematic sequence. CPU-A is sending a frame and CPU-B handles the interrupt that indicates the frame was sent. CPU-B reads an invalid value of tx_packet_sent. CPU-A CPU-B -