summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2012-08-08 19:15:01 +0000
committeremaste <emaste@FreeBSD.org>2012-08-08 19:15:01 +0000
commite3d2617c9b2f72a9866a4471d1c29c0cc0f61644 (patch)
tree4ebf2cebad99ed4a32483b0aad3f9e5d7fcdd26c /tools
parent1587b88eabc352f9e53d8451bd36a138d889e85e (diff)
downloadFreeBSD-src-e3d2617c9b2f72a9866a4471d1c29c0cc0f61644.zip
FreeBSD-src-e3d2617c9b2f72a9866a4471d1c29c0cc0f61644.tar.gz
Be more descriptive about poll error / timeout when transmitting.
Diffstat (limited to 'tools')
-rw-r--r--tools/tools/netmap/pkt-gen.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/tools/netmap/pkt-gen.c b/tools/tools/netmap/pkt-gen.c
index 4994e1d..4aa09d3 100644
--- a/tools/tools/netmap/pkt-gen.c
+++ b/tools/tools/netmap/pkt-gen.c
@@ -468,13 +468,14 @@ static void *
sender_body(void *data)
{
struct targ *targ = (struct targ *) data;
-
struct pollfd fds[1];
struct netmap_if *nifp = targ->nifp;
struct netmap_ring *txring;
int i, pkts_per_td = targ->g->npackets / targ->g->nthreads, sent = 0;
int continuous = 0;
int options = targ->g->options | OPT_COPY;
+ int retval;
+
D("start");
if (pkts_per_td == 0) {
continuous = 1;
@@ -508,10 +509,14 @@ D("start");
/*
* wait for available room in the send queue(s)
*/
- if (poll(fds, 1, 2000) <= 0) {
+ if ((retval = poll(fds, 1, 2000)) <= 0) {
if (targ->cancel)
break;
- D("poll error/timeout on queue %d\n", targ->me);
+ if (retval == 0)
+ D("poll timeout on queue %d\n", targ->me);
+ else
+ D("poll error on queue %d: %s\n", targ->me,
+ strerror(errno));
goto quit;
}
/*
OpenPOWER on IntegriCloud