netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: Jacob Keller <jacob.e.keller@intel.com>
Cc: netdev@vger.kernel.org,
	Jeffrey Kirsher <jeffrey.t.kirsher@intel.com>,
	Matthew Vick <matthew.vick@intel.com>
Subject: Re: [net-next PATCH] [RFC] [v2] net: add option to enable error queue packets waking select
Date: Fri, 29 Mar 2013 08:20:04 +0100	[thread overview]
Message-ID: <20130329072004.GA2463@netboy.at.omicron.at> (raw)
In-Reply-To: <20130328211925.7644.15781.stgit@jekeller-hub.jf.intel.com>

On Thu, Mar 28, 2013 at 02:19:25PM -0700, Jacob Keller wrote:
> Currently, when a socket receives something on the error queue it only wakes up
> the socket on select if it is in the "read" list, that is the socket has
> something to read. It is useful also to wake the socket if it is in the error
> list, which would enable software to wait on error queue packets without waking
> up for regular data on the socket. The main use case is for receiving
> timestamped transmit packets which return the timestamp to the socket via the
> error queue. This enables an application to select on the socket for the error
> queue only instead of for the regular traffic.

I would fully support having this kind of ability. As it stands now,
the SO_TIMESTAMPING interface makes it very inconvenient for the
application to obtain transmit time stamps.

As a concrete example, take the ptp4l [1] program. After sending a
packet for which a time stamp is expected, we call recvmsg() on the
MSG_ERRQUEUE repeatedly, but give up after a certain number of
tries. The repetitions are needed because the driver may delay the
time stamped packet for quite some time, and the giving up is required
because it is possible for time stamps to be lost or dropped.

Having the ability to poll/select the error queue would open more
attractive possibilities for applications. Instead of a cheesy retry
loop, just poll/select the error queue with a reasonable timeout
value.

Thanks,
Richard

1. http://linuxptp.sourceforge.net/
   file: sk.c
   line: 199
   function: sk_receive()

  reply	other threads:[~2013-03-29  7:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-28 21:19 [net-next PATCH] [RFC] [v2] net: add option to enable error queue packets waking select Jacob Keller
2013-03-29  7:20 ` Richard Cochran [this message]
2013-03-31 23:45 ` 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=20130329072004.GA2463@netboy.at.omicron.at \
    --to=richardcochran@gmail.com \
    --cc=jacob.e.keller@intel.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=matthew.vick@intel.com \
    --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).