diff mbox

[API-NEXT] validation: pktio: add coverage for multi-queue pktio routines

Message ID 1454458231-15843-1-git-send-email-bill.fischofer@linaro.org
State New
Headers show

Commit Message

Bill Fischofer Feb. 3, 2016, 12:10 a.m. UTC
Add coverage for the following new multi-queue pktio APIs:
- odp_pktio_input_queue_param_init()
- odp_pktio_output_queue_param_init()
- odp_pktio_input_queues_config()
- odp_pktio_output_queues_config()
- odp_pktio_pktin_queues()
- odp_pktio_pktout_queues()

Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 test/validation/pktio/pktio.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

Comments

Maxim Uvarov Feb. 3, 2016, 1:16 p.m. UTC | #1
needs update tp head.

But with update make check under root fails for tap and normal pktio 
somewhere in termination path.
We need to fix it.

Maxim.

On 02/03/2016 03:10, Bill Fischofer wrote:
> Add coverage for the following new multi-queue pktio APIs:
> - odp_pktio_input_queue_param_init()
> - odp_pktio_output_queue_param_init()
> - odp_pktio_input_queues_config()
> - odp_pktio_output_queues_config()
> - odp_pktio_pktin_queues()
> - odp_pktio_pktout_queues()
>
> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> ---
>   test/validation/pktio/pktio.c | 30 ++++++++++++++++++++++++++++++
>   1 file changed, 30 insertions(+)
>
> diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c
> index e412910..21d58b2 100644
> --- a/test/validation/pktio/pktio.c
> +++ b/test/validation/pktio/pktio.c
> @@ -294,6 +294,12 @@ static odp_pktio_t create_pktio(int iface_idx, odp_pktio_input_mode_t imode,
>   {
>   	odp_pktio_t pktio;
>   	odp_pktio_param_t pktio_param;
> +	odp_pktio_capability_t capa;
> +	odp_pktio_input_queue_param_t in_queue_param;
> +	odp_pktio_output_queue_param_t out_queue_param;
> +	odp_bool_t single_rx = 1;
> +	odp_bool_t single_tx = 1;
> +	int rc;
>   	const char *iface = iface_name[iface_idx];
>   
>   	odp_pktio_param_init(&pktio_param);
> @@ -308,6 +314,30 @@ static odp_pktio_t create_pktio(int iface_idx, odp_pktio_input_mode_t imode,
>   	CU_ASSERT(odp_pktio_to_u64(pktio) !=
>   		  odp_pktio_to_u64(ODP_PKTIO_INVALID));
>   
> +	rc = odp_pktio_capability(pktio, &capa);
> +	CU_ASSERT(rc == 0);
> +	CU_ASSERT(single_rx <= (int)capa.max_input_queues);
> +	CU_ASSERT(single_tx <= (int)capa.max_output_queues);
> +
> +	odp_pktio_input_queue_param_init(&in_queue_param);
> +	odp_pktio_output_queue_param_init(&out_queue_param);
> +
> +	if (imode == ODP_PKTIN_MODE_RECV || imode == ODP_PKTIN_MODE_POLL) {
> +		in_queue_param.single_user = single_rx;
> +		in_queue_param.num_queues  = single_rx;
> +		rc = odp_pktio_input_queues_config(pktio, &in_queue_param);
> +		CU_ASSERT(rc == 0);
> +		CU_ASSERT(odp_pktio_pktin_queues(pktio, NULL, single_rx + 1)
> +			  == single_rx);
> +
> +		out_queue_param.single_user = single_tx;
> +		out_queue_param.num_queues  = single_tx;
> +		rc = odp_pktio_output_queues_config(pktio, &out_queue_param);
> +		CU_ASSERT(rc == 0);
> +		CU_ASSERT(odp_pktio_pktout_queues(pktio, NULL, single_tx + 1)
> +			  == single_tx);
> +	}
> +
>   	if (wait_for_network)
>   		odp_time_wait_ns(ODP_TIME_SEC_IN_NS / 4);
>
Maxim Uvarov Feb. 4, 2016, 10:01 a.m. UTC | #2
ping. It will be good to add that test cases.

Maxim.

On 02/03/2016 03:10, Bill Fischofer wrote:
> Add coverage for the following new multi-queue pktio APIs:
> - odp_pktio_input_queue_param_init()
> - odp_pktio_output_queue_param_init()
> - odp_pktio_input_queues_config()
> - odp_pktio_output_queues_config()
> - odp_pktio_pktin_queues()
> - odp_pktio_pktout_queues()
>
> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> ---
>   test/validation/pktio/pktio.c | 30 ++++++++++++++++++++++++++++++
>   1 file changed, 30 insertions(+)
>
> diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c
> index e412910..21d58b2 100644
> --- a/test/validation/pktio/pktio.c
> +++ b/test/validation/pktio/pktio.c
> @@ -294,6 +294,12 @@ static odp_pktio_t create_pktio(int iface_idx, odp_pktio_input_mode_t imode,
>   {
>   	odp_pktio_t pktio;
>   	odp_pktio_param_t pktio_param;
> +	odp_pktio_capability_t capa;
> +	odp_pktio_input_queue_param_t in_queue_param;
> +	odp_pktio_output_queue_param_t out_queue_param;
> +	odp_bool_t single_rx = 1;
> +	odp_bool_t single_tx = 1;
> +	int rc;
>   	const char *iface = iface_name[iface_idx];
>   
>   	odp_pktio_param_init(&pktio_param);
> @@ -308,6 +314,30 @@ static odp_pktio_t create_pktio(int iface_idx, odp_pktio_input_mode_t imode,
>   	CU_ASSERT(odp_pktio_to_u64(pktio) !=
>   		  odp_pktio_to_u64(ODP_PKTIO_INVALID));
>   
> +	rc = odp_pktio_capability(pktio, &capa);
> +	CU_ASSERT(rc == 0);
> +	CU_ASSERT(single_rx <= (int)capa.max_input_queues);
> +	CU_ASSERT(single_tx <= (int)capa.max_output_queues);
> +
> +	odp_pktio_input_queue_param_init(&in_queue_param);
> +	odp_pktio_output_queue_param_init(&out_queue_param);
> +
> +	if (imode == ODP_PKTIN_MODE_RECV || imode == ODP_PKTIN_MODE_POLL) {
> +		in_queue_param.single_user = single_rx;
> +		in_queue_param.num_queues  = single_rx;
> +		rc = odp_pktio_input_queues_config(pktio, &in_queue_param);
> +		CU_ASSERT(rc == 0);
> +		CU_ASSERT(odp_pktio_pktin_queues(pktio, NULL, single_rx + 1)
> +			  == single_rx);
> +
> +		out_queue_param.single_user = single_tx;
> +		out_queue_param.num_queues  = single_tx;
> +		rc = odp_pktio_output_queues_config(pktio, &out_queue_param);
> +		CU_ASSERT(rc == 0);
> +		CU_ASSERT(odp_pktio_pktout_queues(pktio, NULL, single_tx + 1)
> +			  == single_tx);
> +	}
> +
>   	if (wait_for_network)
>   		odp_time_wait_ns(ODP_TIME_SEC_IN_NS / 4);
>
Bill Fischofer Feb. 4, 2016, 12:18 p.m. UTC | #3
Thanks for that clarification. I thought we were moving this to 1.8 from
yesterday's discussion. I'll rework this test today.

On Thu, Feb 4, 2016 at 5:44 AM, Savolainen, Petri (Nokia - FI/Espoo) <
petri.savolainen@nokia.com> wrote:

>

>

> > -----Original Message-----

> > From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of EXT

> > Maxim Uvarov

> > Sent: Thursday, February 04, 2016 12:02 PM

> > To: lng-odp@lists.linaro.org

> > Subject: Re: [lng-odp] [API-NEXT PATCH] validation: pktio: add coverage

> > for multi-queue pktio routines

> >

> > ping. It will be good to add that test cases.

> >

> > Maxim.

> >

> > On 02/03/2016 03:10, Bill Fischofer wrote:

> > > Add coverage for the following new multi-queue pktio APIs:

> > > - odp_pktio_input_queue_param_init()

> > > - odp_pktio_output_queue_param_init()

> > > - odp_pktio_input_queues_config()

> > > - odp_pktio_output_queues_config()

> > > - odp_pktio_pktin_queues()

> > > - odp_pktio_pktout_queues()

> > >

> > > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

> > > ---

> > >   test/validation/pktio/pktio.c | 30 ++++++++++++++++++++++++++++++

> > >   1 file changed, 30 insertions(+)

> > >

> > > diff --git a/test/validation/pktio/pktio.c

> > b/test/validation/pktio/pktio.c

> > > index e412910..21d58b2 100644

> > > --- a/test/validation/pktio/pktio.c

> > > +++ b/test/validation/pktio/pktio.c

> > > @@ -294,6 +294,12 @@ static odp_pktio_t create_pktio(int iface_idx,

> > odp_pktio_input_mode_t imode,

> > >   {

> > >     odp_pktio_t pktio;

> > >     odp_pktio_param_t pktio_param;

> > > +   odp_pktio_capability_t capa;

> > > +   odp_pktio_input_queue_param_t in_queue_param;

> > > +   odp_pktio_output_queue_param_t out_queue_param;

> > > +   odp_bool_t single_rx = 1;

> > > +   odp_bool_t single_tx = 1;

> > > +   int rc;

> > >     const char *iface = iface_name[iface_idx];

> > >

> > >     odp_pktio_param_init(&pktio_param);

> > > @@ -308,6 +314,30 @@ static odp_pktio_t create_pktio(int iface_idx,

> > odp_pktio_input_mode_t imode,

> > >     CU_ASSERT(odp_pktio_to_u64(pktio) !=

> > >               odp_pktio_to_u64(ODP_PKTIO_INVALID));

> > >

> > > +   rc = odp_pktio_capability(pktio, &capa);

> > > +   CU_ASSERT(rc == 0);

> > > +   CU_ASSERT(single_rx <= (int)capa.max_input_queues);

> > > +   CU_ASSERT(single_tx <= (int)capa.max_output_queues);

> > > +

> > > +   odp_pktio_input_queue_param_init(&in_queue_param);

> > > +   odp_pktio_output_queue_param_init(&out_queue_param);

> > > +

> > > +   if (imode == ODP_PKTIN_MODE_RECV || imode == ODP_PKTIN_MODE_POLL) {

>

> I have not mixed old and new API in an application. Either old API or new

> API should be used but not both in the same app. Right now, tests for the

> new API should be added as new, stand-alone tests. I

>

>

>

> > > +           in_queue_param.single_user = single_rx;

>

> This parameter tells to the implementation if application have

> synchronized itself so that only single thread at a time calls recv_queue()

> (== recv_queue can be implemented without locks). It's confusing to use one

> variable for this bool and the number of queues.

>

> -Petri

>

>

>

> > > +           in_queue_param.num_queues  = single_rx;

> > > +           rc = odp_pktio_input_queues_config(pktio, &in_queue_param);

> > > +           CU_ASSERT(rc == 0);

> > > +           CU_ASSERT(odp_pktio_pktin_queues(pktio, NULL, single_rx +

> 1)

> > > +                     == single_rx);

> > > +

> > > +           out_queue_param.single_user = single_tx;

> > > +           out_queue_param.num_queues  = single_tx;

> > > +           rc = odp_pktio_output_queues_config(pktio,

> &out_queue_param);

> > > +           CU_ASSERT(rc == 0);

> > > +           CU_ASSERT(odp_pktio_pktout_queues(pktio, NULL, single_tx +

> 1)

> > > +                     == single_tx);

> > > +   }

> > > +

> > >     if (wait_for_network)

> > >             odp_time_wait_ns(ODP_TIME_SEC_IN_NS / 4);

> > >

> >

> > _______________________________________________

> > lng-odp mailing list

> > lng-odp@lists.linaro.org

> > https://lists.linaro.org/mailman/listinfo/lng-odp

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp

>
Maxim Uvarov Feb. 4, 2016, 12:32 p.m. UTC | #4
On 02/04/2016 15:18, Bill Fischofer wrote:
> Thanks for that clarification. I thought we were moving this to 1.8 
> from yesterday's discussion. I'll rework this test today.

I tried to get rid of that function but it's not easy to do. If we are 
going to support that function in future it's more easy to add some 
tests now.
Event if it's dummy test. And might be we need to add some description 
for release that some api will be removed. (or mark them as 
ODP_DEPRICATED, or mark in 1.8).

Maxim.

>
> On Thu, Feb 4, 2016 at 5:44 AM, Savolainen, Petri (Nokia - FI/Espoo) 
> <petri.savolainen@nokia.com <mailto:petri.savolainen@nokia.com>> wrote:
>
>
>
>     > -----Original Message-----
>     > From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org
>     <mailto:lng-odp-bounces@lists.linaro.org>] On Behalf Of EXT
>     > Maxim Uvarov
>     > Sent: Thursday, February 04, 2016 12:02 PM
>     > To: lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     > Subject: Re: [lng-odp] [API-NEXT PATCH] validation: pktio: add
>     coverage
>     > for multi-queue pktio routines
>     >
>     > ping. It will be good to add that test cases.
>     >
>     > Maxim.
>     >
>     > On 02/03/2016 03:10, Bill Fischofer wrote:
>     > > Add coverage for the following new multi-queue pktio APIs:
>     > > - odp_pktio_input_queue_param_init()
>     > > - odp_pktio_output_queue_param_init()
>     > > - odp_pktio_input_queues_config()
>     > > - odp_pktio_output_queues_config()
>     > > - odp_pktio_pktin_queues()
>     > > - odp_pktio_pktout_queues()
>     > >
>     > > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org
>     <mailto:bill.fischofer@linaro.org>>
>     > > ---
>     > >   test/validation/pktio/pktio.c | 30
>     ++++++++++++++++++++++++++++++
>     > >   1 file changed, 30 insertions(+)
>     > >
>     > > diff --git a/test/validation/pktio/pktio.c
>     > b/test/validation/pktio/pktio.c
>     > > index e412910..21d58b2 100644
>     > > --- a/test/validation/pktio/pktio.c
>     > > +++ b/test/validation/pktio/pktio.c
>     > > @@ -294,6 +294,12 @@ static odp_pktio_t create_pktio(int
>     iface_idx,
>     > odp_pktio_input_mode_t imode,
>     > >   {
>     > >     odp_pktio_t pktio;
>     > >     odp_pktio_param_t pktio_param;
>     > > +   odp_pktio_capability_t capa;
>     > > +   odp_pktio_input_queue_param_t in_queue_param;
>     > > +   odp_pktio_output_queue_param_t out_queue_param;
>     > > +   odp_bool_t single_rx = 1;
>     > > +   odp_bool_t single_tx = 1;
>     > > +   int rc;
>     > >     const char *iface = iface_name[iface_idx];
>     > >
>     > >     odp_pktio_param_init(&pktio_param);
>     > > @@ -308,6 +314,30 @@ static odp_pktio_t create_pktio(int
>     iface_idx,
>     > odp_pktio_input_mode_t imode,
>     > >     CU_ASSERT(odp_pktio_to_u64(pktio) !=
>     > >  odp_pktio_to_u64(ODP_PKTIO_INVALID));
>     > >
>     > > +   rc = odp_pktio_capability(pktio, &capa);
>     > > +   CU_ASSERT(rc == 0);
>     > > +   CU_ASSERT(single_rx <= (int)capa.max_input_queues);
>     > > +   CU_ASSERT(single_tx <= (int)capa.max_output_queues);
>     > > +
>     > > +  odp_pktio_input_queue_param_init(&in_queue_param);
>     > > +  odp_pktio_output_queue_param_init(&out_queue_param);
>     > > +
>     > > +   if (imode == ODP_PKTIN_MODE_RECV || imode ==
>     ODP_PKTIN_MODE_POLL) {
>
>     I have not mixed old and new API in an application. Either old API
>     or new API should be used but not both in the same app. Right now,
>     tests for the new API should be added as new, stand-alone tests. I
>
>
>
>     > > +           in_queue_param.single_user = single_rx;
>
>     This parameter tells to the implementation if application have
>     synchronized itself so that only single thread at a time calls
>     recv_queue() (== recv_queue can be implemented without locks).
>     It's confusing to use one variable for this bool and the number of
>     queues.
>
>     -Petri
>
>
>
>     > > +           in_queue_param.num_queues  = single_rx;
>     > > +           rc = odp_pktio_input_queues_config(pktio,
>     &in_queue_param);
>     > > +           CU_ASSERT(rc == 0);
>     > > +  CU_ASSERT(odp_pktio_pktin_queues(pktio, NULL, single_rx + 1)
>     > > +                     == single_rx);
>     > > +
>     > > +           out_queue_param.single_user = single_tx;
>     > > +           out_queue_param.num_queues  = single_tx;
>     > > +           rc = odp_pktio_output_queues_config(pktio,
>     &out_queue_param);
>     > > +           CU_ASSERT(rc == 0);
>     > > +  CU_ASSERT(odp_pktio_pktout_queues(pktio, NULL, single_tx + 1)
>     > > +                     == single_tx);
>     > > +   }
>     > > +
>     > >     if (wait_for_network)
>     > >  odp_time_wait_ns(ODP_TIME_SEC_IN_NS / 4);
>     > >
>     >
>     > _______________________________________________
>     > lng-odp mailing list
>     > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     > https://lists.linaro.org/mailman/listinfo/lng-odp
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
Bill Fischofer Feb. 4, 2016, 12:33 p.m. UTC | #5
OK, so shall I wait until the final APIs are available for the test?

On Thu, Feb 4, 2016 at 6:30 AM, Savolainen, Petri (Nokia - FI/Espoo) <
petri.savolainen@nokia.com> wrote:

> Yes, I would move the new API into v1.8, if Maxim can remove it still from

> next branch. If he cannot, one option is to just accept that the new API

> leaked in too early and is not officially required / supported. I’m just

> finalizing the new API and will do some renames (e.g. shorten type /

> function names like this one odp_pktio_input_queue_param_init()).

>

>

>

> -Petri

>

>

>

>

>

> *From:* EXT Bill Fischofer [mailto:bill.fischofer@linaro.org]

> *Sent:* Thursday, February 04, 2016 2:19 PM

> *To:* Savolainen, Petri (Nokia - FI/Espoo)

> *Cc:* EXT Maxim Uvarov; lng-odp@lists.linaro.org

>

> *Subject:* Re: [lng-odp] [API-NEXT PATCH] validation: pktio: add coverage

> for multi-queue pktio routines

>

>

>

> Thanks for that clarification. I thought we were moving this to 1.8 from

> yesterday's discussion. I'll rework this test today.

>

>

>

> On Thu, Feb 4, 2016 at 5:44 AM, Savolainen, Petri (Nokia - FI/Espoo) <

> petri.savolainen@nokia.com> wrote:

>

>

>

> > -----Original Message-----

> > From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of EXT

> > Maxim Uvarov

> > Sent: Thursday, February 04, 2016 12:02 PM

> > To: lng-odp@lists.linaro.org

> > Subject: Re: [lng-odp] [API-NEXT PATCH] validation: pktio: add coverage

> > for multi-queue pktio routines

> >

> > ping. It will be good to add that test cases.

> >

> > Maxim.

> >

> > On 02/03/2016 03:10, Bill Fischofer wrote:

> > > Add coverage for the following new multi-queue pktio APIs:

> > > - odp_pktio_input_queue_param_init()

> > > - odp_pktio_output_queue_param_init()

> > > - odp_pktio_input_queues_config()

> > > - odp_pktio_output_queues_config()

> > > - odp_pktio_pktin_queues()

> > > - odp_pktio_pktout_queues()

> > >

> > > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

> > > ---

> > >   test/validation/pktio/pktio.c | 30 ++++++++++++++++++++++++++++++

> > >   1 file changed, 30 insertions(+)

> > >

> > > diff --git a/test/validation/pktio/pktio.c

> > b/test/validation/pktio/pktio.c

> > > index e412910..21d58b2 100644

> > > --- a/test/validation/pktio/pktio.c

> > > +++ b/test/validation/pktio/pktio.c

> > > @@ -294,6 +294,12 @@ static odp_pktio_t create_pktio(int iface_idx,

> > odp_pktio_input_mode_t imode,

> > >   {

> > >     odp_pktio_t pktio;

> > >     odp_pktio_param_t pktio_param;

> > > +   odp_pktio_capability_t capa;

> > > +   odp_pktio_input_queue_param_t in_queue_param;

> > > +   odp_pktio_output_queue_param_t out_queue_param;

> > > +   odp_bool_t single_rx = 1;

> > > +   odp_bool_t single_tx = 1;

> > > +   int rc;

> > >     const char *iface = iface_name[iface_idx];

> > >

> > >     odp_pktio_param_init(&pktio_param);

> > > @@ -308,6 +314,30 @@ static odp_pktio_t create_pktio(int iface_idx,

> > odp_pktio_input_mode_t imode,

> > >     CU_ASSERT(odp_pktio_to_u64(pktio) !=

> > >               odp_pktio_to_u64(ODP_PKTIO_INVALID));

> > >

> > > +   rc = odp_pktio_capability(pktio, &capa);

> > > +   CU_ASSERT(rc == 0);

> > > +   CU_ASSERT(single_rx <= (int)capa.max_input_queues);

> > > +   CU_ASSERT(single_tx <= (int)capa.max_output_queues);

> > > +

> > > +   odp_pktio_input_queue_param_init(&in_queue_param);

> > > +   odp_pktio_output_queue_param_init(&out_queue_param);

> > > +

> > > +   if (imode == ODP_PKTIN_MODE_RECV || imode == ODP_PKTIN_MODE_POLL) {

>

> I have not mixed old and new API in an application. Either old API or new

> API should be used but not both in the same app. Right now, tests for the

> new API should be added as new, stand-alone tests. I

>

>

>

> > > +           in_queue_param.single_user = single_rx;

>

> This parameter tells to the implementation if application have

> synchronized itself so that only single thread at a time calls recv_queue()

> (== recv_queue can be implemented without locks). It's confusing to use one

> variable for this bool and the number of queues.

>

> -Petri

>

>

>

>

> > > +           in_queue_param.num_queues  = single_rx;

> > > +           rc = odp_pktio_input_queues_config(pktio, &in_queue_param);

> > > +           CU_ASSERT(rc == 0);

> > > +           CU_ASSERT(odp_pktio_pktin_queues(pktio, NULL, single_rx +

> 1)

> > > +                     == single_rx);

> > > +

> > > +           out_queue_param.single_user = single_tx;

> > > +           out_queue_param.num_queues  = single_tx;

> > > +           rc = odp_pktio_output_queues_config(pktio,

> &out_queue_param);

> > > +           CU_ASSERT(rc == 0);

> > > +           CU_ASSERT(odp_pktio_pktout_queues(pktio, NULL, single_tx +

> 1)

> > > +                     == single_tx);

> > > +   }

> > > +

> > >     if (wait_for_network)

> > >             odp_time_wait_ns(ODP_TIME_SEC_IN_NS / 4);

> > >

> >

> > _______________________________________________

> > lng-odp mailing list

> > lng-odp@lists.linaro.org

> > https://lists.linaro.org/mailman/listinfo/lng-odp

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp

>

>

>
Maxim Uvarov Feb. 4, 2016, 1:02 p.m. UTC | #6
On 02/04/2016 15:59, Savolainen, Petri (Nokia - FI/Espoo) wrote:
>
> It’s better to just add standalone test for these now and release v1.7.
>

Petri, might it be quicker for you to write that standalone test?

Maxim.

> Final API (with old API removed) and all test ported over to the new 
> API would be task for v1.8 (e.g. started now and finished in a week or 
> so).
>
> -Petri
>
> *From:*EXT Bill Fischofer [mailto:bill.fischofer@linaro.org]
> *Sent:* Thursday, February 04, 2016 2:33 PM
> *To:* Savolainen, Petri (Nokia - FI/Espoo)
> *Cc:* EXT Maxim Uvarov; lng-odp@lists.linaro.org
> *Subject:* Re: [lng-odp] [API-NEXT PATCH] validation: pktio: add 
> coverage for multi-queue pktio routines
>
> OK, so shall I wait until the final APIs are available for the test?
>
> On Thu, Feb 4, 2016 at 6:30 AM, Savolainen, Petri (Nokia - FI/Espoo) 
> <petri.savolainen@nokia.com <mailto:petri.savolainen@nokia.com>> wrote:
>
>     Yes, I would move the new API into v1.8, if Maxim can remove it
>     still from next branch. If he cannot, one option is to just accept
>     that the new API leaked in too early and is not officially
>     required / supported. I’m just finalizing the new API and will do
>     some renames (e.g. shorten type / function names like this one
>     odp_pktio_input_queue_param_init()).
>
>     -Petri
>
>     *From:*EXT Bill Fischofer [mailto:bill.fischofer@linaro.org
>     <mailto:bill.fischofer@linaro.org>]
>     *Sent:* Thursday, February 04, 2016 2:19 PM
>     *To:* Savolainen, Petri (Nokia - FI/Espoo)
>     *Cc:* EXT Maxim Uvarov; lng-odp@lists.linaro.org
>     <mailto:lng-odp@lists.linaro.org>
>
>
>     *Subject:* Re: [lng-odp] [API-NEXT PATCH] validation: pktio: add
>     coverage for multi-queue pktio routines
>
>     Thanks for that clarification. I thought we were moving this to
>     1.8 from yesterday's discussion. I'll rework this test today.
>
>     On Thu, Feb 4, 2016 at 5:44 AM, Savolainen, Petri (Nokia -
>     FI/Espoo) <petri.savolainen@nokia.com
>     <mailto:petri.savolainen@nokia.com>> wrote:
>
>
>
>         > -----Original Message-----
>         > From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org
>         <mailto:lng-odp-bounces@lists.linaro.org>] On Behalf Of EXT
>         > Maxim Uvarov
>         > Sent: Thursday, February 04, 2016 12:02 PM
>         > To: lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>         > Subject: Re: [lng-odp] [API-NEXT PATCH] validation: pktio:
>         add coverage
>         > for multi-queue pktio routines
>         >
>         > ping. It will be good to add that test cases.
>         >
>         > Maxim.
>         >
>         > On 02/03/2016 03:10, Bill Fischofer wrote:
>         > > Add coverage for the following new multi-queue pktio APIs:
>         > > - odp_pktio_input_queue_param_init()
>         > > - odp_pktio_output_queue_param_init()
>         > > - odp_pktio_input_queues_config()
>         > > - odp_pktio_output_queues_config()
>         > > - odp_pktio_pktin_queues()
>         > > - odp_pktio_pktout_queues()
>         > >
>         > > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org
>         <mailto:bill.fischofer@linaro.org>>
>         > > ---
>         > >  test/validation/pktio/pktio.c | 30
>         ++++++++++++++++++++++++++++++
>         > >   1 file changed, 30 insertions(+)
>         > >
>         > > diff --git a/test/validation/pktio/pktio.c
>         > b/test/validation/pktio/pktio.c
>         > > index e412910..21d58b2 100644
>         > > --- a/test/validation/pktio/pktio.c
>         > > +++ b/test/validation/pktio/pktio.c
>         > > @@ -294,6 +294,12 @@ static odp_pktio_t create_pktio(int
>         iface_idx,
>         > odp_pktio_input_mode_t imode,
>         > >   {
>         > >     odp_pktio_t pktio;
>         > >     odp_pktio_param_t pktio_param;
>         > > +  odp_pktio_capability_t capa;
>         > > +  odp_pktio_input_queue_param_t in_queue_param;
>         > > +  odp_pktio_output_queue_param_t out_queue_param;
>         > > +   odp_bool_t single_rx = 1;
>         > > +   odp_bool_t single_tx = 1;
>         > > +   int rc;
>         > >     const char *iface = iface_name[iface_idx];
>         > >
>         > >  odp_pktio_param_init(&pktio_param);
>         > > @@ -308,6 +314,30 @@ static odp_pktio_t create_pktio(int
>         iface_idx,
>         > odp_pktio_input_mode_t imode,
>         > >  CU_ASSERT(odp_pktio_to_u64(pktio) !=
>         > >  odp_pktio_to_u64(ODP_PKTIO_INVALID));
>         > >
>         > > +   rc = odp_pktio_capability(pktio, &capa);
>         > > +   CU_ASSERT(rc == 0);
>         > > +   CU_ASSERT(single_rx <= (int)capa.max_input_queues);
>         > > +   CU_ASSERT(single_tx <= (int)capa.max_output_queues);
>         > > +
>         > > +  odp_pktio_input_queue_param_init(&in_queue_param);
>         > > +  odp_pktio_output_queue_param_init(&out_queue_param);
>         > > +
>         > > +   if (imode == ODP_PKTIN_MODE_RECV || imode ==
>         ODP_PKTIN_MODE_POLL) {
>
>         I have not mixed old and new API in an application. Either old
>         API or new API should be used but not both in the same app.
>         Right now, tests for the new API should be added as new,
>         stand-alone tests. I
>
>
>
>         > > +  in_queue_param.single_user = single_rx;
>
>         This parameter tells to the implementation if application have
>         synchronized itself so that only single thread at a time calls
>         recv_queue() (== recv_queue can be implemented without locks).
>         It's confusing to use one variable for this bool and the
>         number of queues.
>
>         -Petri
>
>
>
>
>         > > +  in_queue_param.num_queues  = single_rx;
>         > > +           rc = odp_pktio_input_queues_config(pktio,
>         &in_queue_param);
>         > > +           CU_ASSERT(rc == 0);
>         > > +  CU_ASSERT(odp_pktio_pktin_queues(pktio, NULL, single_rx
>         + 1)
>         > > +                     == single_rx);
>         > > +
>         > > +  out_queue_param.single_user = single_tx;
>         > > +  out_queue_param.num_queues  = single_tx;
>         > > +           rc = odp_pktio_output_queues_config(pktio,
>         &out_queue_param);
>         > > +           CU_ASSERT(rc == 0);
>         > > +  CU_ASSERT(odp_pktio_pktout_queues(pktio, NULL,
>         single_tx + 1)
>         > > +                     == single_tx);
>         > > +   }
>         > > +
>         > >     if (wait_for_network)
>         > >  odp_time_wait_ns(ODP_TIME_SEC_IN_NS / 4);
>         > >
>         >
>         > _______________________________________________
>         > lng-odp mailing list
>         > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>         > https://lists.linaro.org/mailman/listinfo/lng-odp
>         _______________________________________________
>         lng-odp mailing list
>         lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>         https://lists.linaro.org/mailman/listinfo/lng-odp
>
Bill Fischofer Feb. 4, 2016, 2:08 p.m. UTC | #7
That's fine with me.  Maxim?

On Thu, Feb 4, 2016 at 8:00 AM, Elo, Matias (Nokia - FI/Espoo) <
matias.elo@nokia.com> wrote:

> > -----Original Message-----

> > From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of

> EXT Maxim

> > Uvarov

> > Sent: Thursday, February 04, 2016 3:02 PM

> > To: Savolainen, Petri (Nokia - FI/Espoo) <petri.savolainen@nokia.com>;

> EXT Bill

> > Fischofer <bill.fischofer@linaro.org>

> > Cc: lng-odp@lists.linaro.org

> > Subject: Re: [lng-odp] [API-NEXT PATCH] validation: pktio: add coverage

> for

> > multi-queue pktio routines

> >

> > On 02/04/2016 15:59, Savolainen, Petri (Nokia - FI/Espoo) wrote:

> > >

> > > It’s better to just add standalone test for these now and release v1.7.

> > >

> >

> > Petri, might it be quicker for you to write that standalone test?

>

> I can write the tests and submit them tomorrow.

>

> -Matias

>

> >

> > Maxim.

> >

> > > Final API (with old API removed) and all test ported over to the new

> > > API would be task for v1.8 (e.g. started now and finished in a week or

> > > so).

> > >

> > > -Petri

> > >

> > > *From:*EXT Bill Fischofer [mailto:bill.fischofer@linaro.org]

> > > *Sent:* Thursday, February 04, 2016 2:33 PM

> > > *To:* Savolainen, Petri (Nokia - FI/Espoo)

> > > *Cc:* EXT Maxim Uvarov; lng-odp@lists.linaro.org

> > > *Subject:* Re: [lng-odp] [API-NEXT PATCH] validation: pktio: add

> > > coverage for multi-queue pktio routines

> > >

> > > OK, so shall I wait until the final APIs are available for the test?

> > >

> > > On Thu, Feb 4, 2016 at 6:30 AM, Savolainen, Petri (Nokia - FI/Espoo)

> > > <petri.savolainen@nokia.com <mailto:petri.savolainen@nokia.com>>

> wrote:

> > >

> > >     Yes, I would move the new API into v1.8, if Maxim can remove it

> > >     still from next branch. If he cannot, one option is to just accept

> > >     that the new API leaked in too early and is not officially

> > >     required / supported. I’m just finalizing the new API and will do

> > >     some renames (e.g. shorten type / function names like this one

> > >     odp_pktio_input_queue_param_init()).

> > >

> > >     -Petri

> > >

> > >     *From:*EXT Bill Fischofer [mailto:bill.fischofer@linaro.org

> > >     <mailto:bill.fischofer@linaro.org>]

> > >     *Sent:* Thursday, February 04, 2016 2:19 PM

> > >     *To:* Savolainen, Petri (Nokia - FI/Espoo)

> > >     *Cc:* EXT Maxim Uvarov; lng-odp@lists.linaro.org

> > >     <mailto:lng-odp@lists.linaro.org>

> > >

> > >

> > >     *Subject:* Re: [lng-odp] [API-NEXT PATCH] validation: pktio: add

> > >     coverage for multi-queue pktio routines

> > >

> > >     Thanks for that clarification. I thought we were moving this to

> > >     1.8 from yesterday's discussion. I'll rework this test today.

> > >

> > >     On Thu, Feb 4, 2016 at 5:44 AM, Savolainen, Petri (Nokia -

> > >     FI/Espoo) <petri.savolainen@nokia.com

> > >     <mailto:petri.savolainen@nokia.com>> wrote:

> > >

> > >

> > >

> > >         > -----Original Message-----

> > >         > From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org

> > >         <mailto:lng-odp-bounces@lists.linaro.org>] On Behalf Of EXT

> > >         > Maxim Uvarov

> > >         > Sent: Thursday, February 04, 2016 12:02 PM

> > >         > To: lng-odp@lists.linaro.org <mailto:

> lng-odp@lists.linaro.org>

> > >         > Subject: Re: [lng-odp] [API-NEXT PATCH] validation: pktio:

> > >         add coverage

> > >         > for multi-queue pktio routines

> > >         >

> > >         > ping. It will be good to add that test cases.

> > >         >

> > >         > Maxim.

> > >         >

> > >         > On 02/03/2016 03:10, Bill Fischofer wrote:

> > >         > > Add coverage for the following new multi-queue pktio APIs:

> > >         > > - odp_pktio_input_queue_param_init()

> > >         > > - odp_pktio_output_queue_param_init()

> > >         > > - odp_pktio_input_queues_config()

> > >         > > - odp_pktio_output_queues_config()

> > >         > > - odp_pktio_pktin_queues()

> > >         > > - odp_pktio_pktout_queues()

> > >         > >

> > >         > > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org

> > >         <mailto:bill.fischofer@linaro.org>>

> > >         > > ---

> > >         > >  test/validation/pktio/pktio.c | 30

> > >         ++++++++++++++++++++++++++++++

> > >         > >   1 file changed, 30 insertions(+)

> > >         > >

> > >         > > diff --git a/test/validation/pktio/pktio.c

> > >         > b/test/validation/pktio/pktio.c

> > >         > > index e412910..21d58b2 100644

> > >         > > --- a/test/validation/pktio/pktio.c

> > >         > > +++ b/test/validation/pktio/pktio.c

> > >         > > @@ -294,6 +294,12 @@ static odp_pktio_t create_pktio(int

> > >         iface_idx,

> > >         > odp_pktio_input_mode_t imode,

> > >         > >   {

> > >         > >     odp_pktio_t pktio;

> > >         > >     odp_pktio_param_t pktio_param;

> > >         > > +  odp_pktio_capability_t capa;

> > >         > > +  odp_pktio_input_queue_param_t in_queue_param;

> > >         > > +  odp_pktio_output_queue_param_t out_queue_param;

> > >         > > +   odp_bool_t single_rx = 1;

> > >         > > +   odp_bool_t single_tx = 1;

> > >         > > +   int rc;

> > >         > >     const char *iface = iface_name[iface_idx];

> > >         > >

> > >         > >  odp_pktio_param_init(&pktio_param);

> > >         > > @@ -308,6 +314,30 @@ static odp_pktio_t create_pktio(int

> > >         iface_idx,

> > >         > odp_pktio_input_mode_t imode,

> > >         > >  CU_ASSERT(odp_pktio_to_u64(pktio) !=

> > >         > >  odp_pktio_to_u64(ODP_PKTIO_INVALID));

> > >         > >

> > >         > > +   rc = odp_pktio_capability(pktio, &capa);

> > >         > > +   CU_ASSERT(rc == 0);

> > >         > > +   CU_ASSERT(single_rx <= (int)capa.max_input_queues);

> > >         > > +   CU_ASSERT(single_tx <= (int)capa.max_output_queues);

> > >         > > +

> > >         > > +  odp_pktio_input_queue_param_init(&in_queue_param);

> > >         > > +  odp_pktio_output_queue_param_init(&out_queue_param);

> > >         > > +

> > >         > > +   if (imode == ODP_PKTIN_MODE_RECV || imode ==

> > >         ODP_PKTIN_MODE_POLL) {

> > >

> > >         I have not mixed old and new API in an application. Either old

> > >         API or new API should be used but not both in the same app.

> > >         Right now, tests for the new API should be added as new,

> > >         stand-alone tests. I

> > >

> > >

> > >

> > >         > > +  in_queue_param.single_user = single_rx;

> > >

> > >         This parameter tells to the implementation if application have

> > >         synchronized itself so that only single thread at a time calls

> > >         recv_queue() (== recv_queue can be implemented without locks).

> > >         It's confusing to use one variable for this bool and the

> > >         number of queues.

> > >

> > >         -Petri

> > >

> > >

> > >

> > >

> > >         > > +  in_queue_param.num_queues  = single_rx;

> > >         > > +           rc = odp_pktio_input_queues_config(pktio,

> > >         &in_queue_param);

> > >         > > +           CU_ASSERT(rc == 0);

> > >         > > +  CU_ASSERT(odp_pktio_pktin_queues(pktio, NULL, single_rx

> > >         + 1)

> > >         > > +                     == single_rx);

> > >         > > +

> > >         > > +  out_queue_param.single_user = single_tx;

> > >         > > +  out_queue_param.num_queues  = single_tx;

> > >         > > +           rc = odp_pktio_output_queues_config(pktio,

> > >         &out_queue_param);

> > >         > > +           CU_ASSERT(rc == 0);

> > >         > > +  CU_ASSERT(odp_pktio_pktout_queues(pktio, NULL,

> > >         single_tx + 1)

> > >         > > +                     == single_tx);

> > >         > > +   }

> > >         > > +

> > >         > >     if (wait_for_network)

> > >         > >  odp_time_wait_ns(ODP_TIME_SEC_IN_NS / 4);

> > >         > >

> > >         >

> > >         > _______________________________________________

> > >         > lng-odp mailing list

> > >         > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>

> > >         > https://lists.linaro.org/mailman/listinfo/lng-odp

> > >         _______________________________________________

> > >         lng-odp mailing list

> > >         lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>

> > >         https://lists.linaro.org/mailman/listinfo/lng-odp

> > >

> >

> > _______________________________________________

> > lng-odp mailing list

> > lng-odp@lists.linaro.org

> > https://lists.linaro.org/mailman/listinfo/lng-odp

>
Maxim Uvarov Feb. 4, 2016, 6:23 p.m. UTC | #8
On 02/04/2016 17:08, Bill Fischofer wrote:
> That's fine with me.  Maxim?

Ok,  one more I think we can wait. I can not harry in generation 
changelog patch.

Maxim.

>
> On Thu, Feb 4, 2016 at 8:00 AM, Elo, Matias (Nokia - FI/Espoo) 
> <matias.elo@nokia.com <mailto:matias.elo@nokia.com>> wrote:
>
>     > -----Original Message-----
>     > From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org
>     <mailto:lng-odp-bounces@lists.linaro.org>] On Behalf Of EXT Maxim
>     > Uvarov
>     > Sent: Thursday, February 04, 2016 3:02 PM
>     > To: Savolainen, Petri (Nokia - FI/Espoo)
>     <petri.savolainen@nokia.com <mailto:petri.savolainen@nokia.com>>;
>     EXT Bill
>     > Fischofer <bill.fischofer@linaro.org
>     <mailto:bill.fischofer@linaro.org>>
>     > Cc: lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     > Subject: Re: [lng-odp] [API-NEXT PATCH] validation: pktio: add
>     coverage for
>     > multi-queue pktio routines
>     >
>     > On 02/04/2016 15:59, Savolainen, Petri (Nokia - FI/Espoo) wrote:
>     > >
>     > > It’s better to just add standalone test for these now and
>     release v1.7.
>     > >
>     >
>     > Petri, might it be quicker for you to write that standalone test?
>
>     I can write the tests and submit them tomorrow.
>
>     -Matias
>
>     >
>     > Maxim.
>     >
>     > > Final API (with old API removed) and all test ported over to
>     the new
>     > > API would be task for v1.8 (e.g. started now and finished in a
>     week or
>     > > so).
>     > >
>     > > -Petri
>     > >
>     > > *From:*EXT Bill Fischofer [mailto:bill.fischofer@linaro.org
>     <mailto:bill.fischofer@linaro.org>]
>     > > *Sent:* Thursday, February 04, 2016 2:33 PM
>     > > *To:* Savolainen, Petri (Nokia - FI/Espoo)
>     > > *Cc:* EXT Maxim Uvarov; lng-odp@lists.linaro.org
>     <mailto:lng-odp@lists.linaro.org>
>     > > *Subject:* Re: [lng-odp] [API-NEXT PATCH] validation: pktio: add
>     > > coverage for multi-queue pktio routines
>     > >
>     > > OK, so shall I wait until the final APIs are available for the
>     test?
>     > >
>     > > On Thu, Feb 4, 2016 at 6:30 AM, Savolainen, Petri (Nokia -
>     FI/Espoo)
>     > > <petri.savolainen@nokia.com
>     <mailto:petri.savolainen@nokia.com>
>     <mailto:petri.savolainen@nokia.com
>     <mailto:petri.savolainen@nokia.com>>> wrote:
>     > >
>     > >     Yes, I would move the new API into v1.8, if Maxim can
>     remove it
>     > >     still from next branch. If he cannot, one option is to
>     just accept
>     > >     that the new API leaked in too early and is not officially
>     > >     required / supported. I’m just finalizing the new API and
>     will do
>     > >     some renames (e.g. shorten type / function names like this one
>     > >     odp_pktio_input_queue_param_init()).
>     > >
>     > >     -Petri
>     > >
>     > >     *From:*EXT Bill Fischofer
>     [mailto:bill.fischofer@linaro.org <mailto:bill.fischofer@linaro.org>
>     > >     <mailto:bill.fischofer@linaro.org
>     <mailto:bill.fischofer@linaro.org>>]
>     > >     *Sent:* Thursday, February 04, 2016 2:19 PM
>     > >     *To:* Savolainen, Petri (Nokia - FI/Espoo)
>     > >     *Cc:* EXT Maxim Uvarov; lng-odp@lists.linaro.org
>     <mailto:lng-odp@lists.linaro.org>
>     > >     <mailto:lng-odp@lists.linaro.org
>     <mailto:lng-odp@lists.linaro.org>>
>     > >
>     > >
>     > >     *Subject:* Re: [lng-odp] [API-NEXT PATCH] validation:
>     pktio: add
>     > >     coverage for multi-queue pktio routines
>     > >
>     > >     Thanks for that clarification. I thought we were moving
>     this to
>     > >     1.8 from yesterday's discussion. I'll rework this test today.
>     > >
>     > >     On Thu, Feb 4, 2016 at 5:44 AM, Savolainen, Petri (Nokia -
>     > >     FI/Espoo) <petri.savolainen@nokia.com
>     <mailto:petri.savolainen@nokia.com>
>     > >     <mailto:petri.savolainen@nokia.com
>     <mailto:petri.savolainen@nokia.com>>> wrote:
>     > >
>     > >
>     > >
>     > >         > -----Original Message-----
>     > >         > From: lng-odp
>     [mailto:lng-odp-bounces@lists.linaro.org
>     <mailto:lng-odp-bounces@lists.linaro.org>
>     > >         <mailto:lng-odp-bounces@lists.linaro.org
>     <mailto:lng-odp-bounces@lists.linaro.org>>] On Behalf Of EXT
>     > >         > Maxim Uvarov
>     > >         > Sent: Thursday, February 04, 2016 12:02 PM
>     > >         > To: lng-odp@lists.linaro.org
>     <mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org
>     <mailto:lng-odp@lists.linaro.org>>
>     > >         > Subject: Re: [lng-odp] [API-NEXT PATCH] validation:
>     pktio:
>     > >         add coverage
>     > >         > for multi-queue pktio routines
>     > >         >
>     > >         > ping. It will be good to add that test cases.
>     > >         >
>     > >         > Maxim.
>     > >         >
>     > >         > On 02/03/2016 03:10, Bill Fischofer wrote:
>     > >         > > Add coverage for the following new multi-queue
>     pktio APIs:
>     > >         > > - odp_pktio_input_queue_param_init()
>     > >         > > - odp_pktio_output_queue_param_init()
>     > >         > > - odp_pktio_input_queues_config()
>     > >         > > - odp_pktio_output_queues_config()
>     > >         > > - odp_pktio_pktin_queues()
>     > >         > > - odp_pktio_pktout_queues()
>     > >         > >
>     > >         > > Signed-off-by: Bill Fischofer
>     <bill.fischofer@linaro.org <mailto:bill.fischofer@linaro.org>
>     > >         <mailto:bill.fischofer@linaro.org
>     <mailto:bill.fischofer@linaro.org>>>
>     > >         > > ---
>     > >         > > test/validation/pktio/pktio.c | 30
>     > >         ++++++++++++++++++++++++++++++
>     > >         > >   1 file changed, 30 insertions(+)
>     > >         > >
>     > >         > > diff --git a/test/validation/pktio/pktio.c
>     > >         > b/test/validation/pktio/pktio.c
>     > >         > > index e412910..21d58b2 100644
>     > >         > > --- a/test/validation/pktio/pktio.c
>     > >         > > +++ b/test/validation/pktio/pktio.c
>     > >         > > @@ -294,6 +294,12 @@ static odp_pktio_t
>     create_pktio(int
>     > >         iface_idx,
>     > >         > odp_pktio_input_mode_t imode,
>     > >         > >   {
>     > >         > >     odp_pktio_t pktio;
>     > >         > >     odp_pktio_param_t pktio_param;
>     > >         > > +  odp_pktio_capability_t capa;
>     > >         > > + odp_pktio_input_queue_param_t in_queue_param;
>     > >         > > + odp_pktio_output_queue_param_t out_queue_param;
>     > >         > > +   odp_bool_t single_rx = 1;
>     > >         > > +   odp_bool_t single_tx = 1;
>     > >         > > +   int rc;
>     > >         > >     const char *iface = iface_name[iface_idx];
>     > >         > >
>     > >         > > odp_pktio_param_init(&pktio_param);
>     > >         > > @@ -308,6 +314,30 @@ static odp_pktio_t
>     create_pktio(int
>     > >         iface_idx,
>     > >         > odp_pktio_input_mode_t imode,
>     > >         > > CU_ASSERT(odp_pktio_to_u64(pktio) !=
>     > >         > > odp_pktio_to_u64(ODP_PKTIO_INVALID));
>     > >         > >
>     > >         > > +   rc = odp_pktio_capability(pktio, &capa);
>     > >         > > +   CU_ASSERT(rc == 0);
>     > >         > > +   CU_ASSERT(single_rx <=
>     (int)capa.max_input_queues);
>     > >         > > +   CU_ASSERT(single_tx <=
>     (int)capa.max_output_queues);
>     > >         > > +
>     > >         > > + odp_pktio_input_queue_param_init(&in_queue_param);
>     > >         > > + odp_pktio_output_queue_param_init(&out_queue_param);
>     > >         > > +
>     > >         > > +   if (imode == ODP_PKTIN_MODE_RECV || imode ==
>     > >         ODP_PKTIN_MODE_POLL) {
>     > >
>     > >         I have not mixed old and new API in an application.
>     Either old
>     > >         API or new API should be used but not both in the same
>     app.
>     > >         Right now, tests for the new API should be added as new,
>     > >         stand-alone tests. I
>     > >
>     > >
>     > >
>     > >         > > + in_queue_param.single_user = single_rx;
>     > >
>     > >         This parameter tells to the implementation if
>     application have
>     > >         synchronized itself so that only single thread at a
>     time calls
>     > >         recv_queue() (== recv_queue can be implemented without
>     locks).
>     > >         It's confusing to use one variable for this bool and the
>     > >         number of queues.
>     > >
>     > >         -Petri
>     > >
>     > >
>     > >
>     > >
>     > >         > > + in_queue_param.num_queues  = single_rx;
>     > >         > > +           rc = odp_pktio_input_queues_config(pktio,
>     > >         &in_queue_param);
>     > >         > > +           CU_ASSERT(rc == 0);
>     > >         > > + CU_ASSERT(odp_pktio_pktin_queues(pktio, NULL,
>     single_rx
>     > >         + 1)
>     > >         > > +                     == single_rx);
>     > >         > > +
>     > >         > > + out_queue_param.single_user = single_tx;
>     > >         > > + out_queue_param.num_queues  = single_tx;
>     > >         > > +           rc = odp_pktio_output_queues_config(pktio,
>     > >         &out_queue_param);
>     > >         > > +           CU_ASSERT(rc == 0);
>     > >         > > + CU_ASSERT(odp_pktio_pktout_queues(pktio, NULL,
>     > >         single_tx + 1)
>     > >         > > +                     == single_tx);
>     > >         > > +   }
>     > >         > > +
>     > >         > >     if (wait_for_network)
>     > >         > > odp_time_wait_ns(ODP_TIME_SEC_IN_NS / 4);
>     > >         > >
>     > >         >
>     > >         > _______________________________________________
>     > >         > lng-odp mailing list
>     > >         > lng-odp@lists.linaro.org
>     <mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org
>     <mailto:lng-odp@lists.linaro.org>>
>     > >         > https://lists.linaro.org/mailman/listinfo/lng-odp
>     > >  _______________________________________________
>     > >         lng-odp mailing list
>     > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>>
>     > > https://lists.linaro.org/mailman/listinfo/lng-odp
>     > >
>     >
>     > _______________________________________________
>     > lng-odp mailing list
>     > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     > https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
diff mbox

Patch

diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c
index e412910..21d58b2 100644
--- a/test/validation/pktio/pktio.c
+++ b/test/validation/pktio/pktio.c
@@ -294,6 +294,12 @@  static odp_pktio_t create_pktio(int iface_idx, odp_pktio_input_mode_t imode,
 {
 	odp_pktio_t pktio;
 	odp_pktio_param_t pktio_param;
+	odp_pktio_capability_t capa;
+	odp_pktio_input_queue_param_t in_queue_param;
+	odp_pktio_output_queue_param_t out_queue_param;
+	odp_bool_t single_rx = 1;
+	odp_bool_t single_tx = 1;
+	int rc;
 	const char *iface = iface_name[iface_idx];
 
 	odp_pktio_param_init(&pktio_param);
@@ -308,6 +314,30 @@  static odp_pktio_t create_pktio(int iface_idx, odp_pktio_input_mode_t imode,
 	CU_ASSERT(odp_pktio_to_u64(pktio) !=
 		  odp_pktio_to_u64(ODP_PKTIO_INVALID));
 
+	rc = odp_pktio_capability(pktio, &capa);
+	CU_ASSERT(rc == 0);
+	CU_ASSERT(single_rx <= (int)capa.max_input_queues);
+	CU_ASSERT(single_tx <= (int)capa.max_output_queues);
+
+	odp_pktio_input_queue_param_init(&in_queue_param);
+	odp_pktio_output_queue_param_init(&out_queue_param);
+
+	if (imode == ODP_PKTIN_MODE_RECV || imode == ODP_PKTIN_MODE_POLL) {
+		in_queue_param.single_user = single_rx;
+		in_queue_param.num_queues  = single_rx;
+		rc = odp_pktio_input_queues_config(pktio, &in_queue_param);
+		CU_ASSERT(rc == 0);
+		CU_ASSERT(odp_pktio_pktin_queues(pktio, NULL, single_rx + 1)
+			  == single_rx);
+
+		out_queue_param.single_user = single_tx;
+		out_queue_param.num_queues  = single_tx;
+		rc = odp_pktio_output_queues_config(pktio, &out_queue_param);
+		CU_ASSERT(rc == 0);
+		CU_ASSERT(odp_pktio_pktout_queues(pktio, NULL, single_tx + 1)
+			  == single_tx);
+	}
+
 	if (wait_for_network)
 		odp_time_wait_ns(ODP_TIME_SEC_IN_NS / 4);