[PATCH v3 0/2] Net driver bugs fix

From: Elad Kanfi
Date: Mon May 09 2016 - 13:13:52 EST


From: Elad Kanfi <eladkan@xxxxxxxxxxxx>

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 while interrupts
are masked, during NAPI poll, will not trigger an interrupt handling.
Since TX interrupt is of level edge we will lose the TX done interrupt.
As a result all pending tx frames will get no service.

Solution: Check if there is a pending tx request after unmasking the
interrupt and if answer is yes then re-add ourselves to
the NAPI poll list.

2. Bug description: CPU-A before sending a frame will set a variable
to true. CPU-B that executes the tx done interrupt service routine
might read a non valid value of that variable.

Solution: Use the socket buffer pointer instead of the variable,
and add a write memory barrier at the tx sending function after
the pointer is set.

Elad Kanfi (2):
net: nps_enet: Tx handler synchronization
net: nps_enet: bug fix - handle lost tx interrupts

drivers/net/ethernet/ezchip/nps_enet.c | 30 ++++++++++++++++++++++++------
drivers/net/ethernet/ezchip/nps_enet.h | 2 --
2 files changed, 24 insertions(+), 8 deletions(-)