Index: tools/tools/netmap/pkt-gen.c =================================================================== --- tools/tools/netmap/pkt-gen.c +++ tools/tools/netmap/pkt-gen.c @@ -169,7 +169,7 @@ int pkt_size; int burst; int forever; - int npackets; /* total packets to send */ + uint32_t npackets; /* total packets to send */ int frags; /* fragments per packet */ int nthreads; int cpus; @@ -810,10 +810,10 @@ struct targ *targ = (struct targ *) data; struct pollfd pfd = { .fd = targ->fd, .events = POLLIN }; struct netmap_if *nifp = targ->nmd->nifp; - int i, rx = 0, n = targ->g->npackets; + int i, rx = 0; void *frame; int size; - uint32_t sent = 0; + uint32_t sent = 0, n = targ->g->npackets; struct timespec ts, now, last_print; uint32_t count = 0, min = 1000000000, av = 0; @@ -828,7 +828,7 @@ clock_gettime(CLOCK_REALTIME_PRECISE, &last_print); now = last_print; - while (n == 0 || (int)sent < n) { + while (n == 0 || sent < n) { struct netmap_ring *ring = NETMAP_TXRING(nifp, 0); struct netmap_slot *slot; char *p; @@ -919,7 +919,8 @@ struct pollfd pfd = { .fd = targ->fd, .events = POLLIN }; struct netmap_if *nifp = targ->nmd->nifp; struct netmap_ring *txring, *rxring; - int i, rx = 0, sent = 0, n = targ->g->npackets; + int i, rx = 0; + uint32_t sent = 0, n = targ->g->npackets; if (targ->g->nthreads > 1) { D("can only reply ping with 1 thread"); @@ -1066,7 +1067,8 @@ struct pollfd pfd = { .fd = targ->fd, .events = POLLOUT }; struct netmap_if *nifp; struct netmap_ring *txring; - int i, n = targ->g->npackets / targ->g->nthreads; + int i; + uint32_t n = targ->g->npackets / targ->g->nthreads; int64_t sent = 0; int options = targ->g->options | OPT_COPY; struct timespec nexttime = { 0, 0}; // XXX silence compiler