]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.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)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 6 Apr 2016 09:22:04 +0000 (10:22 +0100)
commit0a90a70783dfd8331d90c48b3ea8b6719af608a4
tree25973647cfad693423a76859d83ee08014b5bd39
parent896f1911ee4d8e72ddfafa3f2f04dd4ea5a1d4ba
tg3: Fix for tg3 transmit queue 0 timed out when too many gso_segs

BugLink: http://bugs.launchpad.net/bugs/1553179
[ 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/net/ethernet/broadcom/tg3.c