net/bnxt: fix null dereference in session cleanup
[dpdk.git] / app / test / test_sched.c
index 5e5c2a5..ddec572 100644 (file)
 #include <rte_ether.h>
 #include <rte_ip.h>
 #include <rte_byteorder.h>
-#include <rte_sched.h>
 
+#ifdef RTE_EXEC_ENV_WINDOWS
+static int
+test_sched(void)
+{
+       printf("sched not supported on Windows, skipping test\n");
+       return TEST_SKIPPED;
+}
+#else
+
+#include <rte_sched.h>
 
 #define SUBPORT         0
 #define PIPE            1
 #define TC              2
 #define QUEUE           0
+#define MAX_SCHED_SUBPORT_PROFILES  8
 
 static struct rte_sched_pipe_params pipe_profile[] = {
        { /* Profile #0 */
@@ -36,15 +46,20 @@ static struct rte_sched_pipe_params pipe_profile[] = {
        },
 };
 
-static struct rte_sched_subport_params subport_param[] = {
+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,
@@ -59,6 +74,9 @@ static struct rte_sched_port_params port_param = {
        .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,
 };
 
@@ -195,4 +213,6 @@ test_sched(void)
        return 0;
 }
 
+#endif /* !RTE_EXEC_ENV_WINDOWS */
+
 REGISTER_TEST_COMMAND(sched_autotest, test_sched);