summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Tantilov <emil.s.tantilov@intel.com>2015-07-09 12:28:59 -0700
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2015-09-01 17:13:00 -0700
commit7e3f5c8881ba45eba1c74344b00558920008e6e6 (patch)
tree036cf687255e83db2726349f2597b8021a796721
parent1c7cf0784e4d448ed8a07c5fc1e3aac1528272f1 (diff)
downloadlinux-stable-7e3f5c8881ba45eba1c74344b00558920008e6e6.tar.gz
linux-stable-7e3f5c8881ba45eba1c74344b00558920008e6e6.tar.bz2
linux-stable-7e3f5c8881ba45eba1c74344b00558920008e6e6.zip
ixgbe: fix bounds checking in ixgbe_setup_tc for 82598
This patch resolves an issue where users were not able to dynamically set number of queues for 82598 via ethtool -L Reported-by: Tal Abudi <talabudi@gmail.com> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index afdc7fb39b2c..0853cf0f5861 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7848,9 +7848,10 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc)
bool pools;
/* Hardware supports up to 8 traffic classes */
- if (tc > adapter->dcb_cfg.num_tcs.pg_tcs ||
- (hw->mac.type == ixgbe_mac_82598EB &&
- tc < MAX_TRAFFIC_CLASS))
+ if (tc > adapter->dcb_cfg.num_tcs.pg_tcs)
+ return -EINVAL;
+
+ if (hw->mac.type == ixgbe_mac_82598EB && tc && tc < MAX_TRAFFIC_CLASS)
return -EINVAL;
pools = (find_first_zero_bit(&adapter->fwd_bitmask, 32) > 1);