[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-3 Branch: next Commit: a76db70a77866dc56e41b2120a0252597eed3561 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=a76db70a77866dc56e41b2120a0252597eed3561 Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index 77e9fea..7f258ed 100644 --- a/configure.ac +++ b/configure.ac @@ -922,6 +922,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-3 Branch: next Commit: e8c067039323a1a7bde773ac22242eeac9d73bbf URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=e8c067039323a1a7bde773ac22242eeac9d73bbf Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index 77e9fea..7f258ed 100644 --- a/configure.ac +++ b/configure.ac @@ -922,6 +922,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-3 Branch: next Commit: 1dec526182cc0738697700bec62275f52afa9758 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=1dec526182cc0738697700bec62275f52afa9758 Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index 77e9fea..7f258ed 100644 --- a/configure.ac +++ b/configure.ac @@ -922,6 +922,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-3 Branch: next Commit: cd7b2a333155900ba547c87cb31c2780ef2375c9 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=cd7b2a333155900ba547c87cb31c2780ef2375c9 Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index 1432ef2..12007f3 100644 --- a/configure.ac +++ b/configure.ac @@ -919,6 +919,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-3 Branch: next Commit: 513e5ac797baa46e03fd3b68321e964b4648e935 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=513e5ac797baa46e03fd3b68321e964b4648e935 Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index adf88a0..ac853de 100644 --- a/configure.ac +++ b/configure.ac @@ -916,6 +916,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-3 Branch: next Commit: 37b35d83eb90d9ba8f5abf44d7e8e0fd749c3ff2 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=37b35d83eb90d9ba8f5abf44d7e8e0fd749c3ff2 Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index 9925d54..0408f4d 100644 --- a/configure.ac +++ b/configure.ac @@ -916,6 +916,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-3 Branch: next Commit: 6b58eaa21a7c7bf9c83530c14eebaad99421cec9 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=6b58eaa21a7c7bf9c83530c14eebaad99421cec9 Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index 9925d54..0408f4d 100644 --- a/configure.ac +++ b/configure.ac @@ -916,6 +916,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-3 Branch: next Commit: e5f13fe6f74398a92f92d5329a5dbb7a2848ca6d URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=e5f13fe6f74398a92f92d5329a5dbb7a2848ca6d Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index ab13f96..a5accf1 100644 --- a/configure.ac +++ b/configure.ac @@ -912,6 +912,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-3 Branch: next Commit: 060c4688cfa2412495302bd1a051e05051062ebf URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=060c4688cfa2412495302bd1a051e05051062ebf Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index ab13f96..a5accf1 100644 --- a/configure.ac +++ b/configure.ac @@ -912,6 +912,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-3 Branch: next Commit: f3cc8d3e59376e0231cb63eb8d928ff761457a23 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f3cc8d3e59376e0231cb63eb8d928ff761457a23 Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index bbaf4a7..4a3f7c7 100644 --- a/configure.ac +++ b/configure.ac @@ -906,6 +906,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-3 Branch: next Commit: 3c1a0fbda8a132f7d8cf0a2107bed9e92c276b2f URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=3c1a0fbda8a132f7d8cf0a2107bed9e92c276b2f Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index bbaf4a7..4a3f7c7 100644 --- a/configure.ac +++ b/configure.ac @@ -906,6 +906,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-3 Branch: next Commit: 48a870d9a7005e63114eeb0f0113787c1c8459e3 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=48a870d9a7005e63114eeb0f0113787c1c8459e3 Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index 9e9bc90..dfad8e7 100644 --- a/configure.ac +++ b/configure.ac @@ -905,6 +905,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-3 Branch: next Commit: 2221fc2f63a8f7a16900ac84308b590b0c44354c URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=2221fc2f63a8f7a16900ac84308b590b0c44354c Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index 9e9bc90..dfad8e7 100644 --- a/configure.ac +++ b/configure.ac @@ -905,6 +905,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-3 Branch: next Commit: d190876cfb5feaafca477c797c324278e06cda93 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=d190876cfb5feaafca477c797c324278e06cda93 Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 + testsuite/smokey/Makefile.am |3 + testsuite/smokey/net_common/Makefile.am | 27 ++ testsuite/smokey/net_common/client.c | 286 testsuite/smokey/net_common/server.c | 178 testsuite/smokey/net_common/setup.c | 519 ++ testsuite/smokey/net_common/smokey_net.h | 51 +++ testsuite/smokey/net_common/smokey_net_server.c | 214 + testsuite/smokey/net_common/smokey_net_server.h | 31 ++ testsuite/smokey/net_packet_dgram/Makefile.am| 10 + testsuite/smokey/net_packet_dgram/packet_dgram.c | 81 testsuite/smokey/net_udp/Makefile.am | 10 + testsuite/smokey/net_udp/udp.c | 75 13 files changed, 1488 insertions(+) diff --git a/configure.ac b/configure.ac index c2fafb7..162e515 100644 --- a/configure.ac +++ b/configure.ac @@ -905,6 +905,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am index 023cd47..0139349 100644 --- a/testsuite/smokey/Makefile.am +++ b/testsuite/smokey/Makefile.am @@ -11,6 +11,9 @@ COBALT_SUBDIRS = \ fpu-stress \ iddp\ leaks \ + net_packet_dgram\ + net_udp \ + net_common \ posix-clock \ posix-cond \ posix-fork \ diff --git a/testsuite/smokey/net_common/Makefile.am b/testsuite/smokey/net_common/Makefile.am new file mode 100644 index 000..a0c6522 --- /dev/null +++ b/testsuite/smokey/net_common/Makefile.am @@ -0,0 +1,27 @@ +bin_PROGRAMS = smokey_net_server + +noinst_LIBRARIES = libnet_common.a +noinst_HEADERS = \ + smokey_net.h \ + smokey_net_server.h + +AM_CPPFLAGS = \ + @XENO_USER_CFLAGS@ \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/kernel/drivers/net/stack/include + +libnet_common_a_SOURCES = \ + client.c \ + server.c \ + setup.c + +smokey_net_server_SOURCES = \ + smokey_net_server.c + +smokey_net_server_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ + +smokey_net_server_LDADD = \ + libnet_common.a \ + $(top_builddir)/lib/@XENO_CORE_LIB@ \ + @XENO_USER_LDADD@ \ + -lpthread -lrt diff --git a/testsuite/smokey/net_common/client.c b/testsuite/smokey/net_common/client.c new file mode 100644 index 000..0932825 --- /dev/null +++ b/testsuite/smokey/net_common/client.c @@ -0,0 +1,286 @@ +#include +#include + +#include +#include +#include +#include +#include + +#include "smokey_net.h" + +static int duration = 10; +static int rate = 1000; +static const char *driver = "rt_loopback"; +static const char *intf; +static pthread_t tid; +static unsigned long long glost, glate; + +static int rcv_packet(struct smokey_net_client *client, int sock, unsigned seq, + struct timespec *next_shot, bool last) +{ + static unsigned long long gmin = ~0ULL, gmax = 0, gsum = 0, gcount = 0; + static unsigned long long min = ~0ULL, max = 0, sum = 0, count = 0, + lost = 0, late = 0; + static struct timespec last_print; + struct smokey_net_payload payload; + struct timeval timeout; + struct timespec now; + char packet[256]; + long long diff; + fd_set set; + int err; + + FD_ZERO(); + FD_SET(sock, ); + + err = smokey_check_errno( + __RT(clock_gettime(CLOCK_MONOTONIC, ))); + if (err < 0) + return err; + + diff = next_shot->tv_sec * 10ULL + next_shot->tv_nsec + - (now.tv_sec * 10ULL + now.tv_nsec); + if (diff < 0) + diff = 0; + + timeout.tv_sec = diff / 10; + timeout.tv_usec = (diff % 10 + 500) / 1000; + + err = smokey_check_errno( + __RT(select(sock + 1, , NULL, NULL, ))); + if (err < 0) + return err; + + if (err == 0) { + if (seq) + ++lost; + err = -ETIMEDOUT; + goto print_stats; + } + + err = smokey_check_errno(
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-gch Branch: next Commit: 03f25be4abc9666b5979fbc4467a33f03ea1142e URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=03f25be4abc9666b5979fbc4467a33f03ea1142e Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 + testsuite/smokey/Makefile.am |3 + testsuite/smokey/net_common/Makefile.am | 27 ++ testsuite/smokey/net_common/client.c | 286 testsuite/smokey/net_common/server.c | 178 testsuite/smokey/net_common/setup.c | 519 ++ testsuite/smokey/net_common/smokey_net.h | 51 +++ testsuite/smokey/net_common/smokey_net_server.c | 214 + testsuite/smokey/net_common/smokey_net_server.h | 31 ++ testsuite/smokey/net_packet_dgram/Makefile.am| 10 + testsuite/smokey/net_packet_dgram/packet_dgram.c | 81 testsuite/smokey/net_udp/Makefile.am | 10 + testsuite/smokey/net_udp/udp.c | 75 13 files changed, 1488 insertions(+) diff --git a/configure.ac b/configure.ac index c2fafb7..162e515 100644 --- a/configure.ac +++ b/configure.ac @@ -905,6 +905,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am index 023cd47..0139349 100644 --- a/testsuite/smokey/Makefile.am +++ b/testsuite/smokey/Makefile.am @@ -11,6 +11,9 @@ COBALT_SUBDIRS = \ fpu-stress \ iddp\ leaks \ + net_packet_dgram\ + net_udp \ + net_common \ posix-clock \ posix-cond \ posix-fork \ diff --git a/testsuite/smokey/net_common/Makefile.am b/testsuite/smokey/net_common/Makefile.am new file mode 100644 index 000..a0c6522 --- /dev/null +++ b/testsuite/smokey/net_common/Makefile.am @@ -0,0 +1,27 @@ +bin_PROGRAMS = smokey_net_server + +noinst_LIBRARIES = libnet_common.a +noinst_HEADERS = \ + smokey_net.h \ + smokey_net_server.h + +AM_CPPFLAGS = \ + @XENO_USER_CFLAGS@ \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/kernel/drivers/net/stack/include + +libnet_common_a_SOURCES = \ + client.c \ + server.c \ + setup.c + +smokey_net_server_SOURCES = \ + smokey_net_server.c + +smokey_net_server_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ + +smokey_net_server_LDADD = \ + libnet_common.a \ + $(top_builddir)/lib/@XENO_CORE_LIB@ \ + @XENO_USER_LDADD@ \ + -lpthread -lrt diff --git a/testsuite/smokey/net_common/client.c b/testsuite/smokey/net_common/client.c new file mode 100644 index 000..0932825 --- /dev/null +++ b/testsuite/smokey/net_common/client.c @@ -0,0 +1,286 @@ +#include +#include + +#include +#include +#include +#include +#include + +#include "smokey_net.h" + +static int duration = 10; +static int rate = 1000; +static const char *driver = "rt_loopback"; +static const char *intf; +static pthread_t tid; +static unsigned long long glost, glate; + +static int rcv_packet(struct smokey_net_client *client, int sock, unsigned seq, + struct timespec *next_shot, bool last) +{ + static unsigned long long gmin = ~0ULL, gmax = 0, gsum = 0, gcount = 0; + static unsigned long long min = ~0ULL, max = 0, sum = 0, count = 0, + lost = 0, late = 0; + static struct timespec last_print; + struct smokey_net_payload payload; + struct timeval timeout; + struct timespec now; + char packet[256]; + long long diff; + fd_set set; + int err; + + FD_ZERO(); + FD_SET(sock, ); + + err = smokey_check_errno( + __RT(clock_gettime(CLOCK_MONOTONIC, ))); + if (err < 0) + return err; + + diff = next_shot->tv_sec * 10ULL + next_shot->tv_nsec + - (now.tv_sec * 10ULL + now.tv_nsec); + if (diff < 0) + diff = 0; + + timeout.tv_sec = diff / 10; + timeout.tv_usec = (diff % 10 + 500) / 1000; + + err = smokey_check_errno( + __RT(select(sock + 1, , NULL, NULL, ))); + if (err < 0) + return err; + + if (err == 0) { + if (seq) + ++lost; + err = -ETIMEDOUT; + goto print_stats; + } + + err =
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-gch Branch: next Commit: d190876cfb5feaafca477c797c324278e06cda93 URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=d190876cfb5feaafca477c797c324278e06cda93 Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 + testsuite/smokey/Makefile.am |3 + testsuite/smokey/net_common/Makefile.am | 27 ++ testsuite/smokey/net_common/client.c | 286 testsuite/smokey/net_common/server.c | 178 testsuite/smokey/net_common/setup.c | 519 ++ testsuite/smokey/net_common/smokey_net.h | 51 +++ testsuite/smokey/net_common/smokey_net_server.c | 214 + testsuite/smokey/net_common/smokey_net_server.h | 31 ++ testsuite/smokey/net_packet_dgram/Makefile.am| 10 + testsuite/smokey/net_packet_dgram/packet_dgram.c | 81 testsuite/smokey/net_udp/Makefile.am | 10 + testsuite/smokey/net_udp/udp.c | 75 13 files changed, 1488 insertions(+) diff --git a/configure.ac b/configure.ac index c2fafb7..162e515 100644 --- a/configure.ac +++ b/configure.ac @@ -905,6 +905,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am index 023cd47..0139349 100644 --- a/testsuite/smokey/Makefile.am +++ b/testsuite/smokey/Makefile.am @@ -11,6 +11,9 @@ COBALT_SUBDIRS = \ fpu-stress \ iddp\ leaks \ + net_packet_dgram\ + net_udp \ + net_common \ posix-clock \ posix-cond \ posix-fork \ diff --git a/testsuite/smokey/net_common/Makefile.am b/testsuite/smokey/net_common/Makefile.am new file mode 100644 index 000..a0c6522 --- /dev/null +++ b/testsuite/smokey/net_common/Makefile.am @@ -0,0 +1,27 @@ +bin_PROGRAMS = smokey_net_server + +noinst_LIBRARIES = libnet_common.a +noinst_HEADERS = \ + smokey_net.h \ + smokey_net_server.h + +AM_CPPFLAGS = \ + @XENO_USER_CFLAGS@ \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/kernel/drivers/net/stack/include + +libnet_common_a_SOURCES = \ + client.c \ + server.c \ + setup.c + +smokey_net_server_SOURCES = \ + smokey_net_server.c + +smokey_net_server_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ + +smokey_net_server_LDADD = \ + libnet_common.a \ + $(top_builddir)/lib/@XENO_CORE_LIB@ \ + @XENO_USER_LDADD@ \ + -lpthread -lrt diff --git a/testsuite/smokey/net_common/client.c b/testsuite/smokey/net_common/client.c new file mode 100644 index 000..0932825 --- /dev/null +++ b/testsuite/smokey/net_common/client.c @@ -0,0 +1,286 @@ +#include +#include + +#include +#include +#include +#include +#include + +#include "smokey_net.h" + +static int duration = 10; +static int rate = 1000; +static const char *driver = "rt_loopback"; +static const char *intf; +static pthread_t tid; +static unsigned long long glost, glate; + +static int rcv_packet(struct smokey_net_client *client, int sock, unsigned seq, + struct timespec *next_shot, bool last) +{ + static unsigned long long gmin = ~0ULL, gmax = 0, gsum = 0, gcount = 0; + static unsigned long long min = ~0ULL, max = 0, sum = 0, count = 0, + lost = 0, late = 0; + static struct timespec last_print; + struct smokey_net_payload payload; + struct timeval timeout; + struct timespec now; + char packet[256]; + long long diff; + fd_set set; + int err; + + FD_ZERO(); + FD_SET(sock, ); + + err = smokey_check_errno( + __RT(clock_gettime(CLOCK_MONOTONIC, ))); + if (err < 0) + return err; + + diff = next_shot->tv_sec * 10ULL + next_shot->tv_nsec + - (now.tv_sec * 10ULL + now.tv_nsec); + if (diff < 0) + diff = 0; + + timeout.tv_sec = diff / 10; + timeout.tv_usec = (diff % 10 + 500) / 1000; + + err = smokey_check_errno( + __RT(select(sock + 1, , NULL, NULL, ))); + if (err < 0) + return err; + + if (err == 0) { + if (seq) + ++lost; + err = -ETIMEDOUT; + goto print_stats; + } + + err =
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-gch Branch: next Commit: db1ea99fab7b95e6dd2be5c3c67bbfe263c17ba2 URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=db1ea99fab7b95e6dd2be5c3c67bbfe263c17ba2 Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 + testsuite/smokey/Makefile.am |3 + testsuite/smokey/net_common/Makefile.am | 27 ++ testsuite/smokey/net_common/client.c | 286 testsuite/smokey/net_common/server.c | 178 testsuite/smokey/net_common/setup.c | 519 ++ testsuite/smokey/net_common/smokey_net.h | 51 +++ testsuite/smokey/net_common/smokey_net_server.c | 214 + testsuite/smokey/net_common/smokey_net_server.h | 31 ++ testsuite/smokey/net_packet_dgram/Makefile.am| 10 + testsuite/smokey/net_packet_dgram/packet_dgram.c | 81 testsuite/smokey/net_udp/Makefile.am | 10 + testsuite/smokey/net_udp/udp.c | 75 13 files changed, 1488 insertions(+) diff --git a/configure.ac b/configure.ac index c2fafb7..162e515 100644 --- a/configure.ac +++ b/configure.ac @@ -905,6 +905,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am index 023cd47..0139349 100644 --- a/testsuite/smokey/Makefile.am +++ b/testsuite/smokey/Makefile.am @@ -11,6 +11,9 @@ COBALT_SUBDIRS = \ fpu-stress \ iddp\ leaks \ + net_packet_dgram\ + net_udp \ + net_common \ posix-clock \ posix-cond \ posix-fork \ diff --git a/testsuite/smokey/net_common/Makefile.am b/testsuite/smokey/net_common/Makefile.am new file mode 100644 index 000..a0c6522 --- /dev/null +++ b/testsuite/smokey/net_common/Makefile.am @@ -0,0 +1,27 @@ +bin_PROGRAMS = smokey_net_server + +noinst_LIBRARIES = libnet_common.a +noinst_HEADERS = \ + smokey_net.h \ + smokey_net_server.h + +AM_CPPFLAGS = \ + @XENO_USER_CFLAGS@ \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/kernel/drivers/net/stack/include + +libnet_common_a_SOURCES = \ + client.c \ + server.c \ + setup.c + +smokey_net_server_SOURCES = \ + smokey_net_server.c + +smokey_net_server_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ + +smokey_net_server_LDADD = \ + libnet_common.a \ + $(top_builddir)/lib/@XENO_CORE_LIB@ \ + @XENO_USER_LDADD@ \ + -lpthread -lrt diff --git a/testsuite/smokey/net_common/client.c b/testsuite/smokey/net_common/client.c new file mode 100644 index 000..0932825 --- /dev/null +++ b/testsuite/smokey/net_common/client.c @@ -0,0 +1,286 @@ +#include +#include + +#include +#include +#include +#include +#include + +#include "smokey_net.h" + +static int duration = 10; +static int rate = 1000; +static const char *driver = "rt_loopback"; +static const char *intf; +static pthread_t tid; +static unsigned long long glost, glate; + +static int rcv_packet(struct smokey_net_client *client, int sock, unsigned seq, + struct timespec *next_shot, bool last) +{ + static unsigned long long gmin = ~0ULL, gmax = 0, gsum = 0, gcount = 0; + static unsigned long long min = ~0ULL, max = 0, sum = 0, count = 0, + lost = 0, late = 0; + static struct timespec last_print; + struct smokey_net_payload payload; + struct timeval timeout; + struct timespec now; + char packet[256]; + long long diff; + fd_set set; + int err; + + FD_ZERO(); + FD_SET(sock, ); + + err = smokey_check_errno( + __RT(clock_gettime(CLOCK_MONOTONIC, ))); + if (err < 0) + return err; + + diff = next_shot->tv_sec * 10ULL + next_shot->tv_nsec + - (now.tv_sec * 10ULL + now.tv_nsec); + if (diff < 0) + diff = 0; + + timeout.tv_sec = diff / 10; + timeout.tv_usec = (diff % 10 + 500) / 1000; + + err = smokey_check_errno( + __RT(select(sock + 1, , NULL, NULL, ))); + if (err < 0) + return err; + + if (err == 0) { + if (seq) + ++lost; + err = -ETIMEDOUT; + goto print_stats; + } + + err =
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-gch Branch: next Commit: 8df11534d978603b41ac6e1f2c6edf3b1029c784 URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=8df11534d978603b41ac6e1f2c6edf3b1029c784 Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 + testsuite/smokey/Makefile.am |3 + testsuite/smokey/net_common/Makefile.am | 25 ++ testsuite/smokey/net_common/client.c | 286 testsuite/smokey/net_common/server.c | 178 testsuite/smokey/net_common/setup.c | 519 ++ testsuite/smokey/net_common/smokey_net.h | 51 +++ testsuite/smokey/net_common/smokey_net_server.c | 214 + testsuite/smokey/net_common/smokey_net_server.h | 31 ++ testsuite/smokey/net_packet_dgram/Makefile.am| 10 + testsuite/smokey/net_packet_dgram/packet_dgram.c | 81 testsuite/smokey/net_udp/Makefile.am | 10 + testsuite/smokey/net_udp/udp.c | 75 13 files changed, 1486 insertions(+) diff --git a/configure.ac b/configure.ac index 89c2911..5364b4f 100644 --- a/configure.ac +++ b/configure.ac @@ -900,6 +900,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am index 023cd47..0139349 100644 --- a/testsuite/smokey/Makefile.am +++ b/testsuite/smokey/Makefile.am @@ -11,6 +11,9 @@ COBALT_SUBDIRS = \ fpu-stress \ iddp\ leaks \ + net_packet_dgram\ + net_udp \ + net_common \ posix-clock \ posix-cond \ posix-fork \ diff --git a/testsuite/smokey/net_common/Makefile.am b/testsuite/smokey/net_common/Makefile.am new file mode 100644 index 000..614c709 --- /dev/null +++ b/testsuite/smokey/net_common/Makefile.am @@ -0,0 +1,25 @@ +bin_PROGRAMS = smokey_net_server + +noinst_LIBRARIES = libnet_common.a +noinst_HEADERS = smokey_net.h + +AM_CPPFLAGS = \ + @XENO_USER_CFLAGS@ \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/kernel/drivers/net/stack/include + +libnet_common_a_SOURCES = \ + client.c \ + server.c \ + setup.c + +smokey_net_server_SOURCES = \ + smokey_net_server.c + +smokey_net_server_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ + +smokey_net_server_LDADD = \ + libnet_common.a \ + $(top_builddir)/lib/@XENO_CORE_LIB@ \ + @XENO_USER_LDADD@ \ + -lpthread -lrt diff --git a/testsuite/smokey/net_common/client.c b/testsuite/smokey/net_common/client.c new file mode 100644 index 000..0932825 --- /dev/null +++ b/testsuite/smokey/net_common/client.c @@ -0,0 +1,286 @@ +#include +#include + +#include +#include +#include +#include +#include + +#include "smokey_net.h" + +static int duration = 10; +static int rate = 1000; +static const char *driver = "rt_loopback"; +static const char *intf; +static pthread_t tid; +static unsigned long long glost, glate; + +static int rcv_packet(struct smokey_net_client *client, int sock, unsigned seq, + struct timespec *next_shot, bool last) +{ + static unsigned long long gmin = ~0ULL, gmax = 0, gsum = 0, gcount = 0; + static unsigned long long min = ~0ULL, max = 0, sum = 0, count = 0, + lost = 0, late = 0; + static struct timespec last_print; + struct smokey_net_payload payload; + struct timeval timeout; + struct timespec now; + char packet[256]; + long long diff; + fd_set set; + int err; + + FD_ZERO(); + FD_SET(sock, ); + + err = smokey_check_errno( + __RT(clock_gettime(CLOCK_MONOTONIC, ))); + if (err < 0) + return err; + + diff = next_shot->tv_sec * 10ULL + next_shot->tv_nsec + - (now.tv_sec * 10ULL + now.tv_nsec); + if (diff < 0) + diff = 0; + + timeout.tv_sec = diff / 10; + timeout.tv_usec = (diff % 10 + 500) / 1000; + + err = smokey_check_errno( + __RT(select(sock + 1, , NULL, NULL, ))); + if (err < 0) + return err; + + if (err == 0) { + if (seq) + ++lost; + err = -ETIMEDOUT; + goto print_stats; + } + + err = smokey_check_errno( + __RT(recv(sock,
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-3 Branch: stable-3.0.x Commit: 5b22c6a9d5ab0c2a6f699c58ed335e62e049fe88 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=5b22c6a9d5ab0c2a6f699c58ed335e62e049fe88 Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 + testsuite/smokey/Makefile.am |3 + testsuite/smokey/net_common/Makefile.am | 25 ++ testsuite/smokey/net_common/client.c | 286 testsuite/smokey/net_common/server.c | 178 testsuite/smokey/net_common/setup.c | 519 ++ testsuite/smokey/net_common/smokey_net.h | 51 +++ testsuite/smokey/net_common/smokey_net_server.c | 214 + testsuite/smokey/net_common/smokey_net_server.h | 31 ++ testsuite/smokey/net_packet_dgram/Makefile.am| 10 + testsuite/smokey/net_packet_dgram/packet_dgram.c | 81 testsuite/smokey/net_udp/Makefile.am | 10 + testsuite/smokey/net_udp/udp.c | 75 13 files changed, 1486 insertions(+) diff --git a/configure.ac b/configure.ac index 36d7fb7..83efb47 100644 --- a/configure.ac +++ b/configure.ac @@ -891,6 +891,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/timerfd/Makefile \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am index 465e32b..e864943 100644 --- a/testsuite/smokey/Makefile.am +++ b/testsuite/smokey/Makefile.am @@ -10,6 +10,9 @@ COBALT_SUBDIRS = \ bufp\ iddp\ leaks \ + net_packet_dgram\ + net_udp \ + net_common \ posix-clock \ posix-cond \ posix-fork \ diff --git a/testsuite/smokey/net_common/Makefile.am b/testsuite/smokey/net_common/Makefile.am new file mode 100644 index 000..614c709 --- /dev/null +++ b/testsuite/smokey/net_common/Makefile.am @@ -0,0 +1,25 @@ +bin_PROGRAMS = smokey_net_server + +noinst_LIBRARIES = libnet_common.a +noinst_HEADERS = smokey_net.h + +AM_CPPFLAGS = \ + @XENO_USER_CFLAGS@ \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/kernel/drivers/net/stack/include + +libnet_common_a_SOURCES = \ + client.c \ + server.c \ + setup.c + +smokey_net_server_SOURCES = \ + smokey_net_server.c + +smokey_net_server_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ + +smokey_net_server_LDADD = \ + libnet_common.a \ + $(top_builddir)/lib/@XENO_CORE_LIB@ \ + @XENO_USER_LDADD@ \ + -lpthread -lrt diff --git a/testsuite/smokey/net_common/client.c b/testsuite/smokey/net_common/client.c new file mode 100644 index 000..0932825 --- /dev/null +++ b/testsuite/smokey/net_common/client.c @@ -0,0 +1,286 @@ +#include +#include + +#include +#include +#include +#include +#include + +#include "smokey_net.h" + +static int duration = 10; +static int rate = 1000; +static const char *driver = "rt_loopback"; +static const char *intf; +static pthread_t tid; +static unsigned long long glost, glate; + +static int rcv_packet(struct smokey_net_client *client, int sock, unsigned seq, + struct timespec *next_shot, bool last) +{ + static unsigned long long gmin = ~0ULL, gmax = 0, gsum = 0, gcount = 0; + static unsigned long long min = ~0ULL, max = 0, sum = 0, count = 0, + lost = 0, late = 0; + static struct timespec last_print; + struct smokey_net_payload payload; + struct timeval timeout; + struct timespec now; + char packet[256]; + long long diff; + fd_set set; + int err; + + FD_ZERO(); + FD_SET(sock, ); + + err = smokey_check_errno( + __RT(clock_gettime(CLOCK_MONOTONIC, ))); + if (err < 0) + return err; + + diff = next_shot->tv_sec * 10ULL + next_shot->tv_nsec + - (now.tv_sec * 10ULL + now.tv_nsec); + if (diff < 0) + diff = 0; + + timeout.tv_sec = diff / 10; + timeout.tv_usec = (diff % 10 + 500) / 1000; + + err = smokey_check_errno( + __RT(select(sock + 1, , NULL, NULL, ))); + if (err < 0) + return err; + + if (err == 0) { + if (seq) + ++lost; + err = -ETIMEDOUT; + goto print_stats; + } + + err = smokey_check_errno( + __RT(recv(sock,
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-3 Branch: next Commit: 5c8129cd03a55a78bac1a7a9d0536c9c462440bd URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=5c8129cd03a55a78bac1a7a9d0536c9c462440bd Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 + testsuite/smokey/Makefile.am |3 + testsuite/smokey/net_common/Makefile.am | 25 ++ testsuite/smokey/net_common/client.c | 286 testsuite/smokey/net_common/server.c | 178 testsuite/smokey/net_common/setup.c | 519 ++ testsuite/smokey/net_common/smokey_net.h | 51 +++ testsuite/smokey/net_common/smokey_net_server.c | 214 + testsuite/smokey/net_common/smokey_net_server.h | 31 ++ testsuite/smokey/net_packet_dgram/Makefile.am| 10 + testsuite/smokey/net_packet_dgram/packet_dgram.c | 81 testsuite/smokey/net_udp/Makefile.am | 10 + testsuite/smokey/net_udp/udp.c | 75 13 files changed, 1486 insertions(+) diff --git a/configure.ac b/configure.ac index 89c2911..5364b4f 100644 --- a/configure.ac +++ b/configure.ac @@ -900,6 +900,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am index 023cd47..0139349 100644 --- a/testsuite/smokey/Makefile.am +++ b/testsuite/smokey/Makefile.am @@ -11,6 +11,9 @@ COBALT_SUBDIRS = \ fpu-stress \ iddp\ leaks \ + net_packet_dgram\ + net_udp \ + net_common \ posix-clock \ posix-cond \ posix-fork \ diff --git a/testsuite/smokey/net_common/Makefile.am b/testsuite/smokey/net_common/Makefile.am new file mode 100644 index 000..614c709 --- /dev/null +++ b/testsuite/smokey/net_common/Makefile.am @@ -0,0 +1,25 @@ +bin_PROGRAMS = smokey_net_server + +noinst_LIBRARIES = libnet_common.a +noinst_HEADERS = smokey_net.h + +AM_CPPFLAGS = \ + @XENO_USER_CFLAGS@ \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/kernel/drivers/net/stack/include + +libnet_common_a_SOURCES = \ + client.c \ + server.c \ + setup.c + +smokey_net_server_SOURCES = \ + smokey_net_server.c + +smokey_net_server_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ + +smokey_net_server_LDADD = \ + libnet_common.a \ + $(top_builddir)/lib/@XENO_CORE_LIB@ \ + @XENO_USER_LDADD@ \ + -lpthread -lrt diff --git a/testsuite/smokey/net_common/client.c b/testsuite/smokey/net_common/client.c new file mode 100644 index 000..0932825 --- /dev/null +++ b/testsuite/smokey/net_common/client.c @@ -0,0 +1,286 @@ +#include +#include + +#include +#include +#include +#include +#include + +#include "smokey_net.h" + +static int duration = 10; +static int rate = 1000; +static const char *driver = "rt_loopback"; +static const char *intf; +static pthread_t tid; +static unsigned long long glost, glate; + +static int rcv_packet(struct smokey_net_client *client, int sock, unsigned seq, + struct timespec *next_shot, bool last) +{ + static unsigned long long gmin = ~0ULL, gmax = 0, gsum = 0, gcount = 0; + static unsigned long long min = ~0ULL, max = 0, sum = 0, count = 0, + lost = 0, late = 0; + static struct timespec last_print; + struct smokey_net_payload payload; + struct timeval timeout; + struct timespec now; + char packet[256]; + long long diff; + fd_set set; + int err; + + FD_ZERO(); + FD_SET(sock, ); + + err = smokey_check_errno( + __RT(clock_gettime(CLOCK_MONOTONIC, ))); + if (err < 0) + return err; + + diff = next_shot->tv_sec * 10ULL + next_shot->tv_nsec + - (now.tv_sec * 10ULL + now.tv_nsec); + if (diff < 0) + diff = 0; + + timeout.tv_sec = diff / 10; + timeout.tv_usec = (diff % 10 + 500) / 1000; + + err = smokey_check_errno( + __RT(select(sock + 1, , NULL, NULL, ))); + if (err < 0) + return err; + + if (err == 0) { + if (seq) + ++lost; + err = -ETIMEDOUT; + goto print_stats; + } + + err = smokey_check_errno( + __RT(recv(sock, packet,
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-gch Branch: stable-3.0.x Commit: 4181536caa51351ad26a6c4b225114d04c31c9c0 URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=4181536caa51351ad26a6c4b225114d04c31c9c0 Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 + testsuite/smokey/Makefile.am | 34 +- testsuite/smokey/net_common/Makefile.am | 25 ++ testsuite/smokey/net_common/client.c | 286 testsuite/smokey/net_common/server.c | 178 testsuite/smokey/net_common/setup.c | 519 ++ testsuite/smokey/net_common/smokey_net.h | 51 +++ testsuite/smokey/net_common/smokey_net_server.c | 214 + testsuite/smokey/net_common/smokey_net_server.h | 31 ++ testsuite/smokey/net_packet_dgram/Makefile.am| 10 + testsuite/smokey/net_packet_dgram/packet_dgram.c | 81 testsuite/smokey/net_udp/Makefile.am | 10 + testsuite/smokey/net_udp/udp.c | 75 13 files changed, 1495 insertions(+), 22 deletions(-) diff --git a/configure.ac b/configure.ac index 36d7fb7..83efb47 100644 --- a/configure.ac +++ b/configure.ac @@ -891,6 +891,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/timerfd/Makefile \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am index 87e0555..f03b3ec 100644 --- a/testsuite/smokey/Makefile.am +++ b/testsuite/smokey/Makefile.am @@ -5,13 +5,14 @@ CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC) smokey_SOURCES = main.c -if XENO_COBALT -wrappers = $(XENO_POSIX_WRAPPERS) -SUBDIRS = \ +COBALT_SUBDIRS = \ arith \ bufp\ iddp\ leaks \ + net_packet_dgram\ + net_udp \ + net_common \ posix-clock \ posix-cond \ posix-fork \ @@ -25,8 +26,14 @@ SUBDIRS =\ tsc \ vdso-access \ xddp + +MERCURY_SUBDIRS = + +if XENO_COBALT +wrappers = $(XENO_POSIX_WRAPPERS) +SUBDIRS = $(COBALT_SUBDIRS) else -SUBDIRS = +SUBDIRS = $(MERCURY_SUBDIRS) wrappers = endif @@ -51,21 +58,4 @@ smokey_LDADD = \ @XENO_USER_LDADD@ \ -lpthread -lrt -DIST_SUBDIRS = \ - arith \ - bufp\ - iddp\ - leaks \ - posix-clock \ - posix-cond \ - posix-fork \ - posix-mutex \ - posix-select\ - rtdm\ - sched-quota \ - sched-tp\ - sigdebug\ - timerfd \ - tsc \ - vdso-access \ - xddp +DIST_SUBDIRS = $(COBALT_SUBDIRS) $(MERCURY_SUBDIRS) diff --git a/testsuite/smokey/net_common/Makefile.am b/testsuite/smokey/net_common/Makefile.am new file mode 100644 index 000..614c709 --- /dev/null +++ b/testsuite/smokey/net_common/Makefile.am @@ -0,0 +1,25 @@ +bin_PROGRAMS = smokey_net_server + +noinst_LIBRARIES = libnet_common.a +noinst_HEADERS = smokey_net.h + +AM_CPPFLAGS = \ + @XENO_USER_CFLAGS@ \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/kernel/drivers/net/stack/include + +libnet_common_a_SOURCES = \ + client.c \ + server.c \ + setup.c + +smokey_net_server_SOURCES = \ + smokey_net_server.c + +smokey_net_server_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ + +smokey_net_server_LDADD = \ + libnet_common.a \ + $(top_builddir)/lib/@XENO_CORE_LIB@ \ + @XENO_USER_LDADD@ \ + -lpthread -lrt diff --git a/testsuite/smokey/net_common/client.c b/testsuite/smokey/net_common/client.c new file mode 100644 index 000..0932825 --- /dev/null +++ b/testsuite/smokey/net_common/client.c @@ -0,0 +1,286 @@ +#include +#include + +#include +#include +#include +#include +#include + +#include "smokey_net.h" + +static int duration = 10; +static int rate = 1000; +static const char *driver = "rt_loopback"; +static const char *intf; +static pthread_t tid; +static unsigned long long glost, glate; + +static int rcv_packet(struct smokey_net_client *client, int sock, unsigned seq, + struct timespec *next_shot, bool last) +{ + static unsigned long long gmin = ~0ULL, gmax = 0, gsum = 0, gcount = 0; + static unsigned long long min = ~0ULL,
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-gch Branch: stable-3.0.x Commit: 5b22c6a9d5ab0c2a6f699c58ed335e62e049fe88 URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=5b22c6a9d5ab0c2a6f699c58ed335e62e049fe88 Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 + testsuite/smokey/Makefile.am |3 + testsuite/smokey/net_common/Makefile.am | 25 ++ testsuite/smokey/net_common/client.c | 286 testsuite/smokey/net_common/server.c | 178 testsuite/smokey/net_common/setup.c | 519 ++ testsuite/smokey/net_common/smokey_net.h | 51 +++ testsuite/smokey/net_common/smokey_net_server.c | 214 + testsuite/smokey/net_common/smokey_net_server.h | 31 ++ testsuite/smokey/net_packet_dgram/Makefile.am| 10 + testsuite/smokey/net_packet_dgram/packet_dgram.c | 81 testsuite/smokey/net_udp/Makefile.am | 10 + testsuite/smokey/net_udp/udp.c | 75 13 files changed, 1486 insertions(+) diff --git a/configure.ac b/configure.ac index 36d7fb7..83efb47 100644 --- a/configure.ac +++ b/configure.ac @@ -891,6 +891,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/timerfd/Makefile \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am index 465e32b..e864943 100644 --- a/testsuite/smokey/Makefile.am +++ b/testsuite/smokey/Makefile.am @@ -10,6 +10,9 @@ COBALT_SUBDIRS = \ bufp\ iddp\ leaks \ + net_packet_dgram\ + net_udp \ + net_common \ posix-clock \ posix-cond \ posix-fork \ diff --git a/testsuite/smokey/net_common/Makefile.am b/testsuite/smokey/net_common/Makefile.am new file mode 100644 index 000..614c709 --- /dev/null +++ b/testsuite/smokey/net_common/Makefile.am @@ -0,0 +1,25 @@ +bin_PROGRAMS = smokey_net_server + +noinst_LIBRARIES = libnet_common.a +noinst_HEADERS = smokey_net.h + +AM_CPPFLAGS = \ + @XENO_USER_CFLAGS@ \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/kernel/drivers/net/stack/include + +libnet_common_a_SOURCES = \ + client.c \ + server.c \ + setup.c + +smokey_net_server_SOURCES = \ + smokey_net_server.c + +smokey_net_server_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ + +smokey_net_server_LDADD = \ + libnet_common.a \ + $(top_builddir)/lib/@XENO_CORE_LIB@ \ + @XENO_USER_LDADD@ \ + -lpthread -lrt diff --git a/testsuite/smokey/net_common/client.c b/testsuite/smokey/net_common/client.c new file mode 100644 index 000..0932825 --- /dev/null +++ b/testsuite/smokey/net_common/client.c @@ -0,0 +1,286 @@ +#include +#include + +#include +#include +#include +#include +#include + +#include "smokey_net.h" + +static int duration = 10; +static int rate = 1000; +static const char *driver = "rt_loopback"; +static const char *intf; +static pthread_t tid; +static unsigned long long glost, glate; + +static int rcv_packet(struct smokey_net_client *client, int sock, unsigned seq, + struct timespec *next_shot, bool last) +{ + static unsigned long long gmin = ~0ULL, gmax = 0, gsum = 0, gcount = 0; + static unsigned long long min = ~0ULL, max = 0, sum = 0, count = 0, + lost = 0, late = 0; + static struct timespec last_print; + struct smokey_net_payload payload; + struct timeval timeout; + struct timespec now; + char packet[256]; + long long diff; + fd_set set; + int err; + + FD_ZERO(); + FD_SET(sock, ); + + err = smokey_check_errno( + __RT(clock_gettime(CLOCK_MONOTONIC, ))); + if (err < 0) + return err; + + diff = next_shot->tv_sec * 10ULL + next_shot->tv_nsec + - (now.tv_sec * 10ULL + now.tv_nsec); + if (diff < 0) + diff = 0; + + timeout.tv_sec = diff / 10; + timeout.tv_usec = (diff % 10 + 500) / 1000; + + err = smokey_check_errno( + __RT(select(sock + 1, , NULL, NULL, ))); + if (err < 0) + return err; + + if (err == 0) { + if (seq) + ++lost; + err = -ETIMEDOUT; + goto print_stats; + } + + err = smokey_check_errno( + __RT(recv(sock,
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-gch Branch: next Commit: 5c8129cd03a55a78bac1a7a9d0536c9c462440bd URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=5c8129cd03a55a78bac1a7a9d0536c9c462440bd Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |3 + testsuite/smokey/Makefile.am |3 + testsuite/smokey/net_common/Makefile.am | 25 ++ testsuite/smokey/net_common/client.c | 286 testsuite/smokey/net_common/server.c | 178 testsuite/smokey/net_common/setup.c | 519 ++ testsuite/smokey/net_common/smokey_net.h | 51 +++ testsuite/smokey/net_common/smokey_net_server.c | 214 + testsuite/smokey/net_common/smokey_net_server.h | 31 ++ testsuite/smokey/net_packet_dgram/Makefile.am| 10 + testsuite/smokey/net_packet_dgram/packet_dgram.c | 81 testsuite/smokey/net_udp/Makefile.am | 10 + testsuite/smokey/net_udp/udp.c | 75 13 files changed, 1486 insertions(+) diff --git a/configure.ac b/configure.ac index 89c2911..5364b4f 100644 --- a/configure.ac +++ b/configure.ac @@ -900,6 +900,9 @@ AC_CONFIG_FILES([ \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ testsuite/smokey/fpu-stress/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/clocktest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am index 023cd47..0139349 100644 --- a/testsuite/smokey/Makefile.am +++ b/testsuite/smokey/Makefile.am @@ -11,6 +11,9 @@ COBALT_SUBDIRS = \ fpu-stress \ iddp\ leaks \ + net_packet_dgram\ + net_udp \ + net_common \ posix-clock \ posix-cond \ posix-fork \ diff --git a/testsuite/smokey/net_common/Makefile.am b/testsuite/smokey/net_common/Makefile.am new file mode 100644 index 000..614c709 --- /dev/null +++ b/testsuite/smokey/net_common/Makefile.am @@ -0,0 +1,25 @@ +bin_PROGRAMS = smokey_net_server + +noinst_LIBRARIES = libnet_common.a +noinst_HEADERS = smokey_net.h + +AM_CPPFLAGS = \ + @XENO_USER_CFLAGS@ \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/kernel/drivers/net/stack/include + +libnet_common_a_SOURCES = \ + client.c \ + server.c \ + setup.c + +smokey_net_server_SOURCES = \ + smokey_net_server.c + +smokey_net_server_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ + +smokey_net_server_LDADD = \ + libnet_common.a \ + $(top_builddir)/lib/@XENO_CORE_LIB@ \ + @XENO_USER_LDADD@ \ + -lpthread -lrt diff --git a/testsuite/smokey/net_common/client.c b/testsuite/smokey/net_common/client.c new file mode 100644 index 000..0932825 --- /dev/null +++ b/testsuite/smokey/net_common/client.c @@ -0,0 +1,286 @@ +#include +#include + +#include +#include +#include +#include +#include + +#include "smokey_net.h" + +static int duration = 10; +static int rate = 1000; +static const char *driver = "rt_loopback"; +static const char *intf; +static pthread_t tid; +static unsigned long long glost, glate; + +static int rcv_packet(struct smokey_net_client *client, int sock, unsigned seq, + struct timespec *next_shot, bool last) +{ + static unsigned long long gmin = ~0ULL, gmax = 0, gsum = 0, gcount = 0; + static unsigned long long min = ~0ULL, max = 0, sum = 0, count = 0, + lost = 0, late = 0; + static struct timespec last_print; + struct smokey_net_payload payload; + struct timeval timeout; + struct timespec now; + char packet[256]; + long long diff; + fd_set set; + int err; + + FD_ZERO(); + FD_SET(sock, ); + + err = smokey_check_errno( + __RT(clock_gettime(CLOCK_MONOTONIC, ))); + if (err < 0) + return err; + + diff = next_shot->tv_sec * 10ULL + next_shot->tv_nsec + - (now.tv_sec * 10ULL + now.tv_nsec); + if (diff < 0) + diff = 0; + + timeout.tv_sec = diff / 10; + timeout.tv_usec = (diff % 10 + 500) / 1000; + + err = smokey_check_errno( + __RT(select(sock + 1, , NULL, NULL, ))); + if (err < 0) + return err; + + if (err == 0) { + if (seq) + ++lost; + err = -ETIMEDOUT; + goto print_stats; + } + + err = smokey_check_errno( + __RT(recv(sock,
[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: add RTnet testsuite
Module: xenomai-gch Branch: next Commit: 74bd22c6c498ea6c797bea555b97c43063f5753c URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=74bd22c6c498ea6c797bea555b97c43063f5753c Author: Gilles ChanteperdrixDate: Sun Oct 11 16:05:18 2015 +0200 testsuite/smokey: add RTnet testsuite Starting with UDP and raw sockets. Measuring round trip time and checking for lost packets. --- configure.ac |6 +- testsuite/smokey/Makefile.am |5 +- testsuite/smokey/net_common/Makefile.am | 25 ++ testsuite/smokey/net_common/client.c | 286 testsuite/smokey/net_common/server.c | 178 testsuite/smokey/net_common/setup.c | 517 ++ testsuite/smokey/net_common/smokey_net.h | 51 +++ testsuite/smokey/net_common/smokey_net_server.c | 214 + testsuite/smokey/net_common/smokey_net_server.h | 31 ++ testsuite/smokey/net_packet_dgram/Makefile.am| 10 + testsuite/smokey/net_packet_dgram/packet_dgram.c | 81 testsuite/smokey/net_udp/Makefile.am | 10 + testsuite/smokey/net_udp/udp.c | 75 13 files changed, 1487 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 89c2911..c277e50 100644 --- a/configure.ac +++ b/configure.ac @@ -879,8 +879,8 @@ AC_CONFIG_FILES([ \ lib/smokey/Makefile \ lib/trank/Makefile \ testsuite/Makefile \ + testsuite/clocktest/Makefile \ testsuite/latency/Makefile \ - testsuite/switchtest/Makefile \ testsuite/smokey/Makefile \ testsuite/smokey/arith/Makefile \ testsuite/smokey/sched-quota/Makefile \ @@ -899,8 +899,12 @@ AC_CONFIG_FILES([ \ testsuite/smokey/timerfd/Makefile \ testsuite/smokey/tsc/Makefile \ testsuite/smokey/leaks/Makefile \ + testsuite/smokey/net_udp/Makefile \ + testsuite/smokey/net_packet_dgram/Makefile \ + testsuite/smokey/net_common/Makefile \ testsuite/smokey/fpu-stress/Makefile \ testsuite/clocktest/Makefile \ + testsuite/switchtest/Makefile \ testsuite/xeno-test/Makefile \ utils/Makefile \ utils/hdb/Makefile \ diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am index 023cd47..1a0364a 100644 --- a/testsuite/smokey/Makefile.am +++ b/testsuite/smokey/Makefile.am @@ -11,6 +11,9 @@ COBALT_SUBDIRS = \ fpu-stress \ iddp\ leaks \ + net_packet_dgram\ + net_udp \ + net_common \ posix-clock \ posix-cond \ posix-fork \ @@ -28,7 +31,7 @@ COBALT_SUBDIRS = \ MERCURY_SUBDIRS = DIST_SUBDIRS = $(COBALT_SUBDIRS) $(MERCURY_SUBDIRS) - + if XENO_COBALT wrappers = $(XENO_POSIX_WRAPPERS) SUBDIRS = $(COBALT_SUBDIRS) diff --git a/testsuite/smokey/net_common/Makefile.am b/testsuite/smokey/net_common/Makefile.am new file mode 100644 index 000..614c709 --- /dev/null +++ b/testsuite/smokey/net_common/Makefile.am @@ -0,0 +1,25 @@ +bin_PROGRAMS = smokey_net_server + +noinst_LIBRARIES = libnet_common.a +noinst_HEADERS = smokey_net.h + +AM_CPPFLAGS = \ + @XENO_USER_CFLAGS@ \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/kernel/drivers/net/stack/include + +libnet_common_a_SOURCES = \ + client.c \ + server.c \ + setup.c + +smokey_net_server_SOURCES = \ + smokey_net_server.c + +smokey_net_server_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ + +smokey_net_server_LDADD = \ + libnet_common.a \ + $(top_builddir)/lib/@XENO_CORE_LIB@ \ + @XENO_USER_LDADD@ \ + -lpthread -lrt diff --git a/testsuite/smokey/net_common/client.c b/testsuite/smokey/net_common/client.c new file mode 100644 index 000..0932825 --- /dev/null +++ b/testsuite/smokey/net_common/client.c @@ -0,0 +1,286 @@ +#include +#include + +#include +#include +#include +#include +#include + +#include "smokey_net.h" + +static int duration = 10; +static int rate = 1000; +static const char *driver = "rt_loopback"; +static const char *intf; +static pthread_t tid; +static unsigned long long glost, glate; + +static int rcv_packet(struct smokey_net_client *client, int sock, unsigned seq, + struct timespec *next_shot, bool last) +{ + static unsigned long long gmin = ~0ULL, gmax = 0, gsum = 0, gcount = 0; + static unsigned long long min = ~0ULL, max = 0, sum = 0, count = 0, + lost = 0, late = 0; + static struct timespec last_print; + struct smokey_net_payload payload; + struct timeval timeout; + struct timespec now; + char packet[256]; + long long diff; + fd_set set; + int err; + + FD_ZERO(); + FD_SET(sock, ); + + err = smokey_check_errno( + __RT(clock_gettime(CLOCK_MONOTONIC, ))); +