Commit 7e3f5c88 authored by Emil Tantilov's avatar Emil Tantilov Committed by Jeff Kirsher

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: default avatarTal Abudi <talabudi@gmail.com>
Signed-off-by: default avatarEmil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 1c7cf078
...@@ -7848,9 +7848,10 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc) ...@@ -7848,9 +7848,10 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc)
bool pools; bool pools;
/* Hardware supports up to 8 traffic classes */ /* Hardware supports up to 8 traffic classes */
if (tc > adapter->dcb_cfg.num_tcs.pg_tcs || if (tc > adapter->dcb_cfg.num_tcs.pg_tcs)
(hw->mac.type == ixgbe_mac_82598EB && return -EINVAL;
tc < MAX_TRAFFIC_CLASS))
if (hw->mac.type == ixgbe_mac_82598EB && tc && tc < MAX_TRAFFIC_CLASS)
return -EINVAL; return -EINVAL;
pools = (find_first_zero_bit(&adapter->fwd_bitmask, 32) > 1); pools = (find_first_zero_bit(&adapter->fwd_bitmask, 32) > 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment