Skip to content

Commit

Permalink
iavf: Fix for setting queues to 0
Browse files Browse the repository at this point in the history
Now setting combine to 0 will be rejected with the
appropriate error code.
This has been implemented by adding a condition that checks
the value of combine equal to zero.
Without this patch, when the user requested it, no error was
returned and combine was set to the default value for VF.

Fixes: 5520deb ("iavf: Enable support for up to 16 queues")
Signed-off-by: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
Tested-by: Tony Brelinski <tony.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
  • Loading branch information
Grzegorz Szczurek authored and Tony Nguyen committed Nov 15, 2021
1 parent 321421b commit 9a6e9e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/iavf/iavf_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1787,7 +1787,7 @@ static int iavf_set_channels(struct net_device *netdev,
/* All of these should have already been checked by ethtool before this
* even gets to us, but just to be sure.
*/
if (num_req > adapter->vsi_res->num_queue_pairs)
if (num_req == 0 || num_req > adapter->vsi_res->num_queue_pairs)
return -EINVAL;

if (num_req == adapter->num_active_queues)
Expand Down

0 comments on commit 9a6e9e4

Please sign in to comment.