diff mbox

[net-next] cxgb4: Reduce resource allocation in kdump kernel

Message ID BY2PR12MB064802D9AB46EF297736F308C8590@BY2PR12MB0648.namprd12.prod.outlook.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Casey Leedom June 3, 2016, 8:07 p.m. UTC
Looks good to me.  Of course I came up with those changes so maybe we should get another reviewer? :-)  Also, don't forget to mention "Bug #29998" in the commit message ...

Casey

Comments

Yuval Mintz June 4, 2016, 1:24 p.m. UTC | #1
> When is_kdump_kernel() is true, reduce our memory footprint by only using a
> single "Queue Set" and Forcing Master so we can reinitialize the Firmware/Chip.
> 
> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
...
>         if (q10g > netif_get_num_default_rss_queues())
>                 q10g = netif_get_num_default_rss_queues();
> 
> +       /* Reduce memory usage in kdump environment by using only one queue
> +        * and disable all offload.
> +        */
> +       if (is_kdump_kernel()) {
> +               q10g = 1;
> +               adap->params.offload = 0;
> +       }
> +

Sounds like a common issue that might interest other devices as well.
Perhaps we should change netif_get_num_default_rss_queues() to return 1
when called from a kdump kernel?
David Miller June 6, 2016, 10:31 p.m. UTC | #2
From: Yuval Mintz <Yuval.Mintz@qlogic.com>
Date: Sat, 4 Jun 2016 13:24:43 +0000

>> When is_kdump_kernel() is true, reduce our memory footprint by only using a
>> single "Queue Set" and Forcing Master so we can reinitialize the Firmware/Chip.
>> 
>> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
> ...
>>         if (q10g > netif_get_num_default_rss_queues())
>>                 q10g = netif_get_num_default_rss_queues();
>> 
>> +       /* Reduce memory usage in kdump environment by using only one queue
>> +        * and disable all offload.
>> +        */
>> +       if (is_kdump_kernel()) {
>> +               q10g = 1;
>> +               adap->params.offload = 0;
>> +       }
>> +
> 
> Sounds like a common issue that might interest other devices as well.
> Perhaps we should change netif_get_num_default_rss_queues() to return 1
> when called from a kdump kernel?

Yeah that might make sense.
diff mbox

Patch

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 477db477b133..5317187d0073 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -64,6 +64,7 @@ 
 #include <net/bonding.h>
 #include <net/addrconf.h>
 #include <asm/uaccess.h>
+#include <linux/crash_dump.h>

 #include "cxgb4.h"
 #include "t4_regs.h"
@@ -3735,7 +3736,8 @@  static int adap_init0(struct adapter *adap)
                return ret;

        /* Contact FW, advertising Master capability */
-       ret = t4_fw_hello(adap, adap->mbox, adap->mbox, MASTER_MAY, &state);
+       ret = t4_fw_hello(adap, adap->mbox, adap->mbox,
+                         is_kdump_kernel() ? MASTER_MUST : MASTER_MAY, &state);
        if (ret < 0) {
                dev_err(adap->pdev_dev, "could not connect to FW, error %d\n",
                        ret);
@@ -4366,6 +4368,14 @@  static void cfg_queues(struct adapter *adap)
        if (q10g > netif_get_num_default_rss_queues())
                q10g = netif_get_num_default_rss_queues();

+       /* Reduce memory usage in kdump environment by using only one queue
+        * and disable all offload.
+        */
+       if (is_kdump_kernel()) {
+               q10g = 1;
+               adap->params.offload = 0;
+       }
+
        for_each_port(adap, i) {
                struct port_info *pi = adap2pinfo(adap, i);