Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions examples/speed_tester/speed_tester.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,10 @@ run_advanced_rings(struct onvm_nf_local_ctx *nf_local_ctx) {

/* Set core affinity depending on what we got from mgr */
/* TODO as this is advanced ring mode it should have access to the core info struct */
if (onvm_threading_core_affinitize(nf->thread_info.core) < 0)
if (onvm_threading_core_affinitize(nf->thread_info.core) < 0) {
onvm_nflib_stop(nf_local_ctx);
rte_exit(EXIT_FAILURE, "Failed to affinitize to core %d\n", nf->thread_info.core);
}

printf("Process %d handling packets using advanced rings\n", nf->instance_id);
start_time = rte_get_tsc_cycles();
Expand Down Expand Up @@ -416,6 +418,7 @@ nf_setup(struct onvm_nf_local_ctx *nf_local_ctx) {
pcap = pcap_open_offline(pcap_filename, errbuf);
if (pcap == NULL) {
fprintf(stderr, "Error reading pcap file: %s\n", errbuf);
onvm_nflib_stop(nf_local_ctx);
rte_exit(EXIT_FAILURE, "Cannot open pcap file\n");
}

Expand Down Expand Up @@ -505,8 +508,10 @@ nf_setup(struct onvm_nf_local_ctx *nf_local_ctx) {
}
#endif
/* Exit if packets were unexpectedly not created */
if (pkts_generated == 0 && packet_number > 0)
if (pkts_generated == 0 && packet_number > 0) {
onvm_nflib_stop(nf_local_ctx);
rte_exit(EXIT_FAILURE, "Failed to create packets\n");
}

packet_number = pkts_generated;
}
Expand Down