diff options
author | Mitch Williams <mitch.a.williams@intel.com> | 2014-06-03 19:50:20 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2014-06-19 23:22:06 -0400 |
commit | cc70b080ea773d7aea4a0440316f30f5af6bb655 (patch) | |
tree | 8b7152277c3da3a323b7dd15a7b01cc3f3014e76 | |
parent | e57a2fea8787dffcbdff3f7f0567a1e8555dd93a (diff) |
i40evf: fix off-by-one
The loop in i40evf_get_rxfh_indir was only reading fifteen registers,
not all sixteen. Change the matching loop in i40evf_set_rxfh_indir at
the same time to make the code more consistent.
Change-ID: I6c182287698e742d1f6ca1a4bcc43cc08df6e1de
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c index 60407a9df0c1..e70e4cdb0eb2 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | |||
@@ -632,7 +632,7 @@ static int i40evf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key) | |||
632 | u32 hlut_val; | 632 | u32 hlut_val; |
633 | int i, j; | 633 | int i, j; |
634 | 634 | ||
635 | for (i = 0, j = 0; i < I40E_VFQF_HLUT_MAX_INDEX; i++) { | 635 | for (i = 0, j = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) { |
636 | hlut_val = rd32(hw, I40E_VFQF_HLUT(i)); | 636 | hlut_val = rd32(hw, I40E_VFQF_HLUT(i)); |
637 | indir[j++] = hlut_val & 0xff; | 637 | indir[j++] = hlut_val & 0xff; |
638 | indir[j++] = (hlut_val >> 8) & 0xff; | 638 | indir[j++] = (hlut_val >> 8) & 0xff; |
@@ -659,7 +659,7 @@ static int i40evf_set_rxfh(struct net_device *netdev, const u32 *indir, | |||
659 | u32 hlut_val; | 659 | u32 hlut_val; |
660 | int i, j; | 660 | int i, j; |
661 | 661 | ||
662 | for (i = 0, j = 0; i < I40E_VFQF_HLUT_MAX_INDEX + 1; i++) { | 662 | for (i = 0, j = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) { |
663 | hlut_val = indir[j++]; | 663 | hlut_val = indir[j++]; |
664 | hlut_val |= indir[j++] << 8; | 664 | hlut_val |= indir[j++] << 8; |
665 | hlut_val |= indir[j++] << 16; | 665 | hlut_val |= indir[j++] << 16; |