mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-19 11:16:57 +00:00
netperf: use omni and rely on SO_RCVBUF available
This commit is contained in:
parent
2349cd2dc3
commit
5bbf1f7eea
@ -23,7 +23,8 @@ $(CONTRIB_DIR)/$(NETPERF):
|
||||
checkout-netperf: $(CONTRIB_DIR)/$(NETPERF)
|
||||
|
||||
apply_patches-netperf: checkout-netperf
|
||||
$(VERBOSE)patch -d contrib/netperf -N -p0 < $(CURDIR)/src/app/netperf/timer.patch
|
||||
$(VERBOSE)find $(CURDIR)/src/app/netperf/ -name "*.patch" |\
|
||||
xargs -ixxx sh -c "patch -p0 -r - -N -d $(CONTRIB_DIR)/$(NETPERF) < xxx" || true
|
||||
$(VERBOSE)echo '#define NETPERF_VERSION "$(NETPERF_VERSION)"' >$(CONTRIB_DIR)/$(NETPERF)/src/netperf_version.h
|
||||
|
||||
prepare:: apply_patches-netperf
|
||||
|
@ -53,7 +53,7 @@ set config {
|
||||
<provides> <service name="Timer"/> </provides>
|
||||
</start>
|
||||
<start name="netperf">
|
||||
<resource name="RAM" quantum="3M"/>
|
||||
<resource name="RAM" quantum="16M"/>
|
||||
<config>
|
||||
<arg value="netserver"/>
|
||||
<arg value="-D"/>
|
||||
@ -136,9 +136,10 @@ append qemu_args " -m 128 "
|
||||
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
|
||||
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
|
||||
|
||||
append qemu_args " -net user -redir tcp:12865::12865 "
|
||||
append qemu_args " -net user -redir tcp:12865::12865 -redir tcp:49153::49153 "
|
||||
|
||||
run_genode_until {.*and family AF_INET.*} 30
|
||||
set serial_id $spawn_id
|
||||
|
||||
|
||||
if [is_qemu_available] {
|
||||
@ -149,7 +150,7 @@ if [is_qemu_available] {
|
||||
puts ""
|
||||
}
|
||||
|
||||
spawn netperf -H $ip_addr -P 1 -v 2 -t TCP_STREAM
|
||||
spawn netperf -H $ip_addr -P 1 -v 2 -t TCP_STREAM -c -C -- -S 0,65520 -P 49153,49153
|
||||
set netperf_id $spawn_id
|
||||
|
||||
run_genode_until "Segment" 60 $netperf_id
|
||||
|
@ -257,7 +257,7 @@
|
||||
#undef HAVE_SYS_SYSINFO_H
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
@ -377,10 +377,10 @@
|
||||
#undef WANT_INTERVALS
|
||||
|
||||
/* Define to one to migrate classic to OMNI tests. */
|
||||
#undef WANT_MIGRATION
|
||||
#define WANT_MIGRATION 1
|
||||
|
||||
/* Define to one to include OMNI tests. */
|
||||
#undef WANT_OMNI
|
||||
#define WANT_OMNI 1
|
||||
|
||||
/* Define to one to include SCTP tests. */
|
||||
#undef WANT_SCTP
|
||||
|
25
ports/src/app/netperf/netlib.patch
Normal file
25
ports/src/app/netperf/netlib.patch
Normal file
@ -0,0 +1,25 @@
|
||||
Index: src/netlib.c
|
||||
===================================================================
|
||||
--- src/netlib.c (revision 644)
|
||||
+++ src/netlib.c (working copy)
|
||||
@@ -844,6 +844,10 @@
|
||||
exit(1);
|
||||
}
|
||||
|
||||
+ /* On Genode libc port -1 is returned for sysconf(_SC_NPROCESSORS_ONLN) */
|
||||
+ if (temp_cpus < 0)
|
||||
+ temp_cpus = 1;
|
||||
+
|
||||
return(temp_cpus);
|
||||
|
||||
}
|
||||
@@ -3059,7 +3063,9 @@
|
||||
(which == SEND_BUFFER) ? "SO_SNDBUF" : "SO_RCVBUF",
|
||||
errno);
|
||||
fflush(where);
|
||||
+#ifndef GENODE_BUILD
|
||||
exit(1);
|
||||
+#endif
|
||||
}
|
||||
if (debug > 1) {
|
||||
fprintf(where, "netperf: set_sock_buffer: %s of %d requested.\n",
|
76
ports/src/app/netperf/omni.patch
Normal file
76
ports/src/app/netperf/omni.patch
Normal file
@ -0,0 +1,76 @@
|
||||
Index: src/netserver.c
|
||||
===================================================================
|
||||
--- src/netserver.c (revision 644)
|
||||
+++ src/netserver.c (working copy)
|
||||
@@ -567,7 +567,7 @@
|
||||
int do_inet;
|
||||
int no_name = 0;
|
||||
#ifdef AF_INET6
|
||||
- int do_inet6;
|
||||
+ int do_inet6 = 0;
|
||||
#endif
|
||||
|
||||
if (debug) {
|
||||
Index: src/nettest_omni.c
|
||||
===================================================================
|
||||
--- src/nettest_omni.c (revision 644)
|
||||
+++ src/nettest_omni.c (working copy)
|
||||
@@ -3348,7 +3348,7 @@
|
||||
get_transport_cong_control(SOCKET socket, int protocol, char cong_control[], int len)
|
||||
{
|
||||
#ifdef TCP_CONGESTION
|
||||
- int my_len = len;
|
||||
+ socklen_t my_len = len;
|
||||
if (protocol != IPPROTO_TCP) {
|
||||
strncpy(cong_control,"TCP Only",len);
|
||||
}
|
||||
@@ -3477,7 +3477,7 @@
|
||||
|
||||
struct sockaddr_storage remote_addr;
|
||||
struct sockaddr_storage my_addr;
|
||||
- int remote_addr_len = sizeof(remote_addr);
|
||||
+ netperf_socklen_t remote_addr_len = sizeof(remote_addr);
|
||||
netperf_socklen_t my_addr_len = sizeof(my_addr);
|
||||
|
||||
SOCKET data_socket;
|
||||
@@ -4892,11 +4892,11 @@
|
||||
|
||||
struct sockaddr_storage myaddr_in, peeraddr_in;
|
||||
int peeraddr_set = 0;
|
||||
- SOCKET s_listen, data_socket;
|
||||
+ SOCKET s_listen, data_socket = -1;
|
||||
netperf_socklen_t addrlen;
|
||||
|
||||
- struct ring_elt *send_ring;
|
||||
- struct ring_elt *recv_ring;
|
||||
+ struct ring_elt *send_ring = 0;
|
||||
+ struct ring_elt *recv_ring = 0;
|
||||
|
||||
int timed_out = 0;
|
||||
int pad_time = 0;
|
||||
Index: src/nettest_bsd.h
|
||||
===================================================================
|
||||
--- src/nettest_bsd.h (revision 644)
|
||||
+++ src/nettest_bsd.h (working copy)
|
||||
@@ -617,7 +617,7 @@
|
||||
extern int get_sockaddr_family_addr_port(struct sockaddr_storage *sockaddr,
|
||||
int family,
|
||||
void *addr,
|
||||
- int *port);
|
||||
+ uint32_t *port);
|
||||
extern void send_tcp_mss(char remote_host[]);
|
||||
extern void send_tcp_stream(char remote_host[]);
|
||||
extern void send_tcp_maerts(char remote_host[]);
|
||||
Index: src/nettest_bsd.c
|
||||
===================================================================
|
||||
--- src/nettest_bsd.c (revision 644)
|
||||
+++ src/nettest_bsd.c (working copy)
|
||||
@@ -1066,7 +1066,7 @@
|
||||
|
||||
/* pull the port and address out of the sockaddr in host format */
|
||||
int
|
||||
-get_sockaddr_family_addr_port(struct sockaddr_storage *sockaddr, int family, void *addr, int *port)
|
||||
+get_sockaddr_family_addr_port(struct sockaddr_storage *sockaddr, int family, void *addr, uint32_t *port)
|
||||
{
|
||||
struct sockaddr_in *sin = (struct sockaddr_in *)sockaddr;
|
||||
|
@ -3,10 +3,13 @@ TARGET = netperf
|
||||
CONTRIB_DIR = $(REP_DIR)/contrib/netperf
|
||||
|
||||
LIBS += base libc libm libc-resolv libc-net libc-nameser libc-isc
|
||||
# plugins to libc
|
||||
# plug-in to libc
|
||||
LIBS += libc_log libc_lwip_nic_dhcp config_args
|
||||
|
||||
SRC_C = netserver.c netlib.c netsh.c nettest_bsd.c netcpu_none.c dscp.c
|
||||
SRC_C = netserver.c netlib.c netsh.c nettest_bsd.c dscp.c
|
||||
# omni test
|
||||
SRC_C += nettest_omni.c net_uuid.c
|
||||
SRC_C += netsys_none.c netsec_none.c netdrv_none.c netrt_none.c netslot_none.c netcpu_none.c
|
||||
|
||||
INC_DIR += $(PRG_DIR)
|
||||
CC_OPT += -DHAVE_CONFIG_H -DGENODE_BUILD
|
||||
|
@ -1,5 +1,5 @@
|
||||
--- ../netperf-orig/src/netlib.h 2013-04-19 09:47:05.618940425 +0200
|
||||
+++ src/netlib.h 2013-04-19 09:50:36.042936062 +0200
|
||||
--- src/netlib.h (revision 644)
|
||||
+++ src/netlib.h (working copy)
|
||||
@@ -536,7 +536,11 @@
|
||||
extern void dump_request();
|
||||
extern void dump_addrinfo(FILE *dumploc, struct addrinfo *info,
|
||||
|
Loading…
Reference in New Issue
Block a user