]> www.infradead.org Git - users/jedix/linux-maple.git/commit
r8169: fix unsigned int wraparound with TSO
authorJulien Ducourthial <jducourt@free.fr>
Tue, 8 May 2012 22:00:06 +0000 (00:00 +0200)
committerJoe Jin <joe.jin@oracle.com>
Fri, 18 May 2012 03:39:50 +0000 (11:39 +0800)
commite95eca1760bbb4ab27f2d4c394e70516fa4da14b
tree0b16ec12bb1b3fe272f47660d447cfaadce08fab
parent6da06df9937efa3eb11cc74484fe4945a8f542e4
r8169: fix unsigned int wraparound with TSO

The r8169 may get stuck or show bad behaviour after activating TSO :
the net_device is not stopped when it has no more TX descriptors.
This problem comes from TX_BUFS_AVAIL which may reach -1 when all
transmit descriptors are in use. The patch simply tries to keep positive
values.

Tested with 8111d(onboard) on a D510MO, and with 8111e(onboard) on a
Zotac 890GXITX.

(cherry picked from commit 477206a018f902895bfcd069dd820bfe94c187b1)
Signed-off-by: Julien Ducourthial <jducourt@free.fr>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/r8169.c