netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Chris Friesen" <cfriesen@nortel.com>
To: Brandon Black <blblack@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: behavior of recvmmsg() on blocking sockets
Date: Mon, 29 Mar 2010 10:18:23 -0600	[thread overview]
Message-ID: <4BB0D2CF.9040903@nortel.com> (raw)
In-Reply-To: <84621a61003270619p6b4fe81bi24bb1961aba77ffb@mail.gmail.com>

On 03/27/2010 07:19 AM, Brandon Black wrote:

> I've been playing with the timeout argument to recvmmsg as well now,
> and I'm struggling to see how one would ever use it correctly with the
> current implementation.

I'd probably do something like this:

prev = current time
loop forever
	cur = current time
	timeout = max_latency - (cur - prev)
	recvmmsg(timeout)
	process all received messages
	prev = cur


Basically you determine the max latency you're willing to wait for a
packet to be handled, then subtract the amount of time you spent
processing messages from that and pass it into the recvmmsg() call as
the timeout.  That way no messages will be delayed for longer than the
max latency. (Not considering scheduling delays.)

Chris

  parent reply	other threads:[~2010-03-29 16:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <84621a61003240915p2a4ce6bbjd0c6bfb02ab05ba8@mail.gmail.com>
2010-03-24 17:41 ` behavior of recvmmsg() on blocking sockets Chris Friesen
2010-03-24 18:28   ` Brandon Black
2010-03-24 18:34     ` drepper
2010-03-24 23:35       ` Brandon Black
2010-03-26 12:00         ` Ulrich Drepper
2010-03-26 14:20           ` Eric Dumazet
2010-03-24 19:36     ` Chris Friesen
2010-03-24 19:55       ` Brandon Black
2010-03-27 13:19         ` Brandon Black
2010-03-27 14:26           ` Arnaldo Carvalho de Melo
2010-03-29 16:18           ` Chris Friesen [this message]
2010-03-29 17:24             ` Brandon Black
2010-03-29 17:48               ` Chris Friesen

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=4BB0D2CF.9040903@nortel.com \
    --to=cfriesen@nortel.com \
    --cc=acme@redhat.com \
    --cc=blblack@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --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).