]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Jan 2019 23:35:06 +0000 (15:35 -0800)
commit506da7d19bc48eb610c84e225878e468780b8357
treeb075afe3743760f4b27da8f4a3b3dce9938def07
parente6024dc87e128cd119037f944da19249d99db9db
net: stmmac: Prevent RX starvation in stmmac_napi_poll()

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>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c