[dpdk-dev,01/20] eventdev: add files for eventmode helper

Message ID 1528478659-15859-2-git-send-email-anoob.joseph@caviumnetworks.com
State Changes Requested, archived
Delegated to: Jerin Jacob
Headers show
Series
  • add eventmode helper functions
Related show

Checks

Context Check Description
ci/Intel-compilation fail apply issues
ci/checkpatch warning coding style issues

Commit Message

Anoob Joseph June 8, 2018, 5:24 p.m.
Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
---
 lib/librte_eventdev/Makefile                        | 2 ++
 lib/librte_eventdev/rte_eventmode_helper.c          | 7 +++++++
 lib/librte_eventdev/rte_eventmode_helper.h          | 6 ++++++
 lib/librte_eventdev/rte_eventmode_helper_internal.h | 6 ++++++
 4 files changed, 21 insertions(+)
 create mode 100644 lib/librte_eventdev/rte_eventmode_helper.c
 create mode 100644 lib/librte_eventdev/rte_eventmode_helper.h
 create mode 100644 lib/librte_eventdev/rte_eventmode_helper_internal.h

Comments

Sunil Kumar Kori June 27, 2018, 6:20 a.m. | #1
Regards
Sunil Kumar

> -----Original Message-----
> From: Anoob Joseph [mailto:anoob.joseph@caviumnetworks.com]
> Sent: Friday, June 8, 2018 10:54 PM
> To: Bruce Richardson <bruce.richardson@intel.com>; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>; Pablo de Lara
> <pablo.de.lara.guarch@intel.com>
> Cc: Anoob Joseph <anoob.joseph@caviumnetworks.com>; Hemant Agrawal
> <hemant.agrawal@nxp.com>; Narayana Prasad
> <narayanaprasad.athreya@caviumnetworks.com>; Nikhil Rao
> <nikhil.rao@intel.com>; Pavan Nikhilesh
> <pbhagavatula@caviumnetworks.com>; Sunil Kumar Kori
> <sunil.kori@nxp.com>; dev@dpdk.org
> Subject: [PATCH 01/20] eventdev: add files for eventmode helper
> 
> Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
> ---
>  lib/librte_eventdev/Makefile                        | 2 ++
>  lib/librte_eventdev/rte_eventmode_helper.c          | 7 +++++++
>  lib/librte_eventdev/rte_eventmode_helper.h          | 6 ++++++
>  lib/librte_eventdev/rte_eventmode_helper_internal.h | 6 ++++++
>  4 files changed, 21 insertions(+)
>  create mode 100644 lib/librte_eventdev/rte_eventmode_helper.c
>  create mode 100644 lib/librte_eventdev/rte_eventmode_helper.h
>  create mode 100644 lib/librte_eventdev/rte_eventmode_helper_internal.h
> 
Having a separate helper library to configure eventdev may be a overhead to the application
as application needs to understand main DPDK API as well as helper routines. 
It can be kept in application as a separate file.
Anoob Joseph June 28, 2018, 10:43 a.m. | #2
Hi Sunil,

On 27-06-2018 11:50, Sunil Kumar Kori wrote:
> External Email
>
> Regards
> Sunil Kumar
>
>> -----Original Message-----
>> From: Anoob Joseph [mailto:anoob.joseph@caviumnetworks.com]
>> Sent: Friday, June 8, 2018 10:54 PM
>> To: Bruce Richardson <bruce.richardson@intel.com>; Jerin Jacob
>> <jerin.jacob@caviumnetworks.com>; Pablo de Lara
>> <pablo.de.lara.guarch@intel.com>
>> Cc: Anoob Joseph <anoob.joseph@caviumnetworks.com>; Hemant Agrawal
>> <hemant.agrawal@nxp.com>; Narayana Prasad
>> <narayanaprasad.athreya@caviumnetworks.com>; Nikhil Rao
>> <nikhil.rao@intel.com>; Pavan Nikhilesh
>> <pbhagavatula@caviumnetworks.com>; Sunil Kumar Kori
>> <sunil.kori@nxp.com>; dev@dpdk.org
>> Subject: [PATCH 01/20] eventdev: add files for eventmode helper
>>
>> Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
>> ---
>>   lib/librte_eventdev/Makefile                        | 2 ++
>>   lib/librte_eventdev/rte_eventmode_helper.c          | 7 +++++++
>>   lib/librte_eventdev/rte_eventmode_helper.h          | 6 ++++++
>>   lib/librte_eventdev/rte_eventmode_helper_internal.h | 6 ++++++
>>   4 files changed, 21 insertions(+)
>>   create mode 100644 lib/librte_eventdev/rte_eventmode_helper.c
>>   create mode 100644 lib/librte_eventdev/rte_eventmode_helper.h
>>   create mode 100644 lib/librte_eventdev/rte_eventmode_helper_internal.h
>>
> Having a separate helper library to configure eventdev may be a overhead to the application
> as application needs to understand main DPDK API as well as helper routines.
> It can be kept in application as a separate file.
For one application we could add a new file, but if we are to enable 
event mode with multiple applications, wouldn't this be duplication of 
lot of code? Considering that I haven't added the required parsing 
routines, the code additions in one application to make it eventdriven 
would be huge.

I do agree that making this as a library poses its own challenges, but 
do you have something better in mind? Another option we can think of is 
making all these changes part of some common headers and then each 
application can include and start using these functions. I'm fine with 
any approach, but we need to consider making at-least l3fwd & 
ipsec-secgw also event driven.

Thanks,
Anoob
Ananyev, Konstantin June 28, 2018, 10:47 a.m. | #3
Hi Anoob,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Joseph, Anoob
> Sent: Thursday, June 28, 2018 11:43 AM
> To: Sunil Kumar Kori <sunil.kori@nxp.com>; Richardson, Bruce <bruce.richardson@intel.com>; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Cc: Hemant Agrawal <hemant.agrawal@nxp.com>; Narayana Prasad <narayanaprasad.athreya@caviumnetworks.com>; Rao, Nikhil
> <nikhil.rao@intel.com>; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 01/20] eventdev: add files for eventmode helper
> 
> Hi Sunil,
> 
> On 27-06-2018 11:50, Sunil Kumar Kori wrote:
> > External Email
> >
> > Regards
> > Sunil Kumar
> >
> >> -----Original Message-----
> >> From: Anoob Joseph [mailto:anoob.joseph@caviumnetworks.com]
> >> Sent: Friday, June 8, 2018 10:54 PM
> >> To: Bruce Richardson <bruce.richardson@intel.com>; Jerin Jacob
> >> <jerin.jacob@caviumnetworks.com>; Pablo de Lara
> >> <pablo.de.lara.guarch@intel.com>
> >> Cc: Anoob Joseph <anoob.joseph@caviumnetworks.com>; Hemant Agrawal
> >> <hemant.agrawal@nxp.com>; Narayana Prasad
> >> <narayanaprasad.athreya@caviumnetworks.com>; Nikhil Rao
> >> <nikhil.rao@intel.com>; Pavan Nikhilesh
> >> <pbhagavatula@caviumnetworks.com>; Sunil Kumar Kori
> >> <sunil.kori@nxp.com>; dev@dpdk.org
> >> Subject: [PATCH 01/20] eventdev: add files for eventmode helper
> >>
> >> Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
> >> ---
> >>   lib/librte_eventdev/Makefile                        | 2 ++
> >>   lib/librte_eventdev/rte_eventmode_helper.c          | 7 +++++++
> >>   lib/librte_eventdev/rte_eventmode_helper.h          | 6 ++++++
> >>   lib/librte_eventdev/rte_eventmode_helper_internal.h | 6 ++++++
> >>   4 files changed, 21 insertions(+)
> >>   create mode 100644 lib/librte_eventdev/rte_eventmode_helper.c
> >>   create mode 100644 lib/librte_eventdev/rte_eventmode_helper.h
> >>   create mode 100644 lib/librte_eventdev/rte_eventmode_helper_internal.h
> >>
> > Having a separate helper library to configure eventdev may be a overhead to the application
> > as application needs to understand main DPDK API as well as helper routines.
> > It can be kept in application as a separate file.
> For one application we could add a new file, but if we are to enable
> event mode with multiple applications, wouldn't this be duplication of
> lot of code? Considering that I haven't added the required parsing
> routines, the code additions in one application to make it eventdriven
> would be huge.
> 
> I do agree that making this as a library poses its own challenges, but
> do you have something better in mind? Another option we can think of is
> making all these changes part of some common headers and then each
> application can include and start using these functions. I'm fine with
> any approach, but we need to consider making at-least l3fwd &
> ipsec-secgw also event driven.

A quick q - does it mean that l3fwd and ipsec-secgw would become event driven only?
Or it would be possible to choose (at startup or at build time) between current and new
behavior?
Konstantin 



> Thanks,
> Anoob
Anoob Joseph June 28, 2018, 10:58 a.m. | #4
Hi Konstantin,

On 28-06-2018 16:17, Ananyev, Konstantin wrote:
> Hi Anoob,
>
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Joseph, Anoob
>> Sent: Thursday, June 28, 2018 11:43 AM
>> To: Sunil Kumar Kori <sunil.kori@nxp.com>; Richardson, Bruce <bruce.richardson@intel.com>; Jerin Jacob
>> <jerin.jacob@caviumnetworks.com>; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
>> Cc: Hemant Agrawal <hemant.agrawal@nxp.com>; Narayana Prasad <narayanaprasad.athreya@caviumnetworks.com>; Rao, Nikhil
>> <nikhil.rao@intel.com>; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>; dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH 01/20] eventdev: add files for eventmode helper
>>
>> Hi Sunil,
>>
>> On 27-06-2018 11:50, Sunil Kumar Kori wrote:
>>> External Email
>>>
>>> Regards
>>> Sunil Kumar
>>>
>>>> -----Original Message-----
>>>> From: Anoob Joseph [mailto:anoob.joseph@caviumnetworks.com]
>>>> Sent: Friday, June 8, 2018 10:54 PM
>>>> To: Bruce Richardson <bruce.richardson@intel.com>; Jerin Jacob
>>>> <jerin.jacob@caviumnetworks.com>; Pablo de Lara
>>>> <pablo.de.lara.guarch@intel.com>
>>>> Cc: Anoob Joseph <anoob.joseph@caviumnetworks.com>; Hemant Agrawal
>>>> <hemant.agrawal@nxp.com>; Narayana Prasad
>>>> <narayanaprasad.athreya@caviumnetworks.com>; Nikhil Rao
>>>> <nikhil.rao@intel.com>; Pavan Nikhilesh
>>>> <pbhagavatula@caviumnetworks.com>; Sunil Kumar Kori
>>>> <sunil.kori@nxp.com>; dev@dpdk.org
>>>> Subject: [PATCH 01/20] eventdev: add files for eventmode helper
>>>>
>>>> Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
>>>> ---
>>>>    lib/librte_eventdev/Makefile                        | 2 ++
>>>>    lib/librte_eventdev/rte_eventmode_helper.c          | 7 +++++++
>>>>    lib/librte_eventdev/rte_eventmode_helper.h          | 6 ++++++
>>>>    lib/librte_eventdev/rte_eventmode_helper_internal.h | 6 ++++++
>>>>    4 files changed, 21 insertions(+)
>>>>    create mode 100644 lib/librte_eventdev/rte_eventmode_helper.c
>>>>    create mode 100644 lib/librte_eventdev/rte_eventmode_helper.h
>>>>    create mode 100644 lib/librte_eventdev/rte_eventmode_helper_internal.h
>>>>
>>> Having a separate helper library to configure eventdev may be a overhead to the application
>>> as application needs to understand main DPDK API as well as helper routines.
>>> It can be kept in application as a separate file.
>> For one application we could add a new file, but if we are to enable
>> event mode with multiple applications, wouldn't this be duplication of
>> lot of code? Considering that I haven't added the required parsing
>> routines, the code additions in one application to make it eventdriven
>> would be huge.
>>
>> I do agree that making this as a library poses its own challenges, but
>> do you have something better in mind? Another option we can think of is
>> making all these changes part of some common headers and then each
>> application can include and start using these functions. I'm fine with
>> any approach, but we need to consider making at-least l3fwd &
>> ipsec-secgw also event driven.
> A quick q - does it mean that l3fwd and ipsec-secgw would become event driven only?
> Or it would be possible to choose (at startup or at build time) between current and new
> behavior?
The mode would be chosen with CL option "--transfer-mode <MODE>". When 
MODE=0, the application will run in existing (poll) mode. When MODE=1, 
the application would run in event mode. In that case only, event 
device, eth rx adapter etc would be initialized and used.

Sample usage: ./l2fwd <EAL options> -- <app options> -- --transfer-mode 
0 #for existing behavior

Right now mode is selected during startup. Do you think build time is 
better?

Thanks,
Anoob
Ananyev, Konstantin June 28, 2018, 11:44 a.m. | #5
> -----Original Message-----
> From: Joseph, Anoob [mailto:Anoob.Joseph@caviumnetworks.com]
> Sent: Thursday, June 28, 2018 11:59 AM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Sunil Kumar Kori <sunil.kori@nxp.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; Jerin Jacob <jerin.jacob@caviumnetworks.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Cc: Hemant Agrawal <hemant.agrawal@nxp.com>; Narayana Prasad <narayanaprasad.athreya@caviumnetworks.com>; Rao, Nikhil
> <nikhil.rao@intel.com>; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 01/20] eventdev: add files for eventmode helper
> 
> Hi Konstantin,
> 
> On 28-06-2018 16:17, Ananyev, Konstantin wrote:
> > Hi Anoob,
> >
> >> -----Original Message-----
> >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Joseph, Anoob
> >> Sent: Thursday, June 28, 2018 11:43 AM
> >> To: Sunil Kumar Kori <sunil.kori@nxp.com>; Richardson, Bruce <bruce.richardson@intel.com>; Jerin Jacob
> >> <jerin.jacob@caviumnetworks.com>; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> >> Cc: Hemant Agrawal <hemant.agrawal@nxp.com>; Narayana Prasad <narayanaprasad.athreya@caviumnetworks.com>; Rao,
> Nikhil
> >> <nikhil.rao@intel.com>; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>; dev@dpdk.org
> >> Subject: Re: [dpdk-dev] [PATCH 01/20] eventdev: add files for eventmode helper
> >>
> >> Hi Sunil,
> >>
> >> On 27-06-2018 11:50, Sunil Kumar Kori wrote:
> >>> External Email
> >>>
> >>> Regards
> >>> Sunil Kumar
> >>>
> >>>> -----Original Message-----
> >>>> From: Anoob Joseph [mailto:anoob.joseph@caviumnetworks.com]
> >>>> Sent: Friday, June 8, 2018 10:54 PM
> >>>> To: Bruce Richardson <bruce.richardson@intel.com>; Jerin Jacob
> >>>> <jerin.jacob@caviumnetworks.com>; Pablo de Lara
> >>>> <pablo.de.lara.guarch@intel.com>
> >>>> Cc: Anoob Joseph <anoob.joseph@caviumnetworks.com>; Hemant Agrawal
> >>>> <hemant.agrawal@nxp.com>; Narayana Prasad
> >>>> <narayanaprasad.athreya@caviumnetworks.com>; Nikhil Rao
> >>>> <nikhil.rao@intel.com>; Pavan Nikhilesh
> >>>> <pbhagavatula@caviumnetworks.com>; Sunil Kumar Kori
> >>>> <sunil.kori@nxp.com>; dev@dpdk.org
> >>>> Subject: [PATCH 01/20] eventdev: add files for eventmode helper
> >>>>
> >>>> Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
> >>>> ---
> >>>>    lib/librte_eventdev/Makefile                        | 2 ++
> >>>>    lib/librte_eventdev/rte_eventmode_helper.c          | 7 +++++++
> >>>>    lib/librte_eventdev/rte_eventmode_helper.h          | 6 ++++++
> >>>>    lib/librte_eventdev/rte_eventmode_helper_internal.h | 6 ++++++
> >>>>    4 files changed, 21 insertions(+)
> >>>>    create mode 100644 lib/librte_eventdev/rte_eventmode_helper.c
> >>>>    create mode 100644 lib/librte_eventdev/rte_eventmode_helper.h
> >>>>    create mode 100644 lib/librte_eventdev/rte_eventmode_helper_internal.h
> >>>>
> >>> Having a separate helper library to configure eventdev may be a overhead to the application
> >>> as application needs to understand main DPDK API as well as helper routines.
> >>> It can be kept in application as a separate file.
> >> For one application we could add a new file, but if we are to enable
> >> event mode with multiple applications, wouldn't this be duplication of
> >> lot of code? Considering that I haven't added the required parsing
> >> routines, the code additions in one application to make it eventdriven
> >> would be huge.
> >>
> >> I do agree that making this as a library poses its own challenges, but
> >> do you have something better in mind? Another option we can think of is
> >> making all these changes part of some common headers and then each
> >> application can include and start using these functions. I'm fine with
> >> any approach, but we need to consider making at-least l3fwd &
> >> ipsec-secgw also event driven.
> > A quick q - does it mean that l3fwd and ipsec-secgw would become event driven only?
> > Or it would be possible to choose (at startup or at build time) between current and new
> > behavior?
> The mode would be chosen with CL option "--transfer-mode <MODE>". When
> MODE=0, the application will run in existing (poll) mode. When MODE=1,
> the application would run in event mode. In that case only, event
> device, eth rx adapter etc would be initialized and used.

Ok sounds good to me.

> 
> Sample usage: ./l2fwd <EAL options> -- <app options> -- --transfer-mode
> 0 #for existing behavior
> 
> Right now mode is selected during startup. Do you think build time is
> better?

No, I am quite happy with suggested approach.
My only concern would be to keep intact existing functionality/performance
and minimize changes in the existing code.
Thanks
Konstantin
Anoob Joseph June 28, 2018, 11:54 a.m. | #6
Hi Konstantin,


On 28-06-2018 17:14, Ananyev, Konstantin wrote:
>
>> -----Original Message-----
>> From: Joseph, Anoob [mailto:Anoob.Joseph@caviumnetworks.com]
>> Sent: Thursday, June 28, 2018 11:59 AM
>> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Sunil Kumar Kori <sunil.kori@nxp.com>; Richardson, Bruce
>> <bruce.richardson@intel.com>; Jerin Jacob <jerin.jacob@caviumnetworks.com>; De Lara Guarch, Pablo
>> <pablo.de.lara.guarch@intel.com>
>> Cc: Hemant Agrawal <hemant.agrawal@nxp.com>; Narayana Prasad <narayanaprasad.athreya@caviumnetworks.com>; Rao, Nikhil
>> <nikhil.rao@intel.com>; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>; dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH 01/20] eventdev: add files for eventmode helper
>>
>> Hi Konstantin,
>>
>> On 28-06-2018 16:17, Ananyev, Konstantin wrote:
>>> Hi Anoob,
>>>
>>>> -----Original Message-----
>>>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Joseph, Anoob
>>>> Sent: Thursday, June 28, 2018 11:43 AM
>>>> To: Sunil Kumar Kori <sunil.kori@nxp.com>; Richardson, Bruce <bruce.richardson@intel.com>; Jerin Jacob
>>>> <jerin.jacob@caviumnetworks.com>; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
>>>> Cc: Hemant Agrawal <hemant.agrawal@nxp.com>; Narayana Prasad <narayanaprasad.athreya@caviumnetworks.com>; Rao,
>> Nikhil
>>>> <nikhil.rao@intel.com>; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>; dev@dpdk.org
>>>> Subject: Re: [dpdk-dev] [PATCH 01/20] eventdev: add files for eventmode helper
>>>>
>>>> Hi Sunil,
>>>>
>>>> On 27-06-2018 11:50, Sunil Kumar Kori wrote:
>>>>> External Email
>>>>>
>>>>> Regards
>>>>> Sunil Kumar
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Anoob Joseph [mailto:anoob.joseph@caviumnetworks.com]
>>>>>> Sent: Friday, June 8, 2018 10:54 PM
>>>>>> To: Bruce Richardson <bruce.richardson@intel.com>; Jerin Jacob
>>>>>> <jerin.jacob@caviumnetworks.com>; Pablo de Lara
>>>>>> <pablo.de.lara.guarch@intel.com>
>>>>>> Cc: Anoob Joseph <anoob.joseph@caviumnetworks.com>; Hemant Agrawal
>>>>>> <hemant.agrawal@nxp.com>; Narayana Prasad
>>>>>> <narayanaprasad.athreya@caviumnetworks.com>; Nikhil Rao
>>>>>> <nikhil.rao@intel.com>; Pavan Nikhilesh
>>>>>> <pbhagavatula@caviumnetworks.com>; Sunil Kumar Kori
>>>>>> <sunil.kori@nxp.com>; dev@dpdk.org
>>>>>> Subject: [PATCH 01/20] eventdev: add files for eventmode helper
>>>>>>
>>>>>> Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
>>>>>> ---
>>>>>>     lib/librte_eventdev/Makefile                        | 2 ++
>>>>>>     lib/librte_eventdev/rte_eventmode_helper.c          | 7 +++++++
>>>>>>     lib/librte_eventdev/rte_eventmode_helper.h          | 6 ++++++
>>>>>>     lib/librte_eventdev/rte_eventmode_helper_internal.h | 6 ++++++
>>>>>>     4 files changed, 21 insertions(+)
>>>>>>     create mode 100644 lib/librte_eventdev/rte_eventmode_helper.c
>>>>>>     create mode 100644 lib/librte_eventdev/rte_eventmode_helper.h
>>>>>>     create mode 100644 lib/librte_eventdev/rte_eventmode_helper_internal.h
>>>>>>
>>>>> Having a separate helper library to configure eventdev may be a overhead to the application
>>>>> as application needs to understand main DPDK API as well as helper routines.
>>>>> It can be kept in application as a separate file.
>>>> For one application we could add a new file, but if we are to enable
>>>> event mode with multiple applications, wouldn't this be duplication of
>>>> lot of code? Considering that I haven't added the required parsing
>>>> routines, the code additions in one application to make it eventdriven
>>>> would be huge.
>>>>
>>>> I do agree that making this as a library poses its own challenges, but
>>>> do you have something better in mind? Another option we can think of is
>>>> making all these changes part of some common headers and then each
>>>> application can include and start using these functions. I'm fine with
>>>> any approach, but we need to consider making at-least l3fwd &
>>>> ipsec-secgw also event driven.
>>> A quick q - does it mean that l3fwd and ipsec-secgw would become event driven only?
>>> Or it would be possible to choose (at startup or at build time) between current and new
>>> behavior?
>> The mode would be chosen with CL option "--transfer-mode <MODE>". When
>> MODE=0, the application will run in existing (poll) mode. When MODE=1,
>> the application would run in event mode. In that case only, event
>> device, eth rx adapter etc would be initialized and used.
> Ok sounds good to me.
>
>> Sample usage: ./l2fwd <EAL options> -- <app options> -- --transfer-mode
>> 0 #for existing behavior
>>
>> Right now mode is selected during startup. Do you think build time is
>> better?
> No, I am quite happy with suggested approach.
> My only concern would be to keep intact existing functionality/performance
> and minimize changes in the existing code.
> Thanks
> Konstantin
>
>
Existing functionality/performance would be intact. That was the whole 
idea with the helper function additions. Following would be a rough 
estimate of the additions,
1. Call to the helper function to print the usage in app_usage
2. Call to the helper function to parse the args and return the 
generated "conf"
3. Call to the helper function for initializing devs based on conf (when 
poll mode, this will return immediately)
4. Launch worker based on conf. When it's poll mode, call the existing 
poll mode worker.

Hope this approach is fine even when extended to other apps.

Thanks,
Anoob
Sunil Kumar Kori July 3, 2018, 6:27 a.m. | #7
Hello Anoob,

Regards
Sunil Kumar

> -----Original Message-----
> From: Joseph, Anoob [mailto:Anoob.Joseph@caviumnetworks.com]
> Sent: Thursday, June 28, 2018 4:13 PM
> To: Sunil Kumar Kori <sunil.kori@nxp.com>; Bruce Richardson
> <bruce.richardson@intel.com>; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>; Pablo de Lara
> <pablo.de.lara.guarch@intel.com>
> Cc: Hemant Agrawal <hemant.agrawal@nxp.com>; Narayana Prasad
> <narayanaprasad.athreya@caviumnetworks.com>; Nikhil Rao
> <nikhil.rao@intel.com>; Pavan Nikhilesh
> <pbhagavatula@caviumnetworks.com>; dev@dpdk.org
> Subject: Re: [PATCH 01/20] eventdev: add files for eventmode helper
> 
> Hi Sunil,
> 
> On 27-06-2018 11:50, Sunil Kumar Kori wrote:
> > External Email
> >
> > Regards
> > Sunil Kumar
> >
> >> -----Original Message-----
> >> From: Anoob Joseph [mailto:anoob.joseph@caviumnetworks.com]
> >> Sent: Friday, June 8, 2018 10:54 PM
> >> To: Bruce Richardson <bruce.richardson@intel.com>; Jerin Jacob
> >> <jerin.jacob@caviumnetworks.com>; Pablo de Lara
> >> <pablo.de.lara.guarch@intel.com>
> >> Cc: Anoob Joseph <anoob.joseph@caviumnetworks.com>; Hemant Agrawal
> >> <hemant.agrawal@nxp.com>; Narayana Prasad
> >> <narayanaprasad.athreya@caviumnetworks.com>; Nikhil Rao
> >> <nikhil.rao@intel.com>; Pavan Nikhilesh
> >> <pbhagavatula@caviumnetworks.com>; Sunil Kumar Kori
> >> <sunil.kori@nxp.com>; dev@dpdk.org
> >> Subject: [PATCH 01/20] eventdev: add files for eventmode helper
> >>
> >> Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
> >> ---
> >>   lib/librte_eventdev/Makefile                        | 2 ++
> >>   lib/librte_eventdev/rte_eventmode_helper.c          | 7 +++++++
> >>   lib/librte_eventdev/rte_eventmode_helper.h          | 6 ++++++
> >>   lib/librte_eventdev/rte_eventmode_helper_internal.h | 6 ++++++
> >>   4 files changed, 21 insertions(+)
> >>   create mode 100644 lib/librte_eventdev/rte_eventmode_helper.c
> >>   create mode 100644 lib/librte_eventdev/rte_eventmode_helper.h
> >>   create mode 100644
> >> lib/librte_eventdev/rte_eventmode_helper_internal.h
> >>
> > Having a separate helper library to configure eventdev may be a
> > overhead to the application as application needs to understand main DPDK API
> as well as helper routines.
> > It can be kept in application as a separate file.
> For one application we could add a new file, but if we are to enable event mode
> with multiple applications, wouldn't this be duplication of lot of code?
> Considering that I haven't added the required parsing routines, the code
> additions in one application to make it eventdriven would be huge.
> 
> I do agree that making this as a library poses its own challenges, but do you have
> something better in mind? Another option we can think of is making all these
> changes part of some common headers and then each application can include
> and start using these functions. I'm fine with any approach, but we need to
> consider making at-least l3fwd & ipsec-secgw also event driven.
> 
With this approach, following may be the challenges:
1. Documentation will be required for user to use eventdev helper library.
2. Helper library should cater all the generic use cases which can be catered from rte_eventdev_*** library.
    If not, supported configuration/use cases should also be documented and should be future evolving with eventdev library enhancements. 


> Thanks,
> Anoob
Anoob Joseph July 3, 2018, 1:13 p.m. | #8
Hi Sunil,

Please see inline.

Thanks,

Anoob


On 03-07-2018 11:57, Sunil Kumar Kori wrote:
> External Email
>
> Hello Anoob,
>
> Regards
> Sunil Kumar
>
>> -----Original Message-----
>> From: Joseph, Anoob [mailto:Anoob.Joseph@caviumnetworks.com]
>> Sent: Thursday, June 28, 2018 4:13 PM
>> To: Sunil Kumar Kori <sunil.kori@nxp.com>; Bruce Richardson
>> <bruce.richardson@intel.com>; Jerin Jacob
>> <jerin.jacob@caviumnetworks.com>; Pablo de Lara
>> <pablo.de.lara.guarch@intel.com>
>> Cc: Hemant Agrawal <hemant.agrawal@nxp.com>; Narayana Prasad
>> <narayanaprasad.athreya@caviumnetworks.com>; Nikhil Rao
>> <nikhil.rao@intel.com>; Pavan Nikhilesh
>> <pbhagavatula@caviumnetworks.com>; dev@dpdk.org
>> Subject: Re: [PATCH 01/20] eventdev: add files for eventmode helper
>>
>> Hi Sunil,
>>
>> On 27-06-2018 11:50, Sunil Kumar Kori wrote:
>>> External Email
>>>
>>> Regards
>>> Sunil Kumar
>>>
>>>> -----Original Message-----
>>>> From: Anoob Joseph [mailto:anoob.joseph@caviumnetworks.com]
>>>> Sent: Friday, June 8, 2018 10:54 PM
>>>> To: Bruce Richardson <bruce.richardson@intel.com>; Jerin Jacob
>>>> <jerin.jacob@caviumnetworks.com>; Pablo de Lara
>>>> <pablo.de.lara.guarch@intel.com>
>>>> Cc: Anoob Joseph <anoob.joseph@caviumnetworks.com>; Hemant Agrawal
>>>> <hemant.agrawal@nxp.com>; Narayana Prasad
>>>> <narayanaprasad.athreya@caviumnetworks.com>; Nikhil Rao
>>>> <nikhil.rao@intel.com>; Pavan Nikhilesh
>>>> <pbhagavatula@caviumnetworks.com>; Sunil Kumar Kori
>>>> <sunil.kori@nxp.com>; dev@dpdk.org
>>>> Subject: [PATCH 01/20] eventdev: add files for eventmode helper
>>>>
>>>> Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
>>>> ---
>>>>    lib/librte_eventdev/Makefile                        | 2 ++
>>>>    lib/librte_eventdev/rte_eventmode_helper.c          | 7 +++++++
>>>>    lib/librte_eventdev/rte_eventmode_helper.h          | 6 ++++++
>>>>    lib/librte_eventdev/rte_eventmode_helper_internal.h | 6 ++++++
>>>>    4 files changed, 21 insertions(+)
>>>>    create mode 100644 lib/librte_eventdev/rte_eventmode_helper.c
>>>>    create mode 100644 lib/librte_eventdev/rte_eventmode_helper.h
>>>>    create mode 100644
>>>> lib/librte_eventdev/rte_eventmode_helper_internal.h
>>>>
>>> Having a separate helper library to configure eventdev may be a
>>> overhead to the application as application needs to understand main DPDK API
>> as well as helper routines.
>>> It can be kept in application as a separate file.
>> For one application we could add a new file, but if we are to enable event mode
>> with multiple applications, wouldn't this be duplication of lot of code?
>> Considering that I haven't added the required parsing routines, the code
>> additions in one application to make it eventdriven would be huge.
>>
>> I do agree that making this as a library poses its own challenges, but do you have
>> something better in mind? Another option we can think of is making all these
>> changes part of some common headers and then each application can include
>> and start using these functions. I'm fine with any approach, but we need to
>> consider making at-least l3fwd & ipsec-secgw also event driven.
>>
> With this approach, following may be the challenges:
> 1. Documentation will be required for user to use eventdev helper library.
> 2. Helper library should cater all the generic use cases which can be catered from rte_eventdev_*** library.
>      If not, supported configuration/use cases should also be documented and should be future evolving with eventdev library enhancements.
The formal documentation is yet to be added. I do agree that we will 
need a sufficiently detailed documentation for the helper. Right now, 
all helper routines are added with enough scope for development in the 
future. This patch series was to float the helper library idea and get 
possible suggestions for improvement.

Is there any other issue with the approach, apart from the documentation?
Sunil Kumar Kori July 4, 2018, 10:49 a.m. | #9
Hello Anoob,

Comments inline.

Regards
Sunil Kumar

> -----Original Message-----
> From: Joseph, Anoob [mailto:Anoob.Joseph@caviumnetworks.com]
> Sent: Tuesday, July 3, 2018 6:44 PM
> To: Sunil Kumar Kori <sunil.kori@nxp.com>; Bruce Richardson
> <bruce.richardson@intel.com>; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>; Pablo de Lara
> <pablo.de.lara.guarch@intel.com>
> Cc: Hemant Agrawal <hemant.agrawal@nxp.com>; Narayana Prasad
> <narayanaprasad.athreya@caviumnetworks.com>; Nikhil Rao
> <nikhil.rao@intel.com>; Pavan Nikhilesh
> <pbhagavatula@caviumnetworks.com>; dev@dpdk.org
> Subject: Re: [PATCH 01/20] eventdev: add files for eventmode helper
> 
> Hi Sunil,
> 
> Please see inline.
> 
> Thanks,
> 
> Anoob
> 
> 
> On 03-07-2018 11:57, Sunil Kumar Kori wrote:
> > External Email
> >
> > Hello Anoob,
> >
> > Regards
> > Sunil Kumar
> >
> >> -----Original Message-----
> >> From: Joseph, Anoob [mailto:Anoob.Joseph@caviumnetworks.com]
> >> Sent: Thursday, June 28, 2018 4:13 PM
> >> To: Sunil Kumar Kori <sunil.kori@nxp.com>; Bruce Richardson
> >> <bruce.richardson@intel.com>; Jerin Jacob
> >> <jerin.jacob@caviumnetworks.com>; Pablo de Lara
> >> <pablo.de.lara.guarch@intel.com>
> >> Cc: Hemant Agrawal <hemant.agrawal@nxp.com>; Narayana Prasad
> >> <narayanaprasad.athreya@caviumnetworks.com>; Nikhil Rao
> >> <nikhil.rao@intel.com>; Pavan Nikhilesh
> >> <pbhagavatula@caviumnetworks.com>; dev@dpdk.org
> >> Subject: Re: [PATCH 01/20] eventdev: add files for eventmode helper
> >>
> >> Hi Sunil,
> >>
> >> On 27-06-2018 11:50, Sunil Kumar Kori wrote:
> >>> External Email
> >>>
> >>> Regards
> >>> Sunil Kumar
> >>>
> >>>> -----Original Message-----
> >>>> From: Anoob Joseph [mailto:anoob.joseph@caviumnetworks.com]
> >>>> Sent: Friday, June 8, 2018 10:54 PM
> >>>> To: Bruce Richardson <bruce.richardson@intel.com>; Jerin Jacob
> >>>> <jerin.jacob@caviumnetworks.com>; Pablo de Lara
> >>>> <pablo.de.lara.guarch@intel.com>
> >>>> Cc: Anoob Joseph <anoob.joseph@caviumnetworks.com>; Hemant
> Agrawal
> >>>> <hemant.agrawal@nxp.com>; Narayana Prasad
> >>>> <narayanaprasad.athreya@caviumnetworks.com>; Nikhil Rao
> >>>> <nikhil.rao@intel.com>; Pavan Nikhilesh
> >>>> <pbhagavatula@caviumnetworks.com>; Sunil Kumar Kori
> >>>> <sunil.kori@nxp.com>; dev@dpdk.org
> >>>> Subject: [PATCH 01/20] eventdev: add files for eventmode helper
> >>>>
> >>>> Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
> >>>> ---
> >>>>    lib/librte_eventdev/Makefile                        | 2 ++
> >>>>    lib/librte_eventdev/rte_eventmode_helper.c          | 7 +++++++
> >>>>    lib/librte_eventdev/rte_eventmode_helper.h          | 6 ++++++
> >>>>    lib/librte_eventdev/rte_eventmode_helper_internal.h | 6 ++++++
> >>>>    4 files changed, 21 insertions(+)
> >>>>    create mode 100644 lib/librte_eventdev/rte_eventmode_helper.c
> >>>>    create mode 100644 lib/librte_eventdev/rte_eventmode_helper.h
> >>>>    create mode 100644
> >>>> lib/librte_eventdev/rte_eventmode_helper_internal.h
> >>>>
> >>> Having a separate helper library to configure eventdev may be a
> >>> overhead to the application as application needs to understand main
> >>> DPDK API
> >> as well as helper routines.
> >>> It can be kept in application as a separate file.
> >> For one application we could add a new file, but if we are to enable
> >> event mode with multiple applications, wouldn't this be duplication of lot of
> code?
> >> Considering that I haven't added the required parsing routines, the
> >> code additions in one application to make it eventdriven would be huge.
> >>
> >> I do agree that making this as a library poses its own challenges,
> >> but do you have something better in mind? Another option we can think
> >> of is making all these changes part of some common headers and then
> >> each application can include and start using these functions. I'm
> >> fine with any approach, but we need to consider making at-least l3fwd &
> ipsec-secgw also event driven.
> >>
> > With this approach, following may be the challenges:
> > 1. Documentation will be required for user to use eventdev helper library.
> > 2. Helper library should cater all the generic use cases which can be catered
> from rte_eventdev_*** library.
> >      If not, supported configuration/use cases should also be documented and
> should be future evolving with eventdev library enhancements.
> The formal documentation is yet to be added. I do agree that we will need a
> sufficiently detailed documentation for the helper. Right now, all helper routines
> are added with enough scope for development in the future. This patch series
> was to float the helper library idea and get possible suggestions for
> improvement.
> 
> Is there any other issue with the approach, apart from the documentation?
No, I am okay with current approach.

Patch

diff --git a/lib/librte_eventdev/Makefile b/lib/librte_eventdev/Makefile
index b3e2546..80a5830 100644
--- a/lib/librte_eventdev/Makefile
+++ b/lib/librte_eventdev/Makefile
@@ -19,6 +19,7 @@  LDLIBS += -lrte_mbuf -lrte_cryptodev
 
 # library source files
 SRCS-y += rte_eventdev.c
+SRCS-y += rte_eventmode_helper.c
 SRCS-y += rte_event_ring.c
 SRCS-y += rte_event_eth_rx_adapter.c
 SRCS-y += rte_event_timer_adapter.c
@@ -29,6 +30,7 @@  SYMLINK-y-include += rte_eventdev.h
 SYMLINK-y-include += rte_eventdev_pmd.h
 SYMLINK-y-include += rte_eventdev_pmd_pci.h
 SYMLINK-y-include += rte_eventdev_pmd_vdev.h
+SYMLINK-y-include += rte_eventmode_helper.h
 SYMLINK-y-include += rte_event_ring.h
 SYMLINK-y-include += rte_event_eth_rx_adapter.h
 SYMLINK-y-include += rte_event_timer_adapter.h
diff --git a/lib/librte_eventdev/rte_eventmode_helper.c b/lib/librte_eventdev/rte_eventmode_helper.c
new file mode 100644
index 0000000..b7ff056
--- /dev/null
+++ b/lib/librte_eventdev/rte_eventmode_helper.c
@@ -0,0 +1,7 @@ 
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Cavium, Inc
+ */
+
+#include <rte_eventmode_helper.h>
+
+#include "rte_eventmode_helper_internal.h"
diff --git a/lib/librte_eventdev/rte_eventmode_helper.h b/lib/librte_eventdev/rte_eventmode_helper.h
new file mode 100644
index 0000000..5d39bd3
--- /dev/null
+++ b/lib/librte_eventdev/rte_eventmode_helper.h
@@ -0,0 +1,6 @@ 
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Cavium, Inc
+ */
+#ifndef _RTE_EVENTMODE_HELPER_H_
+#define _RTE_EVENTMODE_HELPER_H_
+#endif /* _RTE_EVENTMODE_HELPER_H_ */
diff --git a/lib/librte_eventdev/rte_eventmode_helper_internal.h b/lib/librte_eventdev/rte_eventmode_helper_internal.h
new file mode 100644
index 0000000..5b08582
--- /dev/null
+++ b/lib/librte_eventdev/rte_eventmode_helper_internal.h
@@ -0,0 +1,6 @@ 
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Cavium, Inc
+ */
+#ifndef _RTE_EVENTMODE_HELPER_INTERNAL_H_
+#define _RTE_EVENTMODE_HELPER_INTERNAL_H_
+#endif /* _RTE_EVENTMODE_HELPER_INTERNAL_H_ */