All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bixuan Cui <cuibixuan@huawei.com>
To: <davem@davemloft.net>, <kuba@kernel.org>, <linux-next@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<jdmason@kudzu.us>, <christophe.jaillet@wanadoo.fr>,
	<john.wanghui@huawei.com>
Subject: [PATCH] net: neterion: vxge: reduce stack usage in VXGE_COMPLETE_VPATH_TX
Date: Thu, 16 Jul 2020 17:32:47 +0000	[thread overview]
Message-ID: <20200716173247.78912-1-cuibixuan@huawei.com> (raw)

Fix the warning: [-Werror=-Wframe-larger-than=]

drivers/net/ethernet/neterion/vxge/vxge-main.c:
In function'VXGE_COMPLETE_VPATH_TX.isra.37':
drivers/net/ethernet/neterion/vxge/vxge-main.c:119:1:
warning: the frame size of 1056 bytes is larger than 1024 bytes

Signed-off-by: Bixuan Cui <cuibixuan@huawei.com>
---
 drivers/net/ethernet/neterion/vxge/vxge-main.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c
index b0faa737b817..97ddfc9debd4 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-main.c
+++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c
@@ -100,8 +100,14 @@ static inline void VXGE_COMPLETE_VPATH_TX(struct vxge_fifo *fifo)
 	struct sk_buff **temp;
 #define NR_SKB_COMPLETED 128
 	struct sk_buff *completed[NR_SKB_COMPLETED];
+	struct sk_buff **completed;
 	int more;

+	completed = kcalloc(NR_SKB_COMPLETED, sizeof(*completed),
+			    GFP_KERNEL);
+	if (!completed)
+		return;
+
 	do {
 		more = 0;
 		skb_ptr = completed;
@@ -116,6 +122,8 @@ static inline void VXGE_COMPLETE_VPATH_TX(struct vxge_fifo *fifo)
 		for (temp = completed; temp != skb_ptr; temp++)
 			dev_consume_skb_irq(*temp);
 	} while (more);
+
+	free(completed);
 }

 static inline void VXGE_COMPLETE_ALL_TX(struct vxgedev *vdev)
--
2.17.1


             reply	other threads:[~2020-07-16  9:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 17:32 Bixuan Cui [this message]
2020-07-16  9:46 ` [PATCH] net: neterion: vxge: reduce stack usage in VXGE_COMPLETE_VPATH_TX Joe Perches
2020-07-16  9:59   ` Bixuan Cui
2020-07-16 11:20 ` kernel test robot
2020-07-16 11:20   ` kernel test robot
2020-07-16 14:11 ` kernel test robot
2020-07-16 14:11   ` kernel test robot
2020-07-19 17:05 ` Stephen Hemminger
2020-07-20  1:57   ` Bixuan Cui
2020-07-20  1:58   ` [PATCH v2] " Bixuan Cui
2020-07-21  1:38     ` David Miller
2020-07-21 12:34       ` Bixuan Cui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200716173247.78912-1-cuibixuan@huawei.com \
    --to=cuibixuan@huawei.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=davem@davemloft.net \
    --cc=jdmason@kudzu.us \
    --cc=john.wanghui@huawei.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.