Skip to content

Commit 3e957b3

Browse files
aludkiewJeff Kirsher
authored andcommitted
i40e: Queues are reserved despite "Invalid argument" error
Added a new local variable in the i40e_setup_tc function named old_queue_pairs so num_queue_pairs can be restored to the correct value in case configuring queue channels fails. Additionally, moved the exit label in the i40e_setup_tc function so the if (need_reset) block can be executed. Also, fixed data packing in the i40e_setup_tc function. Signed-off-by: Adam Ludkiewicz <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 432bc23 commit 3e957b3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6846,10 +6846,12 @@ static int i40e_setup_tc(struct net_device *netdev, void *type_data)
68466846
struct i40e_pf *pf = vsi->back;
68476847
u8 enabled_tc = 0, num_tc, hw;
68486848
bool need_reset = false;
6849+
int old_queue_pairs;
68496850
int ret = -EINVAL;
68506851
u16 mode;
68516852
int i;
68526853

6854+
old_queue_pairs = vsi->num_queue_pairs;
68536855
num_tc = mqprio_qopt->qopt.num_tc;
68546856
hw = mqprio_qopt->qopt.hw;
68556857
mode = mqprio_qopt->mode;
@@ -6950,6 +6952,7 @@ static int i40e_setup_tc(struct net_device *netdev, void *type_data)
69506952
}
69516953
ret = i40e_configure_queue_channels(vsi);
69526954
if (ret) {
6955+
vsi->num_queue_pairs = old_queue_pairs;
69536956
netdev_info(netdev,
69546957
"Failed configuring queue channels\n");
69556958
need_reset = true;

0 commit comments

Comments
 (0)