OSDN Git Service

ixgbe: split Tx/Rx ring clearing for ethtool loopback test
authorEmil Tantilov <emil.s.tantilov@intel.com>
Tue, 29 Aug 2017 19:21:48 +0000 (12:21 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 9 Oct 2017 16:41:25 +0000 (09:41 -0700)
commit761c2a48c70d871b0622dccaa20ccad024101a51
treec9c5e16b62827a8d3960cf26640e87528d71423f
parentc69be946d687a99dbc891ebc66539c1c2f082c1d
ixgbe: split Tx/Rx ring clearing for ethtool loopback test

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: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c