netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Américo Wang" <xiyou.wangcong@gmail.com>
To: Linux Kernel Network Developers <netdev@vger.kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Subject: [Patch] pktgen: use vzalloc_node() instead of vmalloc_node() + memset()
Date: Sun, 22 May 2011 18:17:11 +0800	[thread overview]
Message-ID: <BANLkTimWSEwkoP3GOjZ3C-yG9jZRVM+yNA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 101 bytes --]

Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>

---

[-- Attachment #2: net-pktgen-use-vzalloc_node.diff --]
[-- Type: text/x-patch, Size: 657 bytes --]

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 67870e9..3b85c0d 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3544,13 +3544,12 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname)
 		return -ENOMEM;
 
 	strcpy(pkt_dev->odevname, ifname);
-	pkt_dev->flows = vmalloc_node(MAX_CFLOWS * sizeof(struct flow_state),
+	pkt_dev->flows = vzalloc_node(MAX_CFLOWS * sizeof(struct flow_state),
 				      node);
 	if (pkt_dev->flows == NULL) {
 		kfree(pkt_dev);
 		return -ENOMEM;
 	}
-	memset(pkt_dev->flows, 0, MAX_CFLOWS * sizeof(struct flow_state));
 
 	pkt_dev->removal_mark = 0;
 	pkt_dev->min_pkt_size = ETH_ZLEN;

             reply	other threads:[~2011-05-22 10:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-22 10:17 Américo Wang [this message]
2011-05-23  1:02 ` [Patch] pktgen: use vzalloc_node() instead of vmalloc_node() + memset() David Miller

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=BANLkTimWSEwkoP3GOjZ3C-yG9jZRVM+yNA@mail.gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=davem@davemloft.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).