public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Sebastian Huber <sh@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] Use hardware timestamps to report packet timestamps
Date: Fri, 24 Aug 2018 13:10:00 -0000	[thread overview]
Message-ID: <20180824131002.14138.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=91e828be4fc1dbf7a1c1966ff6d3e9e3fbe9647f

commit 91e828be4fc1dbf7a1c1966ff6d3e9e3fbe9647f
Author: kib <kib@FreeBSD.org>
Date:   Tue Nov 7 09:46:26 2017 +0000

    Use hardware timestamps to report packet timestamps
    
    for SO_TIMESTAMP and other similar socket options.
    
    Provide new control message SCM_TIME_INFO to supply information about
    timestamp.  Currently it indicates that the timestamp was
    hardware-assisted and high-precision, for software timestamps the
    message is not returned.  Reserved fields are added to ABI to report
    additional info about it, it is expected that raw hardware clock value
    might be useful for some applications.
    
    Reviewed by:	gallatin (previous version), hselasky
    Sponsored by:	Mellanox Technologies
    MFC after:	2 weeks
    X-Differential revision:	https://reviews.freebsd.org/D12638

Diff:
---
 newlib/libc/sys/rtems/include/sys/socket.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/sys/socket.h b/newlib/libc/sys/rtems/include/sys/socket.h
index 87d0f33..7c42eb5 100644
--- a/newlib/libc/sys/rtems/include/sys/socket.h
+++ b/newlib/libc/sys/rtems/include/sys/socket.h
@@ -563,6 +563,17 @@ struct sockcred {
 #define	SCM_BINTIME	0x04		/* timestamp (struct bintime) */
 #define	SCM_REALTIME	0x05		/* timestamp (struct timespec) */
 #define	SCM_MONOTONIC	0x06		/* timestamp (struct timespec) */
+#define	SCM_TIME_INFO	0x07		/* timestamp info */
+
+struct sock_timestamp_info {
+	__uint32_t	st_info_flags;
+	__uint32_t	st_info_pad0;
+	__uint64_t	st_info_rsv[7];
+};
+
+#define	ST_INFO_HW		0x0001		/* SCM_TIMESTAMP was hw */
+#define	ST_INFO_HW_HPREC	0x0002		/* SCM_TIMESTAMP was hw-assisted
+						   on entrance */
 #endif
 
 #if __BSD_VISIBLE


                 reply	other threads:[~2018-08-24 13:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20180824131002.14138.qmail@sourceware.org \
    --to=sh@sourceware.org \
    --cc=newlib-cvs@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).