Skip to content

Commit

Permalink
bnx2x: save RAM in kdump kernel by using a single queue
Browse files Browse the repository at this point in the history
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: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michal Schmidt authored and David S. Miller committed Feb 26, 2014
1 parent 7d0445d commit ff2ad30
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ static void bnx2x_add_all_napi(struct bnx2x *bp)
static int bnx2x_calc_num_queues(struct bnx2x *bp)
{
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));
return nq;
}
Expand Down

0 comments on commit ff2ad30

Please sign in to comment.