2021-03-05 00:01:52

by Coiby Xu

[permalink] [raw]
Subject: [PATCH v1 3/3] i40e: use minimal admin queue for kdump

The minimum size of admin send/receive queue is 1 and 2 respectively.
The admin send queue can't be set to 1 because in that case, the
firmware would fail to init.

Signed-off-by: Coiby Xu <[email protected]>
---
drivers/net/ethernet/intel/i40e/i40e.h | 2 ++
drivers/net/ethernet/intel/i40e/i40e_main.c | 9 +++++++--
2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index cd53981fa5e0..09217944baa4 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -66,6 +66,8 @@
#define I40E_FDIR_RING_COUNT 32
#define I40E_MAX_AQ_BUF_SIZE 4096
#define I40E_AQ_LEN 256
+#define I40E_MIN_ARQ_LEN 1
+#define I40E_MIN_ASQ_LEN 2
#define I40E_AQ_WORK_LIMIT 66 /* max number of VFs + a little */
#define I40E_MAX_USER_PRIORITY 8
#define I40E_DEFAULT_TRAFFIC_CLASS BIT(0)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index d6868c7aee05..5d67fb12e576 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -15327,8 +15327,13 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

i40e_check_recovery_mode(pf);

- hw->aq.num_arq_entries = I40E_AQ_LEN;
- hw->aq.num_asq_entries = I40E_AQ_LEN;
+ if (is_kdump_kernel()) {
+ hw->aq.num_arq_entries = I40E_MIN_ARQ_LEN;
+ hw->aq.num_asq_entries = I40E_MIN_ASQ_LEN;
+ } else {
+ hw->aq.num_arq_entries = I40E_AQ_LEN;
+ hw->aq.num_asq_entries = I40E_AQ_LEN;
+ }
hw->aq.arq_buf_size = I40E_MAX_AQ_BUF_SIZE;
hw->aq.asq_buf_size = I40E_MAX_AQ_BUF_SIZE;
pf->adminq_work_limit = I40E_AQ_WORK_LIMIT;
--
2.30.1


2021-04-22 21:02:15

by Switzer, David

[permalink] [raw]
Subject: RE: [PATCH v1 3/3] i40e: use minimal admin queue for kdump


>-----Original Message-----
>From: Coiby Xu <[email protected]>
>Sent: Wednesday, March 3, 2021 6:56 PM
>To: [email protected]
>Cc: [email protected]; [email protected]; Jakub Kicinski
><[email protected]>; Brandeburg, Jesse <[email protected]>; Nguyen,
>Anthony L <[email protected]>; David S. Miller
><[email protected]>; open list <[email protected]>
>Subject: [PATCH v1 3/3] i40e: use minimal admin queue for kdump
>
>The minimum size of admin send/receive queue is 1 and 2 respectively.
>The admin send queue can't be set to 1 because in that case, the firmware would
>fail to init.
>
>Signed-off-by: Coiby Xu <[email protected]>
>---
> drivers/net/ethernet/intel/i40e/i40e.h | 2 ++
> drivers/net/ethernet/intel/i40e/i40e_main.c | 9 +++++++--
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
Tested-by: Dave Switzer <[email protected]