From: Eric Dumazet <eric.dumazet@gmail.com>
To: Changli Gao <xiaosuo@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH v3] net: fix softnet_stat
Date: Sun, 02 May 2010 18:43:27 +0200 [thread overview]
Message-ID: <1272818607.2173.133.camel@edumazet-laptop> (raw)
In-Reply-To: <1272814936-4902-1-git-send-email-xiaosuo@gmail.com>
Le dimanche 02 mai 2010 à 23:42 +0800, Changli Gao a écrit :
> fix softnet_stat
>
> Per cpu variable softnet_data.total was shared between IRQ and SoftIRQ context
> without any protection. And enqueue_to_backlog should update the netdev_rx_stat
> of the target CPU.
>
> This patch renames softnet_data.total to softnet_data.processed: the number of
> packets processed in uppper levels(IP stacks).
>
> softnet_stat data is moved into softnet_data.
>
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Thats a fine patch, thanks Changli.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
>
> @@ -5869,6 +5866,7 @@ static int __init net_dev_init(void)
> for_each_possible_cpu(i) {
> struct softnet_data *sd = &per_cpu(softnet_data, i);
>
> + memset(sd, 0, sizeof(*sd));
> skb_queue_head_init(&sd->input_pkt_queue);
> skb_queue_head_init(&sd->process_queue);
> sd->completion_queue = NULL;
Minor note :
- You could have removed some NULL initializations after the memset()
- Also, per_cpu data is already 0 initialized, so memset() is not
strictly needed ;)
This is very minor, since we dont have a bss section in per_cpu data, so
it doesnt matter.
next prev parent reply other threads:[~2010-05-02 16:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-02 15:42 [PATCH v3] net: fix softnet_stat Changli Gao
2010-05-02 16:43 ` Eric Dumazet [this message]
2010-05-03 5:29 ` 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=1272818607.2173.133.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=xiaosuo@gmail.com \
/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