/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(C) 2020 Marvell International Ltd.
*/
+
+#include "test.h"
+
#include <inttypes.h>
#include <signal.h>
#include <stdio.h>
#include <rte_common.h>
#include <rte_cycles.h>
#include <rte_errno.h>
+#ifdef RTE_EXEC_ENV_WINDOWS
+static int
+test_graph_perf_func(void)
+{
+ printf("graph_perf not supported on Windows, skipping test\n");
+ return TEST_SKIPPED;
+}
+
+#else
+
#include <rte_graph.h>
#include <rte_graph_worker.h>
#include <rte_lcore.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
-#include "test.h"
-
#define TEST_GRAPH_PERF_MZ "graph_perf_data"
#define TEST_GRAPH_SRC_NAME "test_graph_perf_source"
#define TEST_GRAPH_SRC_BRST_ONE_NAME "test_graph_perf_source_one"
RTE_SET_USED(graph);
mz = rte_memzone_lookup(TEST_GRAPH_PERF_MZ);
+ if (mz == NULL)
+ return -ENOMEM;
graph_data = mz->addr;
node_data = graph_get_node_data(graph_data, nid);
node->ctx[0] = node->nb_edges;
}
graph_data->graph_id = graph_id;
+ free(node_map);
for (i = 0; i < graph_data->nb_nodes; i++)
free(node_patterns[i]);
free(snk_nodes);
return 0;
pattern_name_free:
+ free(node_map);
for (i = 0; i < graph_data->nb_nodes; i++)
free(node_patterns[i]);
snk_free:
struct test_graph_perf *graph_data;
mz = rte_memzone_lookup(TEST_GRAPH_PERF_MZ);
+ if (mz == NULL)
+ return -ENOMEM;
graph_data = mz->addr;
return measure_perf_get(graph_data->graph_id);
return unit_test_suite_runner(&graph_perf_testsuite);
}
+#endif /* !RTE_EXEC_ENV_WINDOWS */
+
REGISTER_TEST_COMMAND(graph_perf_autotest, test_graph_perf_func);