mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nelson Escobar <neescoba@cisco.com>
To: John Daley <johndale@cisco.com>,
	Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	 Christian Benvenuti <benve@cisco.com>,
	Satish Kharat <satishkh@cisco.com>,
	 Andrew Lunn <andrew+netdev@lunn.ch>,
	 "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Nelson Escobar <neescoba@cisco.com>
Subject: [PATCH net-next v3 7/7] enic: Move kdump check into enic_adjust_resources()
Date: Fri, 08 Nov 2024 21:47:53 +0000	[thread overview]
Message-ID: <20241108-remove_vic_resource_limits-v3-7-3ba8123bcffc@cisco.com> (raw)
In-Reply-To: <20241108-remove_vic_resource_limits-v3-0-3ba8123bcffc@cisco.com>

Move the kdump check into enic_adjust_resources() so that everything
that modifies resources is in the same function.

Co-developed-by: John Daley <johndale@cisco.com>
Signed-off-by: John Daley <johndale@cisco.com>
Co-developed-by: Satish Kharat <satishkh@cisco.com>
Signed-off-by: Satish Kharat <satishkh@cisco.com>
Signed-off-by: Nelson Escobar <neescoba@cisco.com>
---
 drivers/net/ethernet/cisco/enic/enic_main.c | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index 84e85c9e2bf52f0089c0a8d03fb6d22ada4d086c..9913952ccb42f2017037a81a8e2c42daa7b53ec3 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -2531,6 +2531,15 @@ static int enic_adjust_resources(struct enic *enic)
 		return -ENOSPC;
 	}
 
+	if (is_kdump_kernel()) {
+		dev_info(enic_get_dev(enic), "Running from within kdump kernel. Using minimal resources\n");
+		enic->rq_avail = 1;
+		enic->wq_avail = 1;
+		enic->config.rq_desc_count = ENIC_MIN_RQ_DESCS;
+		enic->config.wq_desc_count = ENIC_MIN_WQ_DESCS;
+		enic->config.mtu = min_t(u16, 1500, enic->config.mtu);
+	}
+
 	/* if RSS isn't set, then we can only use one RQ */
 	if (!ENIC_SETTING(enic, RSS))
 		enic->rq_avail = 1;
@@ -2764,18 +2773,6 @@ static void enic_dev_deinit(struct enic *enic)
 	enic_free_enic_resources(enic);
 }
 
-static void enic_kdump_kernel_config(struct enic *enic)
-{
-	if (is_kdump_kernel()) {
-		dev_info(enic_get_dev(enic), "Running from within kdump kernel. Using minimal resources\n");
-		enic->rq_avail = 1;
-		enic->wq_avail = 1;
-		enic->config.rq_desc_count = ENIC_MIN_RQ_DESCS;
-		enic->config.wq_desc_count = ENIC_MIN_WQ_DESCS;
-		enic->config.mtu = min_t(u16, 1500, enic->config.mtu);
-	}
-}
-
 static int enic_dev_init(struct enic *enic)
 {
 	struct device *dev = enic_get_dev(enic);
@@ -2811,10 +2808,6 @@ static int enic_dev_init(struct enic *enic)
 		return err;
 	}
 
-	/* modify resource count if we are in kdump_kernel
-	 */
-	enic_kdump_kernel_config(enic);
-
 	/* Set interrupt mode based on system capabilities */
 
 	err = enic_set_intr_mode(enic);

-- 
2.35.6


  parent reply	other threads:[~2024-11-08 21:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-08 21:47 [PATCH net-next v3 0/7] enic: Use all the resources configured on VIC Nelson Escobar
2024-11-08 21:47 ` [PATCH net-next v3 1/7] enic: Create enic_wq/rq structures to bundle per wq/rq data Nelson Escobar
2024-11-09 20:27   ` Vadim Fedorenko
2024-11-08 21:47 ` [PATCH net-next v3 2/7] enic: Make MSI-X I/O interrupts come after the other required ones Nelson Escobar
2024-11-11 17:47   ` Simon Horman
2024-11-08 21:47 ` [PATCH net-next v3 3/7] enic: Save resource counts we read from HW Nelson Escobar
2024-11-08 21:47 ` [PATCH net-next v3 4/7] enic: Allocate arrays in enic struct based on VIC config Nelson Escobar
2024-11-08 21:47 ` [PATCH net-next v3 5/7] enic: Adjust used MSI-X wq/rq/cq/interrupt resources in a more robust way Nelson Escobar
2024-11-11 17:48   ` Simon Horman
2024-11-08 21:47 ` [PATCH net-next v3 6/7] enic: Move enic resource adjustments to separate function Nelson Escobar
2024-11-11 17:49   ` Simon Horman
2024-11-08 21:47 ` Nelson Escobar [this message]
2024-11-11 17:49   ` [PATCH net-next v3 7/7] enic: Move kdump check into enic_adjust_resources() Simon Horman
2024-11-13  2:30 ` [PATCH net-next v3 0/7] enic: Use all the resources configured on VIC Jakub Kicinski
2024-11-14 18:45   ` Nelson Escobar (neescoba)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241108-remove_vic_resource_limits-v3-7-3ba8123bcffc@cisco.com \
    --to=neescoba@cisco.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=benve@cisco.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=johndale@cisco.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=satishkh@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®