netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: chetan loke <loke.chetan@gmail.com>
To: Guy Harris <guy@alum.mit.edu>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Sowmini Varadhan <sowmini.varadhan@oracle.com>,
	netdev <netdev@vger.kernel.org>,
	tcpdump-workers@lists.tcpdump.org
Subject: Re: TPACKET_V3 timeout bug?
Date: Tue, 2 May 2017 08:04:12 -0700	[thread overview]
Message-ID: <CAAsGZS5ir2Ha1swhdGCg7ibgYRORZykZcu089=oJ51NT4GKDuA@mail.gmail.com> (raw)
In-Reply-To: <251BA382-D82C-4931-A98F-A23AD88F9811@alum.mit.edu>

On Sat, Apr 15, 2017 at 7:41 PM, Guy Harris <guy@alum.mit.edu> wrote:
> On Apr 15, 2017, at 7:10 PM, Andrew Lunn <andrew@lunn.ch> wrote:
>
>> Do you think this is a kernel problem, libpcap problem, or an
>> application problem?
>

Its clearly a kernel regression.

If you look at if_packet.h, I have explicitly called out all the cases
for the return/status codes. When I first merged the functionality in
3.11(or 3.12 I think) I had the logic in place to retire the block
with or without packets in it. I think there was one case where we
wouldn't wake up userspace. Someone checked in a fix for that. Now I
am not sure the regression happened as part of that bug fix or
sometime later. If you diff 3.12 against the latest you will find the
regression. Look for prb_retire_rx_blk_timer_expired().


> An application problem.  See my response on netdev; the timeout (which is provided by the kernel's capture mechanism, in most cases) is to make sure packets don't stay stuck in the kernel's packet buffer for an indefinite period of time, it's *not* to make sure a thread capturing packets doesn't stay blocked for an indefinite period of time.  Whether the timer goes off even if no

I cannot speak on behalf of user-space wrappers developed around
tpacket_v3 but the intention(from the kernel POV) of the block_timer
*is* to unblock the capture/user process/thread so that it does NOT
stay blocked for an indefinite period of time. The header explicitly
specifies that contract.

I'm tied up for the next 3 weeks. However I can work on it after
that(unless someone else has cycles for it now).

Chetan

  reply	other threads:[~2017-05-02 15:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-15 19:40 TPACKET_V3 timeout bug? Andrew Lunn
2017-04-15 22:45 ` Sowmini Varadhan
2017-04-15 23:44   ` Andrew Lunn
2017-04-16  2:38     ` Guy Harris
2017-04-16  2:10   ` Andrew Lunn
2017-04-16  2:41     ` Guy Harris
2017-05-02 15:04       ` chetan loke [this message]
2017-05-02 17:16         ` chetan loke
2017-05-03  3:15           ` Guy Harris
2017-05-02 17:54         ` Guy Harris
2017-05-02 18:19           ` Guy Harris

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='CAAsGZS5ir2Ha1swhdGCg7ibgYRORZykZcu089=oJ51NT4GKDuA@mail.gmail.com' \
    --to=loke.chetan@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=guy@alum.mit.edu \
    --cc=netdev@vger.kernel.org \
    --cc=sowmini.varadhan@oracle.com \
    --cc=tcpdump-workers@lists.tcpdump.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).