Skip to content

Commit 2dd28d3

Browse files
committed
neper: support --source-port with udp
Move the flag definion from tcp only to all sockets. Tested that it works with udp_stream.
1 parent 525f431 commit 2dd28d3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

define_all_flags.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ struct flags_parser *add_flags_common(struct flags_parser *fp)
3232
DEFINE_FLAG(fp, int, num_clients, 1, 0, "Number of clients");
3333
DEFINE_FLAG(fp, int, listen_backlog, 128, 0, "Backlog size for listen()");
3434
DEFINE_FLAG(fp, int, suicide_length, 0, 's', "Suicide length in seconds");
35+
DEFINE_FLAG(fp, int, source_port, -1, 0, "Sender (source) data port. First data stream will use this port, each next stream will use port one larger than previous one. When not specified, kernel assigns free source ports.");
3536
DEFINE_FLAG(fp, bool, stime_use_proc,false, 'S', "Use global system+IRQ+SoftIRQ time from /proc/stat in place of getrusage ru_stime value. Should only be used on otherwise idle systems or with high workloads!");
3637
DEFINE_FLAG(fp, bool, ipv4, false, '4', "Set desired address family to AF_INET");
3738
DEFINE_FLAG(fp, bool, ipv6, false, '6', "Set desired address family to AF_INET6");
@@ -62,7 +63,6 @@ struct flags_parser *add_flags_tcp(struct flags_parser *fp)
6263
/* Define flags common to all TCP main programs */
6364
DEFINE_FLAG(fp, int, num_ports, 1, 0, "Number of server data ports");
6465
DEFINE_FLAG(fp, bool, tcp_fastopen, false, 'X', "Enable TCP fastopen");
65-
DEFINE_FLAG(fp, int, source_port, -1, 0, "Sender (source) data port. First data stream will use this port, each next stream will use port one larger than previous one. When not specified, kernel assigns free source ports.");
6666
#ifndef NO_LIBNUMA
6767
DEFINE_FLAG(fp, bool, pin_numa, false, 'N', "Pin threads to CPU cores");
6868
#endif

lib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ struct options {
9595
const char *host;
9696
const char *control_port;
9797
const char *port;
98-
int source_port; /* Be aware: undefined in all udp_ variants! */
98+
int source_port;
9999
const char *all_samples;
100100
const char secret[32]; /* includes test name */
101101
bool async_connect;

0 commit comments

Comments
 (0)