Re: [lng-odp] [PATCH 3/5] validation: cls: test_pmr: don't create default input queue
The reason for default input queue is coz thats how linux generic pktio works and as you said when running the same tests on HW the default input queue will be ignored and the packet will be processed correctly. Regards, Bala Regards, Bala On 14 January 2016 at 13:15, Ivan Khoronzhuk wrote: > > On 14.01.16 07:52, Bala Manoharan wrote: >> >> This patch does not apply maybe you need to rebase to HEAD. >> >> Regards, >> Bala >> Regards, >> Bala >> > I will re-base, but this patch still has questions. > Like, do we need to assign default input queue if it's not supposed to be > used > and completely replaced by default CoS? Also, seems I forgot to start pktio > afterwards. > But when I started it, I see that linux-generic implementation doesn't pass > the test, strange. > What is going on? My board passes it correctly. > > >> >> On 12 January 2016 at 23:41, Ivan Khoronzhuk >> wrote: >>> >>> There is no need to create default input queue for pktio if >>> default CoS is assigned. >>> >>> Signed-off-by: Ivan Khoronzhuk >>> --- >>> .../classification/odp_classification_test_pmr.c | 54 >>> -- >>> 1 file changed, 54 deletions(-) >>> >>> diff --git a/test/validation/classification/odp_classification_test_pmr.c >>> b/test/validation/classification/odp_classification_test_pmr.c >>> index 75d2a95..0b3f279 100644 >>> --- a/test/validation/classification/odp_classification_test_pmr.c >>> +++ b/test/validation/classification/odp_classification_test_pmr.c >>> @@ -55,39 +55,6 @@ odp_pktio_t create_pktio(odp_queue_type_t q_type) >>> return pktio; >>> } >>> >>> -int create_default_inq(odp_pktio_t pktio, odp_queue_type_t qtype) >>> -{ >>> - odp_queue_param_t qparam; >>> - odp_queue_t inq_def; >>> - char inq_name[ODP_QUEUE_NAME_LEN]; >>> - >>> - odp_queue_param_init(&qparam); >>> - qparam.sched.prio = ODP_SCHED_PRIO_DEFAULT; >>> - qparam.sched.sync = ODP_SCHED_SYNC_ATOMIC; >>> - qparam.sched.group = ODP_SCHED_GROUP_ALL; >>> - >>> - snprintf(inq_name, sizeof(inq_name), "inq-pktio-%" PRIu64, >>> -odp_pktio_to_u64(pktio)); >>> - inq_def = odp_queue_lookup(inq_name); >>> - if (inq_def == ODP_QUEUE_INVALID) >>> - inq_def = odp_queue_create( >>> - inq_name, >>> - ODP_QUEUE_TYPE_PKTIN, >>> - qtype == ODP_QUEUE_TYPE_POLL ? NULL : >>> &qparam); >>> - >>> - CU_ASSERT_FATAL(inq_def != ODP_QUEUE_INVALID); >>> - >>> - if (0 > odp_pktio_inq_setdef(pktio, inq_def)) >>> - return -1; >>> - >>> - if (odp_pktio_start(pktio)) { >>> - fprintf(stderr, "unable to start loop\n"); >>> - return -1; >>> - } >>> - >>> - return 0; >>> -} >>> - >>> void configure_default_cos(odp_pktio_t pktio, odp_cos_t *cos, >>> odp_queue_t *queue, odp_pool_t *pool) >>> { >>> @@ -163,8 +130,6 @@ void classification_test_pmr_term_tcp_dport(void) >>> >>> pktio = create_pktio(ODP_QUEUE_TYPE_SCHED); >>> CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); >>> - retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED); >>> - CU_ASSERT(retval == 0); >>> >>> configure_default_cos(pktio, &default_cos, >>>&default_queue, &default_pool); >>> @@ -237,7 +202,6 @@ void classification_test_pmr_term_tcp_dport(void) >>> odp_cos_destroy(cos); >>> odp_cos_destroy(default_cos); >>> odp_pmr_destroy(pmr); >>> - destroy_inq(pktio); >>> odp_queue_destroy(queue); >>> odp_queue_destroy(default_queue); >>> odp_pool_destroy(pool); >>> @@ -273,8 +237,6 @@ void classification_test_pmr_term_tcp_sport(void) >>> >>> pktio = create_pktio(ODP_QUEUE_TYPE_SCHED); >>> CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); >>> - retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED); >>> - CU_ASSERT(retval == 0); >>> >>> configure_default_cos(pktio, &default_cos, >>>&default_queue, &default_pool); >>> @@ -344,7 +306,6 @@ void classification_test_pmr_term_tcp_sport(void) >>> odp_cos_destroy(cos); >>> odp_cos_destroy(default_cos); >>> odp_pmr_destroy(pmr); >>> - destroy_inq(pktio); >>> odp_pool_destroy(default_pool); >>> odp_pool_destroy(pool); >>> odp_queue_destroy(queue); >>> @@ -380,8 +341,6 @@ void classification_test_pmr_term_udp_dport(void) >>> >>> pktio = create_pktio(ODP_QUEUE_TYPE_SCHED); >>> CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); >>> - retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED); >>> - CU_ASSERT(retval == 0); >>> >>> configure_default_cos(pktio, &default_cos, >>>&default_queue, &default_pool); >>> @@ -452,7 +411,6 @@ void classification_test_pmr_term_
Re: [lng-odp] [PATCH 3/5] validation: cls: test_pmr: don't create default input queue
On 14.01.16 07:52, Bala Manoharan wrote: This patch does not apply maybe you need to rebase to HEAD. Regards, Bala Regards, Bala I will re-base, but this patch still has questions. Like, do we need to assign default input queue if it's not supposed to be used and completely replaced by default CoS? Also, seems I forgot to start pktio afterwards. But when I started it, I see that linux-generic implementation doesn't pass the test, strange. What is going on? My board passes it correctly. On 12 January 2016 at 23:41, Ivan Khoronzhuk wrote: There is no need to create default input queue for pktio if default CoS is assigned. Signed-off-by: Ivan Khoronzhuk --- .../classification/odp_classification_test_pmr.c | 54 -- 1 file changed, 54 deletions(-) diff --git a/test/validation/classification/odp_classification_test_pmr.c b/test/validation/classification/odp_classification_test_pmr.c index 75d2a95..0b3f279 100644 --- a/test/validation/classification/odp_classification_test_pmr.c +++ b/test/validation/classification/odp_classification_test_pmr.c @@ -55,39 +55,6 @@ odp_pktio_t create_pktio(odp_queue_type_t q_type) return pktio; } -int create_default_inq(odp_pktio_t pktio, odp_queue_type_t qtype) -{ - odp_queue_param_t qparam; - odp_queue_t inq_def; - char inq_name[ODP_QUEUE_NAME_LEN]; - - odp_queue_param_init(&qparam); - qparam.sched.prio = ODP_SCHED_PRIO_DEFAULT; - qparam.sched.sync = ODP_SCHED_SYNC_ATOMIC; - qparam.sched.group = ODP_SCHED_GROUP_ALL; - - snprintf(inq_name, sizeof(inq_name), "inq-pktio-%" PRIu64, -odp_pktio_to_u64(pktio)); - inq_def = odp_queue_lookup(inq_name); - if (inq_def == ODP_QUEUE_INVALID) - inq_def = odp_queue_create( - inq_name, - ODP_QUEUE_TYPE_PKTIN, - qtype == ODP_QUEUE_TYPE_POLL ? NULL : &qparam); - - CU_ASSERT_FATAL(inq_def != ODP_QUEUE_INVALID); - - if (0 > odp_pktio_inq_setdef(pktio, inq_def)) - return -1; - - if (odp_pktio_start(pktio)) { - fprintf(stderr, "unable to start loop\n"); - return -1; - } - - return 0; -} - void configure_default_cos(odp_pktio_t pktio, odp_cos_t *cos, odp_queue_t *queue, odp_pool_t *pool) { @@ -163,8 +130,6 @@ void classification_test_pmr_term_tcp_dport(void) pktio = create_pktio(ODP_QUEUE_TYPE_SCHED); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED); - CU_ASSERT(retval == 0); configure_default_cos(pktio, &default_cos, &default_queue, &default_pool); @@ -237,7 +202,6 @@ void classification_test_pmr_term_tcp_dport(void) odp_cos_destroy(cos); odp_cos_destroy(default_cos); odp_pmr_destroy(pmr); - destroy_inq(pktio); odp_queue_destroy(queue); odp_queue_destroy(default_queue); odp_pool_destroy(pool); @@ -273,8 +237,6 @@ void classification_test_pmr_term_tcp_sport(void) pktio = create_pktio(ODP_QUEUE_TYPE_SCHED); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED); - CU_ASSERT(retval == 0); configure_default_cos(pktio, &default_cos, &default_queue, &default_pool); @@ -344,7 +306,6 @@ void classification_test_pmr_term_tcp_sport(void) odp_cos_destroy(cos); odp_cos_destroy(default_cos); odp_pmr_destroy(pmr); - destroy_inq(pktio); odp_pool_destroy(default_pool); odp_pool_destroy(pool); odp_queue_destroy(queue); @@ -380,8 +341,6 @@ void classification_test_pmr_term_udp_dport(void) pktio = create_pktio(ODP_QUEUE_TYPE_SCHED); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED); - CU_ASSERT(retval == 0); configure_default_cos(pktio, &default_cos, &default_queue, &default_pool); @@ -452,7 +411,6 @@ void classification_test_pmr_term_udp_dport(void) odp_cos_destroy(cos); odp_cos_destroy(default_cos); odp_pmr_destroy(pmr); - destroy_inq(pktio); odp_queue_destroy(queue); odp_queue_destroy(default_queue); odp_pool_destroy(default_pool); @@ -488,8 +446,6 @@ void classification_test_pmr_term_udp_sport(void) pktio = create_pktio(ODP_QUEUE_TYPE_SCHED); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED); - CU_ASSERT(retval == 0); configure_default_cos(pktio, &default_cos, &default_queue, &default_pool); @@ -559,7 +515,6 @@ void classification_test_pmr_term_udp_sport(void)
Re: [lng-odp] [PATCH 3/5] validation: cls: test_pmr: don't create default input queue
This patch does not apply maybe you need to rebase to HEAD. Regards, Bala Regards, Bala On 12 January 2016 at 23:41, Ivan Khoronzhuk wrote: > There is no need to create default input queue for pktio if > default CoS is assigned. > > Signed-off-by: Ivan Khoronzhuk > --- > .../classification/odp_classification_test_pmr.c | 54 > -- > 1 file changed, 54 deletions(-) > > diff --git a/test/validation/classification/odp_classification_test_pmr.c > b/test/validation/classification/odp_classification_test_pmr.c > index 75d2a95..0b3f279 100644 > --- a/test/validation/classification/odp_classification_test_pmr.c > +++ b/test/validation/classification/odp_classification_test_pmr.c > @@ -55,39 +55,6 @@ odp_pktio_t create_pktio(odp_queue_type_t q_type) > return pktio; > } > > -int create_default_inq(odp_pktio_t pktio, odp_queue_type_t qtype) > -{ > - odp_queue_param_t qparam; > - odp_queue_t inq_def; > - char inq_name[ODP_QUEUE_NAME_LEN]; > - > - odp_queue_param_init(&qparam); > - qparam.sched.prio = ODP_SCHED_PRIO_DEFAULT; > - qparam.sched.sync = ODP_SCHED_SYNC_ATOMIC; > - qparam.sched.group = ODP_SCHED_GROUP_ALL; > - > - snprintf(inq_name, sizeof(inq_name), "inq-pktio-%" PRIu64, > -odp_pktio_to_u64(pktio)); > - inq_def = odp_queue_lookup(inq_name); > - if (inq_def == ODP_QUEUE_INVALID) > - inq_def = odp_queue_create( > - inq_name, > - ODP_QUEUE_TYPE_PKTIN, > - qtype == ODP_QUEUE_TYPE_POLL ? NULL : > &qparam); > - > - CU_ASSERT_FATAL(inq_def != ODP_QUEUE_INVALID); > - > - if (0 > odp_pktio_inq_setdef(pktio, inq_def)) > - return -1; > - > - if (odp_pktio_start(pktio)) { > - fprintf(stderr, "unable to start loop\n"); > - return -1; > - } > - > - return 0; > -} > - > void configure_default_cos(odp_pktio_t pktio, odp_cos_t *cos, >odp_queue_t *queue, odp_pool_t *pool) > { > @@ -163,8 +130,6 @@ void classification_test_pmr_term_tcp_dport(void) > > pktio = create_pktio(ODP_QUEUE_TYPE_SCHED); > CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); > - retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED); > - CU_ASSERT(retval == 0); > > configure_default_cos(pktio, &default_cos, > &default_queue, &default_pool); > @@ -237,7 +202,6 @@ void classification_test_pmr_term_tcp_dport(void) > odp_cos_destroy(cos); > odp_cos_destroy(default_cos); > odp_pmr_destroy(pmr); > - destroy_inq(pktio); > odp_queue_destroy(queue); > odp_queue_destroy(default_queue); > odp_pool_destroy(pool); > @@ -273,8 +237,6 @@ void classification_test_pmr_term_tcp_sport(void) > > pktio = create_pktio(ODP_QUEUE_TYPE_SCHED); > CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); > - retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED); > - CU_ASSERT(retval == 0); > > configure_default_cos(pktio, &default_cos, > &default_queue, &default_pool); > @@ -344,7 +306,6 @@ void classification_test_pmr_term_tcp_sport(void) > odp_cos_destroy(cos); > odp_cos_destroy(default_cos); > odp_pmr_destroy(pmr); > - destroy_inq(pktio); > odp_pool_destroy(default_pool); > odp_pool_destroy(pool); > odp_queue_destroy(queue); > @@ -380,8 +341,6 @@ void classification_test_pmr_term_udp_dport(void) > > pktio = create_pktio(ODP_QUEUE_TYPE_SCHED); > CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); > - retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED); > - CU_ASSERT(retval == 0); > > configure_default_cos(pktio, &default_cos, > &default_queue, &default_pool); > @@ -452,7 +411,6 @@ void classification_test_pmr_term_udp_dport(void) > odp_cos_destroy(cos); > odp_cos_destroy(default_cos); > odp_pmr_destroy(pmr); > - destroy_inq(pktio); > odp_queue_destroy(queue); > odp_queue_destroy(default_queue); > odp_pool_destroy(default_pool); > @@ -488,8 +446,6 @@ void classification_test_pmr_term_udp_sport(void) > > pktio = create_pktio(ODP_QUEUE_TYPE_SCHED); > CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); > - retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED); > - CU_ASSERT(retval == 0); > > configure_default_cos(pktio, &default_cos, > &default_queue, &default_pool); > @@ -559,7 +515,6 @@ void classification_test_pmr_term_udp_sport(void) > odp_cos_destroy(cos); > odp_cos_destroy(default_cos); > odp_pmr_destroy(pmr); > - destroy_inq(pktio); > odp_pool_destroy(default_pool); > odp_pool_destroy(pool); > odp_queue_destr
[lng-odp] [PATCH 3/5] validation: cls: test_pmr: don't create default input queue
There is no need to create default input queue for pktio if default CoS is assigned. Signed-off-by: Ivan Khoronzhuk --- .../classification/odp_classification_test_pmr.c | 54 -- 1 file changed, 54 deletions(-) diff --git a/test/validation/classification/odp_classification_test_pmr.c b/test/validation/classification/odp_classification_test_pmr.c index 75d2a95..0b3f279 100644 --- a/test/validation/classification/odp_classification_test_pmr.c +++ b/test/validation/classification/odp_classification_test_pmr.c @@ -55,39 +55,6 @@ odp_pktio_t create_pktio(odp_queue_type_t q_type) return pktio; } -int create_default_inq(odp_pktio_t pktio, odp_queue_type_t qtype) -{ - odp_queue_param_t qparam; - odp_queue_t inq_def; - char inq_name[ODP_QUEUE_NAME_LEN]; - - odp_queue_param_init(&qparam); - qparam.sched.prio = ODP_SCHED_PRIO_DEFAULT; - qparam.sched.sync = ODP_SCHED_SYNC_ATOMIC; - qparam.sched.group = ODP_SCHED_GROUP_ALL; - - snprintf(inq_name, sizeof(inq_name), "inq-pktio-%" PRIu64, -odp_pktio_to_u64(pktio)); - inq_def = odp_queue_lookup(inq_name); - if (inq_def == ODP_QUEUE_INVALID) - inq_def = odp_queue_create( - inq_name, - ODP_QUEUE_TYPE_PKTIN, - qtype == ODP_QUEUE_TYPE_POLL ? NULL : &qparam); - - CU_ASSERT_FATAL(inq_def != ODP_QUEUE_INVALID); - - if (0 > odp_pktio_inq_setdef(pktio, inq_def)) - return -1; - - if (odp_pktio_start(pktio)) { - fprintf(stderr, "unable to start loop\n"); - return -1; - } - - return 0; -} - void configure_default_cos(odp_pktio_t pktio, odp_cos_t *cos, odp_queue_t *queue, odp_pool_t *pool) { @@ -163,8 +130,6 @@ void classification_test_pmr_term_tcp_dport(void) pktio = create_pktio(ODP_QUEUE_TYPE_SCHED); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED); - CU_ASSERT(retval == 0); configure_default_cos(pktio, &default_cos, &default_queue, &default_pool); @@ -237,7 +202,6 @@ void classification_test_pmr_term_tcp_dport(void) odp_cos_destroy(cos); odp_cos_destroy(default_cos); odp_pmr_destroy(pmr); - destroy_inq(pktio); odp_queue_destroy(queue); odp_queue_destroy(default_queue); odp_pool_destroy(pool); @@ -273,8 +237,6 @@ void classification_test_pmr_term_tcp_sport(void) pktio = create_pktio(ODP_QUEUE_TYPE_SCHED); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED); - CU_ASSERT(retval == 0); configure_default_cos(pktio, &default_cos, &default_queue, &default_pool); @@ -344,7 +306,6 @@ void classification_test_pmr_term_tcp_sport(void) odp_cos_destroy(cos); odp_cos_destroy(default_cos); odp_pmr_destroy(pmr); - destroy_inq(pktio); odp_pool_destroy(default_pool); odp_pool_destroy(pool); odp_queue_destroy(queue); @@ -380,8 +341,6 @@ void classification_test_pmr_term_udp_dport(void) pktio = create_pktio(ODP_QUEUE_TYPE_SCHED); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED); - CU_ASSERT(retval == 0); configure_default_cos(pktio, &default_cos, &default_queue, &default_pool); @@ -452,7 +411,6 @@ void classification_test_pmr_term_udp_dport(void) odp_cos_destroy(cos); odp_cos_destroy(default_cos); odp_pmr_destroy(pmr); - destroy_inq(pktio); odp_queue_destroy(queue); odp_queue_destroy(default_queue); odp_pool_destroy(default_pool); @@ -488,8 +446,6 @@ void classification_test_pmr_term_udp_sport(void) pktio = create_pktio(ODP_QUEUE_TYPE_SCHED); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED); - CU_ASSERT(retval == 0); configure_default_cos(pktio, &default_cos, &default_queue, &default_pool); @@ -559,7 +515,6 @@ void classification_test_pmr_term_udp_sport(void) odp_cos_destroy(cos); odp_cos_destroy(default_cos); odp_pmr_destroy(pmr); - destroy_inq(pktio); odp_pool_destroy(default_pool); odp_pool_destroy(pool); odp_queue_destroy(queue); @@ -594,8 +549,6 @@ void classification_test_pmr_term_ipproto(void) pktio = create_pktio(ODP_QUEUE_TYPE_SCHED); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = create_default_inq(pktio, ODP_QUEUE_TYPE_SCHED); - CU_ASSERT(retval == 0); configure_default_cos(pktio, &default_cos, &defa