diff options
author | Emil Tantilov <emil.s.tantilov@intel.com> | 2011-04-20 04:49:06 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2011-05-04 15:17:33 -0400 |
commit | 68c7005d664724eab87627b042e149a736622d54 (patch) | |
tree | c2257af755eba410a8af9a88ae10c93b462e41d2 /drivers/net/ixgbe/ixgbe_ethtool.c | |
parent | 95a46011843a3c49e1a002eddb6b2735c201e378 (diff) |
ixgbe: improve EEPROM read/write operations
Introduce buffered read/writes which greatly improves performance on
parts with large EEPROMs.
Previously reading/writing a word requires taking/releasing of synchronization
semaphores which adds 10ms to each operation. The optimization is to
read/write in buffers, but make sure the semaphore is not held for >500ms
according to the datasheet.
Since we can't read the EEPROM page size ixgbe_detect_eeprom_page_size() is
used to discover the EEPROM size when needed and keeps the result in
word_page_size for the rest of the run time.
Use buffered reads for ethtool -e.
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 410c29875785..f2efa3245352 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -847,11 +847,8 @@ static int ixgbe_get_eeprom(struct net_device *netdev, | |||
847 | if (!eeprom_buff) | 847 | if (!eeprom_buff) |
848 | return -ENOMEM; | 848 | return -ENOMEM; |
849 | 849 | ||
850 | for (i = 0; i < eeprom_len; i++) { | 850 | ret_val = hw->eeprom.ops.read_buffer(hw, first_word, eeprom_len, |
851 | if ((ret_val = hw->eeprom.ops.read(hw, first_word + i, | 851 | eeprom_buff); |
852 | &eeprom_buff[i]))) | ||
853 | break; | ||
854 | } | ||
855 | 852 | ||
856 | /* Device's eeprom is always little-endian, word addressable */ | 853 | /* Device's eeprom is always little-endian, word addressable */ |
857 | for (i = 0; i < eeprom_len; i++) | 854 | for (i = 0; i < eeprom_len; i++) |