Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106061015
D30266.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D30266.diff
View Options
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
@@ -1816,6 +1816,7 @@
struct netmap_ring *rxring;
int i;
struct my_ctrs cur;
+ uint64_t n = targ->g->npackets / targ->g->nthreads;
memset(&cur, 0, sizeof(cur));
@@ -1843,7 +1844,7 @@
/* main loop, exit after 1s silence */
clock_gettime(CLOCK_REALTIME_PRECISE, &targ->tic);
if (targ->g->dev_type == DEV_TAP) {
- while (!targ->cancel) {
+ while (!targ->cancel && (n == 0 || targ->ctr.pkts < n)) {) {
char buf[MAX_BODYSIZE];
/* XXX should we poll ? */
i = read(targ->g->main_fd, buf, sizeof(buf));
@@ -1855,7 +1856,7 @@
}
#ifndef NO_PCAP
} else if (targ->g->dev_type == DEV_PCAP) {
- while (!targ->cancel) {
+ while (!targ->cancel && (n == 0 || targ->ctr.pkts < n)) {
/* XXX should we poll ? */
pcap_dispatch(targ->g->p, targ->g->burst, receive_pcap,
(u_char *)&targ->ctr);
@@ -1866,7 +1867,7 @@
int dump = targ->g->options & OPT_DUMP;
nifp = targ->nmd->nifp;
- while (!targ->cancel) {
+ while (!targ->cancel && (n == 0 || targ->ctr.pkts < n)) {
/* Once we started to receive packets, wait at most 1 seconds
before quitting. */
#ifdef BUSYWAIT
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 5:41 PM (11 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15597573
Default Alt Text
D30266.diff (1 KB)
Attached To
Mode
D30266: pkt-gen: Allow limiting received packets
Attached
Detach File
Event Timeline
Log In to Comment