OSDN Git Service

i40e/i40evf: Account for frags split over multiple descriptors in check linearize
authorAlexander Duyck <alexander.h.duyck@intel.com>
Fri, 8 Dec 2017 18:55:04 +0000 (10:55 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 3 Jan 2018 16:47:29 +0000 (08:47 -0800)
commit248de22e638f10bd5bfc7624a357f940f66ba137
tree271c9be173075596ce82522e4f3818a5044bae8c
parent64e711ca59ef9b7873d77ef06bc174aa01af9115
i40e/i40evf: Account for frags split over multiple descriptors in check linearize

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>
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40evf/i40e_txrx.c