Skip to content

Commit 0b92f9b

Browse files
committed
xdp-trafficgen: Fix exiting after completion of packet send loop
The runners_exited boolean no longer causes the event loop to exit, so xdp-trafficgen will no longer exit if instructed to send a fixed number of packets, after the porting to util/xdp_sample. Instead of setting the boolean, have the packet sender thread send a SIGINT to itself after exiting, which will cause the signal handler in xdp_sample to exit. Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
1 parent 4a73a24 commit 0b92f9b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

xdp-trafficgen/xdp-trafficgen.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ static int mask = SAMPLE_DEVMAP_XMIT_CNT_MULTI | SAMPLE_DROP_OK;
5353
DEFINE_SAMPLE_INIT(xdp_trafficgen);
5454

5555
static bool status_exited = false;
56-
static bool runners_exited = false;
5756

5857
struct udp_packet {
5958
struct ethhdr eth;
@@ -132,7 +131,7 @@ static void *run_traffic(void *arg)
132131
if (err)
133132
pr_warn("Couldn't run trafficgen program: %s\n", strerror(-err));
134133

135-
runners_exited = true;
134+
kill(getpid(), SIGINT);
136135
return NULL;
137136
}
138137

0 commit comments

Comments
 (0)