summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPunnaiah Choudary Kalluri <punnaiah.choudary.kalluri@xilinx.com>2015-04-29 08:34:46 +0530
committerBen Hutchings <ben@decadent.org.uk>2019-02-11 17:54:28 +0000
commitff32ea6ffc00557fdb5343078c3a0afaaf9a4364 (patch)
tree221c79ffe9a31582f8f94f90145ba5b5d6af7941
parent18a27a07b2afbd76dd94b5be9f569f842429a7da (diff)
net: macb: Fix race condition in driver when Rx frame is dropped
commit d4c216c54197d741ed8b7ca54f13645dfb3eacde upstream. Under heavy Rx load, observed that the Hw is updating the USED bit and it is not updating the received frame status to the BD control field. This could be lack of resources for processing the BDs at high data rates. Driver drops the frame associated with this BD but not clearing the USED bit. So, this is causing hang condition as Hw expects USED bit to be cleared for this BD. Signed-off-by: Punnaiah Choudary Kalluri <punnaia@xilinx.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--drivers/net/ethernet/cadence/macb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 996b3b7d93ec..3e126057a8cc 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -634,6 +634,9 @@ static void gem_rx_refill(struct macb *bp)
/* properly align Ethernet header */
skb_reserve(skb, NET_IP_ALIGN);
+ } else {
+ bp->rx_ring[entry].addr &= ~MACB_BIT(RX_USED);
+ bp->rx_ring[entry].ctrl = 0;
}
}