summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorLihong Yang <lihong.yang@intel.com>2017-01-30 23:29:32 +0300
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2017-03-15 11:58:21 +0300
commitc271dd6c391b535226cf1a81aaad9f33cb5899d3 (patch)
treed713ff74140b3054d53ee6961a7b84bfc739e1d7 /drivers/net
parentc0cf70a6fc373570f86c6dc4799d775363b9946e (diff)
downloadlinux-c271dd6c391b535226cf1a81aaad9f33cb5899d3.tar.xz
i40e: fix ethtool to get EEPROM data from X722 interface
Currently ethtool -e will error out with a X722 interface as its EEPROM has a scope limit at offset 0x5B9FFF. This patch fixes the issue by setting the EEPROM length to the scope limit to avoid NVM read failure beyond that. Change-ID: I0b7d4dd6c7f2a57cace438af5dffa0f44c229372 Signed-off-by: Lihong Yang <lihong.yang@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_ethtool.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index a22e26200bcc..3aefc9e20439 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -1165,6 +1165,11 @@ static int i40e_get_eeprom_len(struct net_device *netdev)
struct i40e_hw *hw = &np->vsi->back->hw;
u32 val;
+#define X722_EEPROM_SCOPE_LIMIT 0x5B9FFF
+ if (hw->mac.type == I40E_MAC_X722) {
+ val = X722_EEPROM_SCOPE_LIMIT + 1;
+ return val;
+ }
val = (rd32(hw, I40E_GLPCI_LBARCTRL)
& I40E_GLPCI_LBARCTRL_FL_SIZE_MASK)
>> I40E_GLPCI_LBARCTRL_FL_SIZE_SHIFT;