]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tg3: Fix for tg3 transmit queue 0 timed out when too many gso_segs
authorSiva Reddy Kallam <siva.kallam@broadcom.com>
Wed, 3 Feb 2016 08:39:38 +0000 (14:09 +0530)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:45:19 +0000 (15:45 -0700)
commit3b7647a7128ddc1274027350a202dffb8951972b
treeb3215deedcff9aa5e1d16fac61785c3515e58af9
parent20b2d52fc98925d3242994c7bff9dbfb7b01c4e4
tg3: Fix for tg3 transmit queue 0 timed out when too many gso_segs

Orabug: 23330947

[ Upstream commit b7d987295c74500b733a0ba07f9a9bcc4074fa83 ]

tg3_tso_bug() can hit a condition where the entire tx ring is not big
enough to segment the GSO packet. For example, if MSS is very small,
gso_segs can exceed the tx ring size. When we hit the condition, it
will cause tx timeout.

tg3_tso_bug() is called to handle TSO and DMA hardware bugs.
For TSO bugs, if tg3_tso_bug() cannot succeed, we have to drop the packet.
For DMA bugs, we can still fall back to linearize the SKB and let the
hardware transmit the TSO packet.

This patch adds a function tg3_tso_bug_gso_check() to check if there
are enough tx descriptors for GSO before calling tg3_tso_bug().
The caller will then handle the error appropriately - drop or
lineraize the SKB.

v2: Corrected patch description to avoid confusion.

Signed-off-by: Siva Reddy Kallam <siva.kallam@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Acked-by: Prashant Sreedharan <prashant@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit beb9881442593e9de581bf7d5396788cfedcdbd3)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
drivers/net/ethernet/broadcom/tg3.c