i40e: Test memory before ethtool alloc succeeds
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Mon, 18 Apr 2016 18:33:49 +0000 (11:33 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 6 May 2016 06:17:07 +0000 (23:17 -0700)
commit147e81ec7568933a51fe58b64244383e929870fb
tree5eeafe28eb1185c47e571281321a389b2b62ceeb
parentb163098ea1eece88a8834952dcbade1f17378731
i40e: Test memory before ethtool alloc succeeds

When testing on systems with very limited amounts of RAM, a bug was
found where, while changing the number of descriptors using ethtool,
the driver didn't test the limits of system memory before permanently
assuming it would be able to get receive buffer memory.

Work around this issue by pre-allocation of the receive buffer
memory, in the "ghost" ring, which is then used during reinit
using the new ring length.

Change-Id: I92d7a5fb59a6c884b2efdd1ec652845f101c3359
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@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_ethtool.c