Skip to content

Commit 90d2c05

Browse files
mawilli1davem330
authored andcommitted
i40e/i40evf: set AQ count after memory allocation
The standard way to check if the AQ is enabled is to look at the count field. So we should only set this field after we have successfully allocated memory. To do otherwise is to incite panic among the populace. Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 855591d commit 90d2c05

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,6 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw)
386386

387387
hw->aq.asq.next_to_use = 0;
388388
hw->aq.asq.next_to_clean = 0;
389-
hw->aq.asq.count = hw->aq.num_asq_entries;
390389

391390
/* allocate the ring memory */
392391
ret_code = i40e_alloc_adminq_asq_ring(hw);
@@ -404,6 +403,7 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw)
404403
goto init_adminq_free_rings;
405404

406405
/* success! */
406+
hw->aq.asq.count = hw->aq.num_asq_entries;
407407
goto init_adminq_exit;
408408

409409
init_adminq_free_rings:
@@ -445,7 +445,6 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw)
445445

446446
hw->aq.arq.next_to_use = 0;
447447
hw->aq.arq.next_to_clean = 0;
448-
hw->aq.arq.count = hw->aq.num_arq_entries;
449448

450449
/* allocate the ring memory */
451450
ret_code = i40e_alloc_adminq_arq_ring(hw);
@@ -463,6 +462,7 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw)
463462
goto init_adminq_free_rings;
464463

465464
/* success! */
465+
hw->aq.arq.count = hw->aq.num_arq_entries;
466466
goto init_adminq_exit;
467467

468468
init_adminq_free_rings:

drivers/net/ethernet/intel/i40evf/i40e_adminq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,6 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw)
373373

374374
hw->aq.asq.next_to_use = 0;
375375
hw->aq.asq.next_to_clean = 0;
376-
hw->aq.asq.count = hw->aq.num_asq_entries;
377376

378377
/* allocate the ring memory */
379378
ret_code = i40e_alloc_adminq_asq_ring(hw);
@@ -391,6 +390,7 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw)
391390
goto init_adminq_free_rings;
392391

393392
/* success! */
393+
hw->aq.asq.count = hw->aq.num_asq_entries;
394394
goto init_adminq_exit;
395395

396396
init_adminq_free_rings:
@@ -432,7 +432,6 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw)
432432

433433
hw->aq.arq.next_to_use = 0;
434434
hw->aq.arq.next_to_clean = 0;
435-
hw->aq.arq.count = hw->aq.num_arq_entries;
436435

437436
/* allocate the ring memory */
438437
ret_code = i40e_alloc_adminq_arq_ring(hw);
@@ -450,6 +449,7 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw)
450449
goto init_adminq_free_rings;
451450

452451
/* success! */
452+
hw->aq.arq.count = hw->aq.num_arq_entries;
453453
goto init_adminq_exit;
454454

455455
init_adminq_free_rings:

0 commit comments

Comments
 (0)