]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
i40e/i40evf: Account for frags split over multiple descriptors in check linearize
authorAlexander Duyck <alexander.h.duyck@intel.com>
Tue, 20 Mar 2018 15:40:00 +0000 (16:40 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 3 Apr 2018 11:20:33 +0000 (13:20 +0200)
commitad57ac48a8d6a357b2620a110d56412c8d78439c
tree627bc1ca9f828b3d50b85a6c11520eb2c8462297
parent47042fa566257ea311911ff0851dc618d3f8072b
i40e/i40evf: Account for frags split over multiple descriptors in check linearize

BugLink: http://bugs.launchpad.net/bugs/1723127
The original code for __i40e_chk_linearize didn't take into account the
fact that if a fragment is 16K in size or larger it has to be split over 2
descriptors and the smaller of those 2 descriptors will be on the trailing
edge of the transmit. As a result we can get into situations where we didn't
catch requests that could result in a Tx hang.

This patch takes care of that by subtracting the length of all but the
trailing edge of the stale fragment before we test for sum. By doing this
we can guarantee that we have all cases covered, including the case of a
fragment that spans multiple descriptors. We don't need to worry about
checking the inner portions of this since 12K is the maximum aligned DMA
size and that is larger than any MSS will ever be since the MTU limit for
jumbos is something on the order of 9K.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry-picked from 248de22e638f10bd5bfc7624a357f940f66ba137)
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40evf/i40e_txrx.c