diff mbox

[2/5] validation: cls: assign default CoS before creating chain

Message ID 1452622307-18379-3-git-send-email-ivan.khoronzhuk@linaro.org
State New
Headers show

Commit Message

Ivan Khoronzhuk Jan. 12, 2016, 6:11 p.m. UTC
There is no big difference when to assign default CoS to pktio,
but in usual case it's done before creating any chain, if it's
needed to be also checked it can be done in separate test.

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
---
 .../classification/odp_classification_test_pmr.c   | 35 +++++++++++++---------
 1 file changed, 21 insertions(+), 14 deletions(-)
diff mbox

Patch

diff --git a/test/validation/classification/odp_classification_test_pmr.c b/test/validation/classification/odp_classification_test_pmr.c
index 6644b53..75d2a95 100644
--- a/test/validation/classification/odp_classification_test_pmr.c
+++ b/test/validation/classification/odp_classification_test_pmr.c
@@ -166,6 +166,9 @@  void classification_test_pmr_term_tcp_dport(void)
 	retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED);
 	CU_ASSERT(retval == 0);
 
+	configure_default_cos(pktio, &default_cos,
+			      &default_queue, &default_pool);
+
 	match.term = ODP_PMR_TCP_DPORT;
 	match.val = &val;
 	match.mask = &mask;
@@ -193,8 +196,6 @@  void classification_test_pmr_term_tcp_dport(void)
 	retval = odp_pktio_pmr_cos(pmr, pktio, cos);
 	CU_ASSERT(retval == 0);
 
-	configure_default_cos(pktio, &default_cos,
-			      &default_queue, &default_pool);
 	pkt = create_packet(pkt_pool, false, &seq, false);
 	CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID);
 	seqno = cls_pkt_get_seq(pkt);
@@ -275,6 +276,9 @@  void classification_test_pmr_term_tcp_sport(void)
 	retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED);
 	CU_ASSERT(retval == 0);
 
+	configure_default_cos(pktio, &default_cos,
+			      &default_queue, &default_pool);
+
 	match.term = ODP_PMR_TCP_SPORT;
 	match.val = &val;
 	match.mask = &mask;
@@ -301,8 +305,6 @@  void classification_test_pmr_term_tcp_sport(void)
 	retval = odp_pktio_pmr_cos(pmr, pktio, cos);
 	CU_ASSERT(retval == 0);
 
-	configure_default_cos(pktio, &default_cos,
-			      &default_queue, &default_pool);
 	pkt = create_packet(pkt_pool, false, &seq, false);
 	CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID);
 	seqno = cls_pkt_get_seq(pkt);
@@ -381,6 +383,9 @@  void classification_test_pmr_term_udp_dport(void)
 	retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED);
 	CU_ASSERT(retval == 0);
 
+	configure_default_cos(pktio, &default_cos,
+			      &default_queue, &default_pool);
+
 	match.term = ODP_PMR_UDP_DPORT;
 	match.val = &val;
 	match.mask = &mask;
@@ -407,8 +412,6 @@  void classification_test_pmr_term_udp_dport(void)
 	retval = odp_pktio_pmr_cos(pmr, pktio, cos);
 	CU_ASSERT(retval == 0);
 
-	configure_default_cos(pktio, &default_cos,
-			      &default_queue, &default_pool);
 	pkt = create_packet(pkt_pool, false, &seq, true);
 	CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID);
 	seqno = cls_pkt_get_seq(pkt);
@@ -488,6 +491,9 @@  void classification_test_pmr_term_udp_sport(void)
 	retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED);
 	CU_ASSERT(retval == 0);
 
+	configure_default_cos(pktio, &default_cos,
+			      &default_queue, &default_pool);
+
 	match.term = ODP_PMR_UDP_SPORT;
 	match.val = &val;
 	match.mask = &mask;
@@ -514,8 +520,6 @@  void classification_test_pmr_term_udp_sport(void)
 	retval = odp_pktio_pmr_cos(pmr, pktio, cos);
 	CU_ASSERT(retval == 0);
 
-	configure_default_cos(pktio, &default_cos,
-			      &default_queue, &default_pool);
 	pkt = create_packet(pkt_pool, false, &seq, true);
 	CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID);
 	seqno = cls_pkt_get_seq(pkt);
@@ -593,6 +597,9 @@  void classification_test_pmr_term_ipproto(void)
 	retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED);
 	CU_ASSERT(retval == 0);
 
+	configure_default_cos(pktio, &default_cos,
+			      &default_queue, &default_pool);
+
 	match.term = ODP_PMR_IPPROTO;
 	match.val = &val;
 	match.mask = &mask;
@@ -619,8 +626,6 @@  void classification_test_pmr_term_ipproto(void)
 	retval = odp_pktio_pmr_cos(pmr, pktio, cos);
 	CU_ASSERT(retval == 0);
 
-	configure_default_cos(pktio, &default_cos,
-			      &default_queue, &default_pool);
 	pkt = create_packet(pkt_pool, false, &seq, true);
 	CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID);
 	seqno = cls_pkt_get_seq(pkt);
@@ -694,6 +699,9 @@  static void classification_test_pmr_pool_set(void)
 	retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED);
 	CU_ASSERT(retval == 0);
 
+	configure_default_cos(pktio, &default_cos,
+			      &default_queue, &default_pool);
+
 	match.term = ODP_PMR_IPPROTO;
 	match.val = &val;
 	match.mask = &mask;
@@ -727,8 +735,6 @@  static void classification_test_pmr_pool_set(void)
 	retval = odp_pktio_pmr_cos(pmr, pktio, cos);
 	CU_ASSERT(retval == 0);
 
-	configure_default_cos(pktio, &default_cos,
-			      &default_queue, &default_pool);
 	pkt = create_packet(pkt_pool, false, &seq, true);
 	CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID);
 	seqno = cls_pkt_get_seq(pkt);
@@ -788,6 +794,9 @@  static void classification_test_pmr_queue_set(void)
 	retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED);
 	CU_ASSERT(retval == 0);
 
+	configure_default_cos(pktio, &default_cos,
+			      &default_queue, &default_pool);
+
 	match.term = ODP_PMR_IPPROTO;
 	match.val = &val;
 	match.mask = &mask;
@@ -821,8 +830,6 @@  static void classification_test_pmr_queue_set(void)
 	retval = odp_pktio_pmr_cos(pmr, pktio, cos);
 	CU_ASSERT(retval == 0);
 
-	configure_default_cos(pktio, &default_cos,
-			      &default_queue, &default_pool);
 	pkt = create_packet(pkt_pool, false, &seq, true);
 	CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID);
 	seqno = cls_pkt_get_seq(pkt);