From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14364 invoked by alias); 24 Aug 2018 13:10:02 -0000 Mailing-List: contact newlib-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-cvs-owner@sourceware.org Received: (qmail 14147 invoked by uid 10080); 24 Aug 2018 13:10:02 -0000 Date: Fri, 24 Aug 2018 13:10:00 -0000 Message-ID: <20180824131002.14138.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Use hardware timestamps to report packet timestamps X-Act-Checkin: newlib-cygwin X-Git-Author: kib X-Git-Refname: refs/heads/master X-Git-Oldrev: 7ff81234c4635bc0c2ea25f0b27b80767cc4dd29 X-Git-Newrev: 91e828be4fc1dbf7a1c1966ff6d3e9e3fbe9647f X-SW-Source: 2018-q3/txt/msg00067.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=91e828be4fc1dbf7a1c1966ff6d3e9e3fbe9647f commit 91e828be4fc1dbf7a1c1966ff6d3e9e3fbe9647f Author: kib 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