* [PATCH net-next] cxgb4: reduce resource allocation in kdump kernel
@ 2017-05-16 15:47 Ganesh Goudar
2017-05-17 16:03 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Ganesh Goudar @ 2017-05-16 15:47 UTC (permalink / raw)
To: netdev, davem; +Cc: nirranjan, indranil, Ganesh Goudar
When is_kdump_kernel() is true, reduce memory footprint of
cxgb4 by using a single "Queue Set".
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 38a5c67..4249ffb 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -891,7 +891,7 @@ static u16 cxgb_select_queue(struct net_device *dev, struct sk_buff *skb,
* The skb's priority is determined via the VLAN Tag Priority Code
* Point field.
*/
- if (cxgb4_dcb_enabled(dev)) {
+ if (cxgb4_dcb_enabled(dev) && !is_kdump_kernel()) {
u16 vlan_tci;
int err;
@@ -4007,10 +4007,7 @@ static void cfg_queues(struct adapter *adap)
/* Reduce memory usage in kdump environment, disable all offload.
*/
- if (is_kdump_kernel()) {
- adap->params.offload = 0;
- adap->params.crypto = 0;
- } else if (is_uld(adap) && t4_uld_mem_alloc(adap)) {
+ if (is_kdump_kernel() || (is_uld(adap) && t4_uld_mem_alloc(adap))) {
adap->params.offload = 0;
adap->params.crypto = 0;
}
@@ -4031,7 +4028,7 @@ static void cfg_queues(struct adapter *adap)
struct port_info *pi = adap2pinfo(adap, i);
pi->first_qset = qidx;
- pi->nqsets = 8;
+ pi->nqsets = is_kdump_kernel() ? 1 : 8;
qidx += pi->nqsets;
}
#else /* !CONFIG_CHELSIO_T4_DCB */
@@ -4044,6 +4041,9 @@ static void cfg_queues(struct adapter *adap)
if (q10g > netif_get_num_default_rss_queues())
q10g = netif_get_num_default_rss_queues();
+ if (is_kdump_kernel())
+ q10g = 1;
+
for_each_port(adap, i) {
struct port_info *pi = adap2pinfo(adap, i);
--
2.1.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] cxgb4: reduce resource allocation in kdump kernel
2017-05-16 15:47 [PATCH net-next] cxgb4: reduce resource allocation in kdump kernel Ganesh Goudar
@ 2017-05-17 16:03 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2017-05-17 16:03 UTC (permalink / raw)
To: ganeshgr; +Cc: netdev, nirranjan, indranil
From: Ganesh Goudar <ganeshgr@chelsio.com>
Date: Tue, 16 May 2017 21:17:42 +0530
> When is_kdump_kernel() is true, reduce memory footprint of
> cxgb4 by using a single "Queue Set".
>
> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] cxgb4: Reduce resource allocation in kdump kernel
2016-06-04 13:24 ` Yuval Mintz
@ 2016-06-06 22:31 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2016-06-06 22:31 UTC (permalink / raw)
To: Yuval.Mintz; +Cc: leedom, hariprasad, netdev, nirranjan
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH net-next] cxgb4: Reduce resource allocation in kdump kernel
2016-06-03 20:07 ` Casey Leedom
@ 2016-06-04 13:24 ` Yuval Mintz
2016-06-06 22:31 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Yuval Mintz @ 2016-06-04 13:24 UTC (permalink / raw)
To: Casey Leedom, Hariprasad S, David Miller; +Cc: netdev, Nirranjan Kirubaharan
> 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?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] cxgb4: Reduce resource allocation in kdump kernel
2016-06-03 17:35 [PATCH net-next] cxgb4: Reduce " Hariprasad Shenai
@ 2016-06-03 20:07 ` Casey Leedom
2016-06-04 13:24 ` Yuval Mintz
0 siblings, 1 reply; 6+ messages in thread
From: Casey Leedom @ 2016-06-03 20:07 UTC (permalink / raw)
To: Hariprasad S, davem; +Cc: netdev, Nirranjan Kirubaharan
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
________________________________________
From: Hariprasad Shenai <hariprasad@chelsio.com>
Sent: Friday, June 3, 2016 10:35:45 AM
To: davem@davemloft.net
Cc: netdev@vger.kernel.org; Casey Leedom; Nirranjan Kirubaharan; Hariprasad S
Subject: [PATCH net-next] cxgb4: Reduce resource allocation in kdump kernel
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>
---
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
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);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next] cxgb4: Reduce resource allocation in kdump kernel
@ 2016-06-03 17:35 Hariprasad Shenai
2016-06-03 20:07 ` Casey Leedom
0 siblings, 1 reply; 6+ messages in thread
From: Hariprasad Shenai @ 2016-06-03 17:35 UTC (permalink / raw)
To: davem; +Cc: netdev, leedom, nirranjan, Hariprasad Shenai
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>
---
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
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);
--
2.3.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-05-17 16:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-16 15:47 [PATCH net-next] cxgb4: reduce resource allocation in kdump kernel Ganesh Goudar
2017-05-17 16:03 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2016-06-03 17:35 [PATCH net-next] cxgb4: Reduce " Hariprasad Shenai
2016-06-03 20:07 ` Casey Leedom
2016-06-04 13:24 ` Yuval Mintz
2016-06-06 22:31 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.