aboutsummaryrefslogtreecommitdiff
path: root/test/validation
diff options
context:
space:
mode:
authorNithin Dabilpuram <ndabilpuram@marvell.com>2021-07-06 22:21:37 +0530
committerMatias Elo <matias.elo@nokia.com>2021-07-14 10:21:58 +0300
commit0fc587ed64131ba22dc8875b75006ebfe08ac52f (patch)
tree527dfdd00698c0968f04d4b5717756a6f061eeed /test/validation
parent6ac3bff45c209c30be9f023c3faa8c57cd69a209 (diff)
validation: tm: use pkt priority mode supported by platform
Use pkt priority mode supported by a given platform for TM systems. Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
Diffstat (limited to 'test/validation')
-rw-r--r--test/validation/api/traffic_mngr/traffic_mngr.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/validation/api/traffic_mngr/traffic_mngr.c b/test/validation/api/traffic_mngr/traffic_mngr.c
index f9dcd04d0..e2f53b6db 100644
--- a/test/validation/api/traffic_mngr/traffic_mngr.c
+++ b/test/validation/api/traffic_mngr/traffic_mngr.c
@@ -388,6 +388,7 @@ static int test_overall_capabilities(void)
odp_tm_capabilities_t capabilities_array[2];
odp_tm_capabilities_t *cap_ptr;
odp_tm_egress_t egress;
+ odp_bool_t *prio_modes;
uint32_t num_records, idx, num_levels, level;
int rc;
@@ -443,6 +444,11 @@ static int test_overall_capabilities(void)
return -1;
}
}
+
+ /* At least one pkt priority mode needs to be supported */
+ prio_modes = cap_ptr->pkt_prio_modes;
+ CU_ASSERT((prio_modes[ODP_TM_PKT_PRIO_MODE_PRESERVE] != 0) ||
+ (prio_modes[ODP_TM_PKT_PRIO_MODE_OVERWRITE] != 0))
}
return 0;
@@ -1436,6 +1442,9 @@ static tm_node_desc_t *create_tm_node(odp_tm_t odp_tm,
node_params.max_fanin = FANIN_RATIO;
node_params.level = level;
+ /* This is ignored when pkt priority mode is not overwrite */
+ node_params.priority = 0;
+
if (parent_node_desc == NULL)
snprintf(node_name, sizeof(node_name), "node_%" PRIu32,
node_idx + 1);
@@ -1679,6 +1688,16 @@ set_reqs_based_on_capas(odp_tm_requirements_t *req)
if (tm_capabilities.tm_queue_shaper_supported)
req->tm_queue_shaper_needed = true;
+
+ /* We can use any packet priority mode since it does not affect
+ * our tests. Our scheduler test tests scheduling only in a node
+ * directly connected to TM queues and such nodes see the original
+ * packet priority before it could have been overwritten by any node.
+ */
+ req->pkt_prio_mode = ODP_TM_PKT_PRIO_MODE_PRESERVE;
+ if (!tm_capabilities.pkt_prio_modes[ODP_TM_PKT_PRIO_MODE_PRESERVE])
+ req->pkt_prio_mode = ODP_TM_PKT_PRIO_MODE_OVERWRITE;
+
}
static int create_tm_system(void)