aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cisco/enic/enic_main.c
diff options
context:
space:
mode:
authorGovindarajulu Varadarajan <_govind@gmx.com>2015-01-03 09:05:44 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-04 22:23:43 -0500
commit3f255dcc970aede74463d863c9cf3cd9fb9146e3 (patch)
tree5af91c45fa0ed38e67934dd6efe2da45c9202d0f /drivers/net/ethernet/cisco/enic/enic_main.c
parent9ace422320f0daa5e746b8325b0312c275ee0346 (diff)
enic: reconfigure resources for kdump crash kernel
When running in kdump kernel, reduce number of resources used by the driver. This will enable NIC to operate in low memory kdump kernel environment. Also change the driver version to .83 Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cisco/enic/enic_main.c')
-rw-r--r--drivers/net/ethernet/cisco/enic/enic_main.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index 142c9b5509ae..9027fc1cc5f7 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -45,6 +45,7 @@
45#ifdef CONFIG_NET_RX_BUSY_POLL 45#ifdef CONFIG_NET_RX_BUSY_POLL
46#include <net/busy_poll.h> 46#include <net/busy_poll.h>
47#endif 47#endif
48#include <linux/crash_dump.h>
48 49
49#include "cq_enet_desc.h" 50#include "cq_enet_desc.h"
50#include "vnic_dev.h" 51#include "vnic_dev.h"
@@ -2265,6 +2266,18 @@ static void enic_dev_deinit(struct enic *enic)
2265 enic_clear_intr_mode(enic); 2266 enic_clear_intr_mode(enic);
2266} 2267}
2267 2268
2269static void enic_kdump_kernel_config(struct enic *enic)
2270{
2271 if (is_kdump_kernel()) {
2272 dev_info(enic_get_dev(enic), "Running from within kdump kernel. Using minimal resources\n");
2273 enic->rq_count = 1;
2274 enic->wq_count = 1;
2275 enic->config.rq_desc_count = ENIC_MIN_RQ_DESCS;
2276 enic->config.wq_desc_count = ENIC_MIN_WQ_DESCS;
2277 enic->config.mtu = min_t(u16, 1500, enic->config.mtu);
2278 }
2279}
2280
2268static int enic_dev_init(struct enic *enic) 2281static int enic_dev_init(struct enic *enic)
2269{ 2282{
2270 struct device *dev = enic_get_dev(enic); 2283 struct device *dev = enic_get_dev(enic);
@@ -2294,6 +2307,10 @@ static int enic_dev_init(struct enic *enic)
2294 2307
2295 enic_get_res_counts(enic); 2308 enic_get_res_counts(enic);
2296 2309
2310 /* modify resource count if we are in kdump_kernel
2311 */
2312 enic_kdump_kernel_config(enic);
2313
2297 /* Set interrupt mode based on resource counts and system 2314 /* Set interrupt mode based on resource counts and system
2298 * capabilities 2315 * capabilities
2299 */ 2316 */