[PATCH 2/2] net: nps_enet: code reuse

2016-07-13 Thread Elad Kanfi
From: Elad Kanfi Add inline function that checks if there is a pending tx packet. Signed-off-by: Elad Kanfi --- drivers/net/ethernet/ezchip/nps_enet.c | 21 +++-- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/ezchip/nps_enet.c b

[PATCH 1/2] net: nps_enet: fix coding style issues

2016-07-13 Thread Elad Kanfi
From: Elad Kanfi Fix following coding style problems : ERROR: else should follow close brace '}' + } + else { /* !dst_is_aligned */ WARNING: Missing a blank line after declarations + u32 buf = nps_enet_reg_get(priv, NPS_ENET_

[PATCH 0/2] Code style fixes

2016-07-13 Thread Elad Kanfi
From: Elad Kanfi Fix all checkpatch warnings and errors, and reuse code Elad Kanfi (2): net: nps_enet: fix coding style issues net: nps_enet: code reuse drivers/net/ethernet/ezchip/nps_enet.c | 27 ++- 1 files changed, 14 insertions(+), 13 deletions(-)

[PATCH 1/1] net: nps_enet: Fix PCS reset

2016-07-12 Thread Elad Kanfi
From: Noam Camus During commit b54b8c2d6e3c ("net: ezchip: adapt driver to little endian architecture") adapting to little endian architecture, zeroing of controller was left out. Signed-off-by: Elad Kanfi --- drivers/net/ethernet/ezchip/nps_enet.c |1 + 1 files changed, 1

[PATCH 1/1] Fix PCS reset

2016-07-12 Thread Elad Kanfi
From: Noam Camus During commit b54b8c2d6e3c ("net: ezchip: adapt driver to little endian architecture") adapting to little endian architecture, zeroing of controller was left out. Signed-off-by: Elad Kanfi --- drivers/net/ethernet/ezchip/nps_enet.c |1 + 1 files changed, 1

[PATCH 1/1] net: nps_enet: Disable interrupts before napi reschedule

2016-05-26 Thread Elad Kanfi
From: Elad Kanfi Since NAPI works by shutting down event interrupts when theres work and turning them on when theres none, the net driver must make sure that interrupts are disabled when it reschedules polling. By calling napi_reschedule, the driver switches to polling mode, therefor there

[PATCH v3 2/2] net: nps_enet: bug fix - handle lost tx interrupts

2016-05-09 Thread Elad Kanfi
From: Elad Kanfi The tx interrupt is of edge type, and in case such interrupt is triggered while it is masked it will not be handled even after tx interrupts are re-enabled in the end of NAPI poll. This will cause tx network to stop in the following scenario: * Rx is being handled, hence

[PATCH v3 1/2] net: nps_enet: Tx handler synchronization

2016-05-09 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 v3 0/2] Net driver bugs fix

2016-05-09 Thread Elad Kanfi
From: Elad Kanfi v3: tx_packet_sent flag is not necessary, use socket buffer pointer instead. Use wmb() instead of smp_wmb(). v2: Remove code style commit for now. Code style commit will be added after the bugs fix will be approved. Summary: 1. Bug description: TX done interrupts that arrives

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 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 to

[PATCH v2 2/2] net: nps_enet: bug fix - handle lost tx interrupts

2016-04-27 Thread Elad Kanfi
From: Elad Kanfi The tx interrupt is of edge type, and in case such interrupt is triggered while it is masked it will not be handled even after tx interrupts are re-enabled in the end of NAPI poll. This will cause tx network to stop in the following scenario: * Rx is being handled, hence

[PATCH v2 0/2] Net driver bugs fix

2016-04-27 Thread Elad Kanfi
From: Elad Kanfi v2: Remove code style commit for now. Code style commit will be added after the bugs fix will be approved. Summary: 1. Bug description: TX done interrupts that arrives while interrupts are masked, during NAPI poll, will not trigger an interrupt handling. Since TX

[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