From: Willem de Bruijn <willemb@google.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Network Development <netdev@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] net-timestamp: Fix a documentation typo
Date: Mon, 24 Nov 2014 17:38:21 -0500 [thread overview]
Message-ID: <CA+FuTSe8pjpUUpStfEHsuZ2Row9=MHVPH0S-MjUxiauBSNMOsg@mail.gmail.com> (raw)
In-Reply-To: <CALCETrU6tjwZoSCdfXnnhRy5H0uG9B8h5ftu9tA42iBuLXTQog@mail.gmail.com>
>>> Is user code supposed to rely on this and, further, on the fact that the
>>> counter starts at zero? If not, how else is user code supposed to match
>>> outgoing data to timestamps?
>>
>> That is correct. The per-socket counter is reset when
>> SOF_TIMESTAMPING_OPT_ID is set. On datagram sockets, it returns the
>> packet number since the reset. On stream sockets, it returns the byte
>> offset since the reset.
>>
>
> It might be worth tweaking the docs at some point to make this clearer.
Good point. The commit message is apparently more informative than the
actual documentation.
>>> Also, is it intentional that the payload data associated with the tx
>>> timestamp is (I think) the full outgoing packet including lower-layer
>>> headers?
>>
>> Absolutely not. I'll look into that right away. It doesn't on ACK, and
>> should certainly not expose this info in the other cases, either.
>
> Then I won't start trying to decode it :)
The datagram feature existed before I added the counter and stream
support, so returning the entire packet in that case is legacy
behavior, I suppose. I did not intend to expose network headers for
the new stream socket interface, though.
> TBH, all I looked at was the packet size, which matched the full
> link-layer packet.
>
> Also, the address returned by recvmsg appeared to be garbage instead
> of 0.0.0.0 (or something meaningful, whatever that would be).
>
>>
>>> And, finally, would it be possible to attach IP_PKTINFO to the looped
>>> timestamp? That way I could finally update my fancy ping program to
>>> track which outgoing interface was used for a request.
>>
>> If socket option IP_PKTINFO is set, you want to receive in_pktinfo for
>> any packet that happens to be queued onto the error queue? Both
>> SKB_EXT_ERR(skb) and PKTINFO_SKB_CB(skb) use the control block to
>> store data that is later encoded in a cmsg, so there may not be enough
>> room to hold both. I'll take a look.
>
> I don't really care what the mechanism is, but it would be really nice
> if I could see what interface the send timestamp is associated with.
Okay. I'll see if I can cook something up.
> Also, thanks for this new feature. It's great!
Thanks!
> --Andy
next prev parent reply other threads:[~2014-11-24 22:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-24 20:02 [PATCH] net-timestamp: Fix a documentation typo Andy Lutomirski
2014-11-24 22:11 ` Willem de Bruijn
2014-11-24 22:18 ` Andy Lutomirski
2014-11-24 22:38 ` Willem de Bruijn [this message]
2014-11-25 8:33 ` Richard Cochran
2014-11-25 18:01 ` Willem de Bruijn
2014-11-25 18:35 ` 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='CA+FuTSe8pjpUUpStfEHsuZ2Row9=MHVPH0S-MjUxiauBSNMOsg@mail.gmail.com' \
--to=willemb@google.com \
--cc=davem@davemloft.net \
--cc=luto@amacapital.net \
--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).