• Alexander Duyck's avatar
    i40e/i40evf: Account for frags split over multiple descriptors in check linearize · 248de22e
    Alexander Duyck authored
    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: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
    Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    248de22e
i40e_txrx.c 95.5 KB