X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_sched.c;h=ddec5724473e6bb9dfddc5bda131bc9fd1d8ddf5;hb=a2dfcd1ff609f5a4fd3b65774618a35c5c9f73c6;hp=afe0b0765ce3decb00b4523e79807312fc31308f;hpb=0569926caab5e6a8523e507a1f8f0b5014b82881;p=dpdk.git diff --git a/app/test/test_sched.c b/app/test/test_sched.c index afe0b0765c..ddec572447 100644 --- a/app/test/test_sched.c +++ b/app/test/test_sched.c @@ -14,25 +14,23 @@ #include #include #include -#include +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_sched(void) +{ + printf("sched not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} +#else + +#include #define SUBPORT 0 #define PIPE 1 #define TC 2 #define QUEUE 0 - -static struct rte_sched_subport_params subport_param[] = { - { - .tb_rate = 1250000000, - .tb_size = 1000000, - - .tc_rate = {1250000000, 1250000000, 1250000000, 1250000000, - 1250000000, 1250000000, 1250000000, 1250000000, 1250000000, - 1250000000, 1250000000, 1250000000, 1250000000}, - .tc_period = 10, - }, -}; +#define MAX_SCHED_SUBPORT_PROFILES 8 static struct rte_sched_pipe_params pipe_profile[] = { { /* Profile #0 */ @@ -48,17 +46,38 @@ static struct rte_sched_pipe_params pipe_profile[] = { }, }; +static struct rte_sched_subport_profile_params + subport_profile[] = { + { + .tb_rate = 1250000000, + .tb_size = 1000000, + .tc_rate = {1250000000, 1250000000, 1250000000, 1250000000, + 1250000000, 1250000000, 1250000000, 1250000000, 1250000000, + 1250000000, 1250000000, 1250000000, 1250000000}, + .tc_period = 10, + }, +}; + +static struct rte_sched_subport_params subport_param[] = { + { + .n_pipes_per_subport_enabled = 1024, + .qsize = {32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32}, + .pipe_profiles = pipe_profile, + .n_pipe_profiles = 1, + .n_max_pipe_profiles = 1, + }, +}; + static struct rte_sched_port_params port_param = { .socket = 0, /* computed */ .rate = 0, /* computed */ .mtu = 1522, .frame_overhead = RTE_SCHED_FRAME_OVERHEAD_DEFAULT, .n_subports_per_port = 1, + .n_subport_profiles = 1, + .subport_profiles = subport_profile, + .n_max_subport_profiles = MAX_SCHED_SUBPORT_PROFILES, .n_pipes_per_subport = 1024, - .qsize = {32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32}, - .pipe_profiles = pipe_profile, - .n_pipe_profiles = 1, - .n_max_pipe_profiles = 1, }; #define NB_MBUF 32 @@ -137,10 +156,10 @@ test_sched(void) port = rte_sched_port_config(&port_param); TEST_ASSERT_NOT_NULL(port, "Error config sched port\n"); - err = rte_sched_subport_config(port, SUBPORT, subport_param); + err = rte_sched_subport_config(port, SUBPORT, subport_param, 0); TEST_ASSERT_SUCCESS(err, "Error config sched, err=%d\n", err); - for (pipe = 0; pipe < port_param.n_pipes_per_subport; pipe ++) { + for (pipe = 0; pipe < subport_param[0].n_pipes_per_subport_enabled; pipe++) { err = rte_sched_pipe_config(port, SUBPORT, pipe, 0); TEST_ASSERT_SUCCESS(err, "Error config sched pipe %u, err=%d\n", pipe, err); } @@ -194,4 +213,6 @@ test_sched(void) return 0; } +#endif /* !RTE_EXEC_ENV_WINDOWS */ + REGISTER_TEST_COMMAND(sched_autotest, test_sched);