Commit 2f989cb5 authored by Alessandro Rubini's avatar Alessandro Rubini

wrs-socket: decrease the timeout when waiting for a timestamp

Even under load, with queues full, the wrs delays frames less than one ms.

Thus, if we didn't get a timestamp in 1ms, we won't ever get it. Add
some software delay and clearly we don't need 100ms as in current
code.  Please note that all state machines are not running during this
wait, as we are single-process single-thread.

So now we wait for 6ms at most (3 times 2ms at most, but the first
time we may get an older timestamp, then discarded).
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 9250cea8
......@@ -370,10 +370,10 @@ static void poll_tx_timestamp(struct pp_instance *ppi, void *pkt, int len,
pfd.fd = fd;
pfd.events = POLLERR;
#define N_RETRY 5
#define N_RETRY 3
for (retry = 0; retry < N_RETRY; retry++) {
errno = 0;
res = poll(&pfd, 1, 20 /* ms */);
res = poll(&pfd, 1, 2 /* ms */);
if (res < 0 && errno != EAGAIN) {
pp_diag(ppi, time, 1, "%s: poll() = %i (%s)\n",
__func__, res, strerror(errno));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment