]> git.baikalelectronics.ru Git - kernel.git/commit
net: mvneta: fix handling of the Tx descriptor counter
authorSimon Guinot <simon.guinot@sequanux.org>
Mon, 13 Nov 2017 15:27:02 +0000 (16:27 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Nov 2017 12:52:25 +0000 (21:52 +0900)
commit47ca995060077702e94716c802ba8c4d9f7a6fd1
tree017d1bcdb1e2a4153c08e4ebb3d8ee49b27f9921
parent1f49c62553798f052158179c3081dc04b253531b
net: mvneta: fix handling of the Tx descriptor counter

The mvneta controller provides a 8-bit register to update the pending
Tx descriptor counter. Then, a maximum of 255 Tx descriptors can be
added at once. In the current code the mvneta_txq_pend_desc_add function
assumes the caller takes care of this limit. But it is not the case. In
some situations (xmit_more flag), more than 255 descriptors are added.
When this happens, the Tx descriptor counter register is updated with a
wrong value, which breaks the whole Tx queue management.

This patch fixes the issue by allowing the mvneta_txq_pend_desc_add
function to process more than 255 Tx descriptors.

Fixes: 3f9090ad8dcc ("net: mvneta: add xmit_more support")
Cc: stable@vger.kernel.org # 4.11+
Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvneta.c