All of lore.kernel.org
 help / color / mirror / Atom feed
From: P@draigBrady.com
To: Marko Rauhamaa <marko@pacujo.net>
Cc: linux-kernel@vger.kernel.org,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	Jamal Hadi Salim <hadi@cyberus.ca>,
	Robert Olsson <Robert.Olsson@data.slu.se>
Subject: Re: NAPI Race?
Date: Wed, 08 Oct 2003 12:34:05 +0100	[thread overview]
Message-ID: <3F83F62D.5090805@draigBrady.com> (raw)
In-Reply-To: <m3smm4qvf0.fsf@lumo.pacujo.net>

Marko Rauhamaa wrote:
> It looks to me like net_rx_action() might suffer from a race, which in
> turn might explain some weirdness in my driver test results.
> 
> Here's the essence of the function from net/core/dev.c:
> 
> net_rx_action()
> {
>         local_irq_disable();
>         while (!list_empty(&queue->poll_list)) {
>                 local_irq_enable();
>                 /* do stuff */
>                 local_irq_disable();
>         }
>         local_irq_enable();
> }
> 
> Say I receive a packet. net_rx_action() processes it in the while loop
> and reenables interrupts. But just before net_rx_action() returns, I
> receive another packet, and __netif_rx_schedule() gets called from the
> driver. Then the soft irq is raised from within itself. If I'm not
> interrupted for some other reason, the packet will get processed only at
> the next jiffie when the soft irq is invoked again.
> 
> Am I mistaken?

Probably not, as I tested the reception timing
accuracy against an independent hardware "packet
timestamper", and out of 2 million packets,
3 were delayed by up to 5ms on the linux box
(e100 NAPI). There were about 10 packets delayed
between 1ms and 5ms.

Pádraig.


  reply	other threads:[~2003-10-08 11:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-08  3:07 NAPI Race? Marko Rauhamaa
2003-10-08 11:34 ` P [this message]
2003-10-08 19:57 ` kuznet
2003-10-08 21:17   ` Marko Rauhamaa
2003-10-08 21:31     ` David S. 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=3F83F62D.5090805@draigBrady.com \
    --to=p@draigbrady.com \
    --cc=Robert.Olsson@data.slu.se \
    --cc=hadi@cyberus.ca \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marko@pacujo.net \
    /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.