From 3cae52c4bfc4de96ccaf5426eb45c5344a8123d3 Mon Sep 17 00:00:00 2001 From: Mykola Yurchenko Date: Sat, 1 Jun 2019 13:49:46 -0500 Subject: [PATCH 1/3] Fix pcap send in speed_tester --- examples/speed_tester/speed_tester.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/speed_tester/speed_tester.c b/examples/speed_tester/speed_tester.c index 2e7e7da98..15fe5b5c9 100644 --- a/examples/speed_tester/speed_tester.c +++ b/examples/speed_tester/speed_tester.c @@ -450,7 +450,7 @@ nf_setup(struct onvm_nf_local_ctx *nf_local_ctx) { pkts[i++] = pkt; pkts_generated++; } - onvm_nflib_return_pkt_bulk(nf_local_ctx->nf_info, pkts, pkts_generated); + onvm_nflib_return_pkt_bulk(nf_local_ctx->nf, pkts, pkts_generated); } else { #endif /* use default number of initial packets if -c has not been used */ From 1d3edfeb7a00b531fee3522f30f97cbd76ab3886 Mon Sep 17 00:00:00 2001 From: Kevin Deems Date: Sun, 2 Jun 2019 16:16:14 -0500 Subject: [PATCH 2/3] Fixed nf cleanup on errors --- examples/speed_tester/speed_tester.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/speed_tester/speed_tester.c b/examples/speed_tester/speed_tester.c index 15fe5b5c9..57e06cb60 100644 --- a/examples/speed_tester/speed_tester.c +++ b/examples/speed_tester/speed_tester.c @@ -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(); @@ -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"); } @@ -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; } From 4587a66677c86c0ec7ed72c81a25627cdb5927e7 Mon Sep 17 00:00:00 2001 From: Kevin Deems Date: Sun, 2 Jun 2019 16:28:41 -0500 Subject: [PATCH 3/3] I know ci will complain --- examples/speed_tester/speed_tester.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/speed_tester/speed_tester.c b/examples/speed_tester/speed_tester.c index 57e06cb60..cb70e594a 100644 --- a/examples/speed_tester/speed_tester.c +++ b/examples/speed_tester/speed_tester.c @@ -328,7 +328,7 @@ 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); } @@ -508,7 +508,7 @@ 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"); }