Page MenuHomeFreeBSD

D38752.id117848.diff
No OneTemporary

D38752.id117848.diff

diff --git a/tools/tools/netmap/lb.c b/tools/tools/netmap/lb.c
--- a/tools/tools/netmap/lb.c
+++ b/tools/tools/netmap/lb.c
@@ -388,7 +388,8 @@
signal(SIGINT, SIG_DFL);
}
-static void usage()
+static void
+usage(void)
{
printf("usage: lb [options]\n");
printf("where options are:\n");
@@ -617,7 +618,6 @@
int ch;
uint32_t i;
int rv;
- unsigned int iter = 0;
int poll_timeout = 10; /* default */
glob_arg.ifname[0] = '\0';
@@ -897,7 +897,6 @@
while (!do_abort) {
u_int polli = 0;
- iter++;
for (i = 0; i < npipes; ++i) {
struct netmap_ring *ring = ports[i].ring;
diff --git a/tools/tools/netmap/nmreplay.c b/tools/tools/netmap/nmreplay.c
--- a/tools/tools/netmap/nmreplay.c
+++ b/tools/tools/netmap/nmreplay.c
@@ -1249,6 +1249,8 @@
err += cmd_apply(delay_cfg, d[i], qs, &qs->c_delay);
err += cmd_apply(bw_cfg, b[i], qs, &qs->c_bw);
err += cmd_apply(loss_cfg, l[i], qs, &qs->c_loss);
+ if (err != 0)
+ exit(1);
}
pthread_create(&bp[0].cons_tid, NULL, nmreplay_main, (void*)&bp[0]);
diff --git a/tools/tools/netmap/pkt-gen.c b/tools/tools/netmap/pkt-gen.c
--- a/tools/tools/netmap/pkt-gen.c
+++ b/tools/tools/netmap/pkt-gen.c
@@ -1306,7 +1306,7 @@
struct targ *targ = (struct targ *) data;
struct pollfd pfd = { .fd = targ->fd, .events = POLLIN };
struct netmap_if *nifp = targ->nmd->nifp;
- int i, m, rx = 0;
+ int i, m;
void *frame;
int size;
struct timespec ts, now, last_print;
@@ -1399,7 +1399,9 @@
}
#endif /* BUSYWAIT */
/* see what we got back */
- rx = 0;
+#ifdef BUSYWAIT
+ int rx = 0;
+#endif
for (i = targ->nmd->first_rx_ring;
i <= targ->nmd->last_rx_ring; i++) {
ring = NETMAP_RXRING(nifp, i);
@@ -1434,7 +1436,9 @@
buckets[pos]++;
/* now store it in a bucket */
ring->head = ring->cur = nm_ring_next(ring, ring->head);
+#ifdef BUSYWAIT
rx++;
+#endif
}
}
//D("tx %d rx %d", sent, rx);
@@ -1502,7 +1506,7 @@
struct pollfd pfd = { .fd = targ->fd, .events = POLLIN };
struct netmap_if *nifp = targ->nmd->nifp;
struct netmap_ring *txring, *rxring;
- int i, rx = 0;
+ int i;
uint64_t sent = 0, n = targ->g->npackets;
if (targ->g->nthreads > 1) {
@@ -1517,6 +1521,7 @@
D("Warning: ping-pong with IPv6 not supported");
}
+ //int rx = 0;
while (!targ->cancel && (n == 0 || sent < n)) {
uint32_t txhead, txavail;
//#define BUSYWAIT
@@ -1544,7 +1549,7 @@
src = NETMAP_BUF(rxring, slot->buf_idx);
//D("got pkt %p of size %d", src, slot->len);
rxring->head = rxring->cur = nm_ring_next(rxring, head);
- rx++;
+ //rx++;
if (txavail == 0)
continue;
dst = NETMAP_BUF(txring,

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 14, 7:32 PM (7 h, 30 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14632841
Default Alt Text
D38752.id117848.diff (2 KB)

Event Timeline