linux-stable/drivers/net/ethernet/natsemi
Finn Thain eaabfd19b2 net/sonic: Avoid needless receive descriptor EOL flag updates
The while loop in sonic_rx() traverses the rx descriptor ring. It stops
when it reaches a descriptor that the SONIC has not used. Each iteration
advances the EOL flag so the SONIC can keep using more descriptors.
Therefore, the while loop has no definite termination condition.

The algorithm described in the National Semiconductor literature is quite
different. It consumes descriptors up to the one with its EOL flag set
(which will also have its "in use" flag set). All freed descriptors are
then returned to the ring at once, by adjusting the EOL flags (and link
pointers).

Adopt the algorithm from datasheet as it's simpler, terminates quickly
and avoids a lot of pointless descriptor EOL flag changes.

Fixes: efcce83936 ("[PATCH] macsonic/jazzsonic network drivers update")
Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-01-23 21:24:37 +01:00
..
jazzsonic.c net/sonic: Replace custom debug logging with netif_* calls 2018-02-26 14:40:02 -05:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
macsonic.c net/sonic: Replace custom debug logging with netif_* calls 2018-02-26 14:40:02 -05:00
Makefile ethernet: natsemi: correct spelling 2018-03-06 11:14:08 -05:00
natsemi.c net: natsemi: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles 2019-02-14 11:56:36 -05:00
ns83820.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
sonic.c net/sonic: Avoid needless receive descriptor EOL flag updates 2020-01-23 21:24:37 +01:00
sonic.h net/sonic: Fix receive buffer handling 2020-01-23 21:24:37 +01:00
xtsonic.c net/sonic: Replace custom debug logging with netif_* calls 2018-02-26 14:40:02 -05:00