i40e: fix register dump offset
authorRemy Horton <remy.horton@intel.com>
Wed, 13 Apr 2016 09:44:45 +0000 (10:44 +0100)
committerBruce Richardson <bruce.richardson@intel.com>
Fri, 6 May 2016 13:51:22 +0000 (15:51 +0200)
The position of register values within i40e register dumps is
supposed to reflect the register addresses. These were not being
correctly calculated.

Fixes: d9efd0136ac1 ("i40e: add EEPROM and registers dumping")

Signed-off-by: Remy Horton <remy.horton@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
drivers/net/i40e/i40e_ethdev.c

index d8b6bd7..43939ca 100644 (file)
@@ -9030,6 +9030,7 @@ static int i40e_get_regs(struct rte_eth_dev *dev,
                                        arr_idx2++) {
                                reg_offset = arr_idx * reg_info->stride1 +
                                        arr_idx2 * reg_info->stride2;
+                               reg_offset += reg_info->base_addr;
                                ptr_data[reg_offset >> 2] =
                                        i40e_read_rx_ctl(hw, reg_offset);
                        }
@@ -9045,6 +9046,7 @@ static int i40e_get_regs(struct rte_eth_dev *dev,
                                        arr_idx2++) {
                                reg_offset = arr_idx * reg_info->stride1 +
                                        arr_idx2 * reg_info->stride2;
+                               reg_offset += reg_info->base_addr;
                                ptr_data[reg_offset >> 2] =
                                        I40E_READ_REG(hw, reg_offset);
                        }