static void
signal_handler(int signum)
{
- int i;
- static uint8_t once;
-
- if ((signum == SIGINT || signum == SIGTERM) && !once) {
- once = true;
+ if (signum == SIGINT || signum == SIGTERM) {
printf("\nSignal %d received, preparing to exit...\n",
signum);
/* request all lcores to exit from the main loop */
*(int *)test->test_priv = true;
rte_wmb();
-
- if (test->ops.ethdev_destroy)
- test->ops.ethdev_destroy(test, &opt);
-
- if (test->ops.cryptodev_destroy)
- test->ops.cryptodev_destroy(test, &opt);
-
- rte_eal_mp_wait_lcore();
-
- if (test->ops.test_result)
- test->ops.test_result(test, &opt);
-
- if (opt.prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) {
- RTE_ETH_FOREACH_DEV(i)
- rte_eth_dev_close(i);
- }
-
- if (test->ops.eventdev_destroy)
- test->ops.eventdev_destroy(test, &opt);
-
- if (test->ops.mempool_destroy)
- test->ops.mempool_destroy(test, &opt);
-
- if (test->ops.test_destroy)
- test->ops.test_destroy(test, &opt);
}
-
- /* exit with the expected status */
- signal(signum, SIG_DFL);
- kill(getpid(), signum);
}
}
}
}
+ if (test->ops.ethdev_rx_stop)
+ test->ops.ethdev_rx_stop(test, &opt);
+
+ if (test->ops.cryptodev_destroy)
+ test->ops.cryptodev_destroy(test, &opt);
+
rte_eal_mp_wait_lcore();
- /* Print the test result */
- ret = test->ops.test_result(test, &opt);
+ if (test->ops.test_result)
+ test->ops.test_result(test, &opt);
+
+ if (test->ops.ethdev_destroy)
+ test->ops.ethdev_destroy(test, &opt);
+
+ if (test->ops.eventdev_destroy)
+ test->ops.eventdev_destroy(test, &opt);
+
+ if (test->ops.mempool_destroy)
+ test->ops.mempool_destroy(test, &opt);
+
+ if (test->ops.test_destroy)
+ test->ops.test_destroy(test, &opt);
+
nocap:
if (ret == EVT_TEST_SUCCESS) {
printf("Result: "CLGRN"%s"CLNRM"\n", "Success");
(struct evt_test *test, struct evt_options *opt);
typedef void (*evt_test_ethdev_destroy_t)
(struct evt_test *test, struct evt_options *opt);
+typedef void (*evt_test_ethdev_rx_stop_t)(struct evt_test *test,
+ struct evt_options *opt);
typedef void (*evt_test_cryptodev_destroy_t)
(struct evt_test *test, struct evt_options *opt);
typedef void (*evt_test_mempool_destroy_t)
evt_test_launch_lcores_t launch_lcores;
evt_test_result_t test_result;
evt_test_eventdev_destroy_t eventdev_destroy;
+ evt_test_ethdev_rx_stop_t ethdev_rx_stop;
evt_test_ethdev_destroy_t ethdev_destroy;
evt_test_cryptodev_destroy_t cryptodev_destroy;
evt_test_mempool_destroy_t mempool_destroy;
.test_setup = perf_test_setup,
.ethdev_setup = perf_ethdev_setup,
.cryptodev_setup = perf_cryptodev_setup,
+ .ethdev_rx_stop = perf_ethdev_rx_stop,
.mempool_setup = perf_mempool_setup,
.eventdev_setup = perf_atq_eventdev_setup,
.launch_lcores = perf_atq_launch_lcores,
return 0;
}
-void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt)
+void
+perf_ethdev_rx_stop(struct evt_test *test, struct evt_options *opt)
{
uint16_t i;
RTE_SET_USED(test);
if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) {
RTE_ETH_FOREACH_DEV(i) {
rte_event_eth_rx_adapter_stop(i);
+ rte_event_eth_rx_adapter_queue_del(i, i, -1);
+ rte_eth_dev_rx_queue_stop(i, 0);
+ }
+ }
+}
+
+void
+perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt)
+{
+ uint16_t i;
+ RTE_SET_USED(test);
+
+ if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) {
+ RTE_ETH_FOREACH_DEV(i) {
+ rte_event_eth_tx_adapter_stop(i);
+ rte_event_eth_tx_adapter_queue_del(i, i, -1);
+ rte_eth_dev_tx_queue_stop(i, 0);
rte_eth_dev_stop(i);
}
}
#include <rte_cryptodev.h>
#include <rte_cycles.h>
#include <rte_ethdev.h>
-#include <rte_eventdev.h>
#include <rte_event_crypto_adapter.h>
#include <rte_event_eth_rx_adapter.h>
+#include <rte_event_eth_tx_adapter.h>
#include <rte_event_timer_adapter.h>
+#include <rte_eventdev.h>
#include <rte_lcore.h>
#include <rte_malloc.h>
#include <rte_mempool.h>
void perf_eventdev_destroy(struct evt_test *test, struct evt_options *opt);
void perf_cryptodev_destroy(struct evt_test *test, struct evt_options *opt);
void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt);
+void perf_ethdev_rx_stop(struct evt_test *test, struct evt_options *opt);
void perf_mempool_destroy(struct evt_test *test, struct evt_options *opt);
#endif /* _TEST_PERF_COMMON_ */
.mempool_setup = perf_mempool_setup,
.ethdev_setup = perf_ethdev_setup,
.cryptodev_setup = perf_cryptodev_setup,
+ .ethdev_rx_stop = perf_ethdev_rx_stop,
.eventdev_setup = perf_queue_eventdev_setup,
.launch_lcores = perf_queue_launch_lcores,
.eventdev_destroy = perf_eventdev_destroy,
.ethdev_setup = pipeline_ethdev_setup,
.eventdev_setup = pipeline_atq_eventdev_setup,
.launch_lcores = pipeline_atq_launch_lcores,
+ .ethdev_rx_stop = pipeline_ethdev_rx_stop,
.eventdev_destroy = pipeline_eventdev_destroy,
.mempool_destroy = pipeline_mempool_destroy,
.ethdev_destroy = pipeline_ethdev_destroy,
return ret;
}
+void
+pipeline_ethdev_rx_stop(struct evt_test *test, struct evt_options *opt)
+{
+ uint16_t i, j;
+ RTE_SET_USED(test);
+
+ if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) {
+ RTE_ETH_FOREACH_DEV(i) {
+ rte_event_eth_rx_adapter_stop(i);
+ rte_event_eth_rx_adapter_queue_del(i, i, -1);
+ for (j = 0; j < opt->eth_queues; j++)
+ rte_eth_dev_rx_queue_stop(i, j);
+ }
+ }
+}
+
void
pipeline_ethdev_destroy(struct evt_test *test, struct evt_options *opt)
{
RTE_SET_USED(opt);
RTE_ETH_FOREACH_DEV(i) {
- rte_event_eth_rx_adapter_stop(i);
rte_event_eth_tx_adapter_stop(i);
+ rte_event_eth_tx_adapter_queue_del(i, i, -1);
+ rte_eth_dev_tx_queue_stop(i, 0);
rte_eth_dev_stop(i);
}
}
#include <rte_cycles.h>
#include <rte_ethdev.h>
-#include <rte_eventdev.h>
#include <rte_event_eth_rx_adapter.h>
#include <rte_event_eth_tx_adapter.h>
+#include <rte_eventdev.h>
#include <rte_lcore.h>
#include <rte_malloc.h>
#include <rte_mempool.h>
#include <rte_prefetch.h>
-#include <rte_spinlock.h>
#include <rte_service.h>
#include <rte_service_component.h>
+#include <rte_spinlock.h>
#include "evt_common.h"
#include "evt_options.h"
void pipeline_test_destroy(struct evt_test *test, struct evt_options *opt);
void pipeline_eventdev_destroy(struct evt_test *test, struct evt_options *opt);
void pipeline_ethdev_destroy(struct evt_test *test, struct evt_options *opt);
+void pipeline_ethdev_rx_stop(struct evt_test *test, struct evt_options *opt);
void pipeline_mempool_destroy(struct evt_test *test, struct evt_options *opt);
#endif /* _TEST_PIPELINE_COMMON_ */
.ethdev_setup = pipeline_ethdev_setup,
.eventdev_setup = pipeline_queue_eventdev_setup,
.launch_lcores = pipeline_queue_launch_lcores,
+ .ethdev_rx_stop = pipeline_ethdev_rx_stop,
.eventdev_destroy = pipeline_eventdev_destroy,
.mempool_destroy = pipeline_mempool_destroy,
.ethdev_destroy = pipeline_ethdev_destroy,