From: Alexander Duyck Date: Thu, 8 Sep 2016 03:28:17 +0000 (-0700) Subject: ixgbe: Limit reporting of redirection table if SR-IOV is enabled X-Git-Tag: v4.1.12-92~2^2~134 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=dbc68ca095db74d45af8c73bc39ef88353a667b3;p=users%2Fjedix%2Flinux-maple.git ixgbe: Limit reporting of redirection table if SR-IOV is enabled Orabug: 24568240 The hardware redirection table can support more queues then the PF currently has when SR-IOV is enabled. In order to account for this use the RSS mask to trim of the bits that are not used. Signed-off-by: Alexander Duyck Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher (cherry picked from commit fa81da7e5b261cf8010f65253661522d3ff71714) Signed-off-by: Brian Maly --- diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index 906d3943fb50..cd9b094a541e 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c @@ -2950,9 +2950,13 @@ static u32 ixgbe_rss_indir_size(struct net_device *netdev) static void ixgbe_get_reta(struct ixgbe_adapter *adapter, u32 *indir) { int i, reta_size = ixgbe_rss_indir_tbl_entries(adapter); + u16 rss_m = adapter->ring_feature[RING_F_RSS].mask; + + if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) + rss_m = adapter->ring_feature[RING_F_RSS].indices - 1; for (i = 0; i < reta_size; i++) - indir[i] = adapter->rss_indir_tbl[i]; + indir[i] = adapter->rss_indir_tbl[i] & rss_m; } static int ixgbe_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,