From: Eric Dumazet <dada1@cosmosbay.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [RFC] loopback: optimization
Date: Thu, 06 Nov 2008 00:14:16 +0100 [thread overview]
Message-ID: <491228C8.3010100@cosmosbay.com> (raw)
In-Reply-To: <20081105123659.6045b216@extreme>
Stephen Hemminger a écrit :
> Convert loopback device from using common network queues to a per-cpu
> receive queue with NAPI. This gives a small 1% performance gain when
> measured over 5 runs of tbench. Not sure if it's worth bothering
> though.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
>
> --- a/drivers/net/loopback.c 2008-11-04 15:36:29.000000000 -0800
> +++ b/drivers/net/loopback.c 2008-11-05 10:00:20.000000000 -0800
> @@ -59,7 +59,10 @@
>
> +/* Special case version of napi_schedule since loopback device has no hard irq */
> +void napi_schedule_irq(struct napi_struct *n)
> +{
> + if (napi_schedule_prep(n)) {
> + list_add_tail(&n->poll_list, &__get_cpu_var(softnet_data).poll_list);
> + __raise_softirq_irqoff(NET_RX_SOFTIRQ);
> + }
> +}
> +
Stephen, I dont get it.
Sure loopback device cannot generate hard irqs, but what prevent's a real hardware
interrupt to call NIC driver that can call napi_schedule() and corrupt softnet_data.poll_list ?
Why not using a queue dedicated on loopback directly in cpu_var(softnet_data) ?
(ie not using a napi structure for each cpu and each loopback dev)
This queue would be irq safe yes.
net_rx_action could handle this list without local_irq_disable()/local_irq_enable() games.
Hum, maybe complex for loopback_dev_stop() to purge all queues without interfering with other namespaces.
next prev parent reply other threads:[~2008-11-05 23:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-04 5:37 [RFC] loopback: optimization Stephen Hemminger
2008-11-04 6:36 ` Eric Dumazet
2008-11-05 9:49 ` David Miller
2008-11-05 20:36 ` Stephen Hemminger
2008-11-05 23:14 ` Eric Dumazet [this message]
2008-11-06 0:42 ` Stephen Hemminger
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=491228C8.3010100@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.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 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.