]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitf60c9f9a5e0e2eb69d0bfd64e3aa7c458d05fd1e
tree271c9be173075596ce82522e4f3818a5044bae8c
parente91222921f5582422eafe1a3cf1c62297bca6f99
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