freebsd-dev/tools/regression/sockets
Maxim Sobolev 339efd75a4 Add a new socket option SO_TS_CLOCK to pick from several different clock
sources to return timestamps when SO_TIMESTAMP is enabled. Two additional
clock sources are:

o nanosecond resolution realtime clock (equivalent of CLOCK_REALTIME);
o nanosecond resolution monotonic clock (equivalent of CLOCK_MONOTONIC).

In addition to this, this option provides unified interface to get bintime
(equivalent of using SO_BINTIME), except it also supported with IPv6 where
SO_BINTIME has never been supported. The long term plan is to depreciate
SO_BINTIME and move everything to using SO_TS_CLOCK.

Idea for this enhancement has been briefly discussed on the Net session
during dev summit in Ottawa last June and the general input was positive.

This change is believed to benefit network benchmarks/profiling as well
as other scenarios where precise time of arrival measurement is necessary.

There are two regression test cases as part of this commit: one extends unix
domain test code (unix_cmsg) to test new SCM_XXX types and another one
implementis totally new test case which exchanges UDP packets between two
processes using both conventional methods (i.e. calling clock_gettime(2)
before recv(2) and after send(2)), as well as using setsockopt()+recv() in
receive path. The resulting delays are checked for sanity for all supported
clock types.

Reviewed by:    adrian, gnn
Differential Revision:  https://reviews.freebsd.org/D9171
2017-01-16 17:46:38 +00:00
..
accept_fd_leak Use _exit, not exit in forked process 2015-04-10 09:37:53 +00:00
accf_data_attach - Check for accf_filter before running the tests, otherwise it will always 2016-01-15 21:59:18 +00:00
fstat Remove argc/argv (-Wunused) 2015-04-10 09:23:00 +00:00
kqueue Fix -Wunused warnings, bump WARNS to 6 2015-04-10 08:01:49 +00:00
listen_backlog Fix warnings 2015-04-10 09:26:21 +00:00
listenclose Remove argc/argv (-Wunused) 2015-04-10 09:27:23 +00:00
pr_atomic Fix warnings, bump WARNS to 6, and use a temporary socket instead of one in /tmp 2015-04-11 07:33:04 +00:00
reconnect Fix warnings with gcc 5.0 2016-01-16 02:15:13 +00:00
rtsocket Test for EPROTOTYPE not EPROTONOSUPPORT 2016-01-16 02:02:50 +00:00
sblock Fix warnings and bump WARNS to 6 2015-04-11 03:13:09 +00:00
sendfile Fix warnings with gcc 5.0 2016-01-16 02:15:13 +00:00
shutdown Fix a -Wuninitialized warning by setting the socket to -1 and bump WARNS to 6 2015-04-11 03:19:48 +00:00
sigpipe Mark signum unused in signal_handler; bump WARNS to 6 2015-04-11 03:24:49 +00:00
so_setfib tools: minor spelling fixes. 2016-05-01 16:20:14 +00:00
socketpair Garbage collect argc/argv and bump WARNS to 6 2015-04-11 03:35:33 +00:00
udp_pingpong Add a new socket option SO_TS_CLOCK to pick from several different clock 2017-01-16 17:46:38 +00:00
unix_bindconnect Fix warnings and bump WARNS to 6 2015-04-11 03:38:49 +00:00
unix_close_race - Garbage collect argc/argv; bump WARNS to 6 2015-04-11 03:43:43 +00:00
unix_cmsg Add a new socket option SO_TS_CLOCK to pick from several different clock 2017-01-16 17:46:38 +00:00
unix_gc Fix -Wunused warning with clang/gcc 2016-01-16 02:19:56 +00:00
unix_sendtorace - Garbage collect argc/argv 2015-04-11 03:54:43 +00:00
unix_socket Test for EPROTOTYPE not EPROTONOSUPPORT 2016-01-16 02:02:50 +00:00
unix_sorflush Garbage collect argc/argv and bump WARNS to 6 2015-04-11 03:57:35 +00:00
zerosend Use different ports in the TCP/UDP testcases with the first set and 2016-01-23 22:51:22 +00:00