• Emil Tantilov's avatar
    ixgbe: split Tx/Rx ring clearing for ethtool loopback test · 761c2a48
    Emil Tantilov authored
    Commit: fed21bcee7a5
    ("ixgbe: Don't bother clearing buffer memory for descriptor rings)
    
    exposed some issues with the logic in the current implementation of
    ixgbe_clean_test_rings() that are being addressed in this patch:
    
    - Split the clearing of the Tx and Rx rings in separate loops. Previously
    both Tx and Rx rings were cleared in a rx_desc->wb.upper.length based
    loop which could lead to issues if for w/e reason packets were received
    outside of the frames transmitted for the loopback test.
    
    - Add check for IXGBE_TXD_STAT_DD to avoid clearing the rings if the
    transmits have not comlpeted by the time we enter ixgbe_clean_test_rings()
    
    - Exit early on ixgbe_check_lbtest_frame() failure.
    
    This change fixes a crash during ethtool diagnostic (ethtool -t).
    Signed-off-by: default avatarEmil Tantilov <emil.s.tantilov@intel.com>
    Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    761c2a48
ixgbe_ethtool.c 99.5 KB