]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
igb: Garbled output for "ethtool -m"
authorDoron Shikmoni <doron.shikmoni@gmail.com>
Wed, 17 Feb 2016 07:34:25 +0000 (09:34 +0200)
committerKirtikar Kashyap <kirtikar.kashyap@oracle.com>
Thu, 22 Jun 2017 21:28:30 +0000 (14:28 -0700)
Garbled output for "ethtool -m ethX", in igb-driven NICs with module /
plugin EEPROM (i.e. SFP information). Each output data byte appears
duplicated.

In igb_ethtool.c, igb_get_module_eeprom() is reading the EEPROM via i2c;
the eeprom offset for each word that's read via igb_read_phy_reg_i2c()
was passed in #words, whereas it needs to be a byte offset.
This patches fixes the bug.

Signed-off-by: Doron Shikmoni <doron.shikmoni@gmail.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit efea95d45e6ab4a30df9801f8e9bf68007ee9b43)

Orabug: 26325580

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
drivers/net/ethernet/intel/igb/igb_ethtool.c

index f4f0e306c5b63bd06bb492a0b00d3bd4963d5e7e..d157d2400e17324fa18e73367956e0dff6e9fe92 100644 (file)
@@ -2835,7 +2835,8 @@ static int igb_get_module_eeprom(struct net_device *netdev,
 
        /* Read EEPROM block, SFF-8079/SFF-8472, word at a time */
        for (i = 0; i < last_word - first_word + 1; i++) {
-               status = igb_read_phy_reg_i2c(hw, first_word + i, &dataword[i]);
+               status = igb_read_phy_reg_i2c(hw, (first_word + i) * 2,
+                                             &dataword[i]);
                if (status) {
                        /* Error occurred while reading module */
                        kfree(dataword);