Commit ff2ad307 authored by Michal Schmidt's avatar Michal Schmidt Committed by David S. Miller

bnx2x: save RAM in kdump kernel by using a single queue

When running in a kdump kernel, make sure to use only a single ethernet
queue even if a num_queues option in /etc/modprobe.d/*.conf would specify
otherwise. This saves memory, which tends to be scarce in kdump.

This saves about 40 MB in the kdump environment on a setup with
num_queues=8 in the config file.
Signed-off-by: default avatarMichal Schmidt <mschmidt@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7d0445d6
...@@ -62,6 +62,11 @@ static void bnx2x_add_all_napi(struct bnx2x *bp) ...@@ -62,6 +62,11 @@ static void bnx2x_add_all_napi(struct bnx2x *bp)
static int bnx2x_calc_num_queues(struct bnx2x *bp) static int bnx2x_calc_num_queues(struct bnx2x *bp)
{ {
int nq = bnx2x_num_queues ? : netif_get_num_default_rss_queues(); int nq = bnx2x_num_queues ? : netif_get_num_default_rss_queues();
/* Reduce memory usage in kdump environment by using only one queue */
if (reset_devices)
nq = 1;
nq = clamp(nq, 1, BNX2X_MAX_QUEUES(bp)); nq = clamp(nq, 1, BNX2X_MAX_QUEUES(bp));
return nq; return nq;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment