Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,5 @@ jobs:
run: ./configure
- name: make
run: make
- name: start localhost server
run: ./src/uperf -s &
- name: start localhost server for vsock
run: ./src/uperf -s -S vsock &
- name: make check
run: make check
9 changes: 9 additions & 0 deletions src/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,15 @@ set_tcp_options(int fd, flowop_options_t *f)
}
#else
uperf_warn("Configuring TCP stack not supported");
#endif
}
if (f && f->bblog > 0) {
#ifdef TCP_LOG
if (setsockopt(fd, IPPROTO_TCP, TCP_LOG, &(f->bblog), sizeof (f->bblog)) < 0) {
ulog_warn("Cannot set TCP_LOG:");
}
#else
uperf_warn("Configuring TCP black box logging not supported");
#endif
}
}
4 changes: 2 additions & 2 deletions src/hwcounter.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ typedef struct {
int init_status;
}hwcounter_t;

int hwcounter_init();
int hwcounter_fini();
int hwcounter_init(void);
int hwcounter_fini(hwcounter_t *));
int hwcounter_validate_events(char *, char *);
int hwcounter_finilwp(hwcounter_t *);
int hwcounter_snap(hwcounter_t *, int);
Expand Down
12 changes: 12 additions & 0 deletions src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,18 @@ parse_option(char *option, flowop_t *flowop)
strlcpy(flowop->options.cc, value, sizeof(flowop->options.cc));
} else if (strcasecmp(key, "stack") == 0) {
strlcpy(flowop->options.stack, value, sizeof(flowop->options.stack));
} else if (strcasecmp(key, "bblog") == 0) {
int res;

res = string2int(value);
if (res >= 0) {
flowop->options.bblog = res;
} else {
snprintf(err, sizeof(err),
"Cannot understand bblog:%s", value);
add_error(err);
return (UPERF_FAILURE);
}
}
#ifdef HAVE_SCTP
else if (strcasecmp(key, "sctp_rto_min") == 0) {
Expand Down
7 changes: 7 additions & 0 deletions src/shm.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
#ifndef _SHM_H
#define _SHM_H

#ifdef HAVE_STDATOMIC_H
#include <stdatomic.h>
#endif /* HAVE_STDATOMIC_H */
#include "logging.h"
#include "sync.h"
#include "workorder.h"
Expand Down Expand Up @@ -75,7 +78,11 @@ struct uperf_shm {
uperf_log_t log;
int global_error;
uint32_t sstate1[NUM_STATES];
#ifdef HAVE_STDATOMIC_H
atomic_uint finished;
#else
uint32_t finished;
#endif /* HAVE_STDATOMIC_H */
int cleaned_up;

/* callouts */
Expand Down
7 changes: 7 additions & 0 deletions src/sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#ifndef _SYNC_H
#define _SYNC_H

#ifdef HAVE_STDATOMIC_H
#include <stdatomic.h>
#endif /* HAVE_STDATOMIC_H */
#include <pthread.h>

#define BARRIER_REACHED(a) !barrier_notreached((a))
Expand All @@ -36,7 +39,11 @@ typedef struct sync_barrier {
pthread_mutexattr_t count_mtx_attr;
pthread_mutex_t count_mutex;
#endif /* HAVE_ATOMIC_H && HAVE_STDATOMIC_H */
#ifdef HAVE_STDATOMIC_H
atomic_uint count;
#else
volatile unsigned int count;
#endif /* HAVE_STDATOMIC_H */
volatile unsigned int limit;
int group;
int txn;
Expand Down
1 change: 1 addition & 0 deletions src/workorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ struct flowop_options {
uint64_t count; /* Flowop execute Count */
uint64_t poll_timeout; /* In nanoseconds */
uint32_t encaps_port; /* Port used for UDP encapsulation */
uint32_t bblog; /* TCP black box logging */
uint32_t sctp_rto_min; /* Minimum SCTP RTO */
uint32_t sctp_rto_max; /* Maximum SCTP RTO */
uint32_t sctp_rto_initial; /* Initial SCTP RTO */
Expand Down
19 changes: 18 additions & 1 deletion tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,24 @@ if [[ "$profile" == *".vsock.xml" ]]; then
fi
fi

# Start server
serverpid=""
if pgrep uperf ; then
echo "uperf server already running; please stop it and try again"
exit
else
echo "Starting server - $uperf -s $csocket"
$uperf -s $csocket &
serverpid=$!
fi

echo h=$host duration=10s $uperf $csocket -m $profile >>log
h=$host duration=10s $uperf $csocket -m $profile >> log 2>&1
exitstatus=$?


# kill server
if [[ serverpid != "" ]] ; then
echo "Killing $serverpid"
kill -9 $serverpid
fi
exit $exitstatus