net: stmmac: Prevent RX starvation in stmmac_napi_poll()
authorJose Abreu <jose.abreu@synopsys.com>
Wed, 9 Jan 2019 09:06:00 +0000 (10:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Feb 2019 09:08:54 +0000 (10:08 +0100)
commit1b8742ba98a5bf0b5d0e30fb61cbe1c61fa4e88b
treee13e73c1f9984ef5f17bb924f1b3305c57f03a72
parent2406055411edb6f27b373d712c5f3b618438b181
net: stmmac: Prevent RX starvation in stmmac_napi_poll()

[ Upstream commit fa0be0a43f101888ac677dba31b590963eafeaa1 ]

Currently, TX is given a budget which is consumed by stmmac_tx_clean()
and stmmac_rx() is given the remaining non-consumed budget.

This is wrong and in case we are sending a large number of packets this
can starve RX because remaining budget will be low.

Let's give always the same budget for RX and TX clean.

While at it, check if we missed any interrupts while we were in NAPI
callback by looking at DMA interrupt status.

Cc: Joao Pinto <jpinto@synopsys.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c