igb: Only sync size of expected frame in ethtool testing
authorAlexander Duyck <alexander.h.duyck@intel.com>
Tue, 7 Feb 2017 02:26:26 +0000 (18:26 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 17 Mar 2017 19:11:44 +0000 (12:11 -0700)
We only need to sync the size of the frame that is read to test.  We don't
need to sync the entire Rx buffer.  This way the testing is more consistent
with how we handle things in the receive path.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/igb/igb_ethtool.c

index 612cf13b7a3ab367f2fd6116e1998d2def838356..d5966feb7b96c00ecb586ddbe017c2940df08772 100644 (file)
@@ -1818,7 +1818,7 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring,
                /* sync Rx buffer for CPU read */
                dma_sync_single_for_cpu(rx_ring->dev,
                                        rx_buffer_info->dma,
-                                       IGB_RX_BUFSZ,
+                                       size,
                                        DMA_FROM_DEVICE);
 
                /* verify contents of skb */
@@ -1828,7 +1828,7 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring,
                /* sync Rx buffer for device write */
                dma_sync_single_for_device(rx_ring->dev,
                                           rx_buffer_info->dma,
-                                          IGB_RX_BUFSZ,
+                                          size,
                                           DMA_FROM_DEVICE);
 
                /* unmap buffer on Tx side */