[v2,09/33] crypto/octeontx: adds symmetric capabilities

Message ID 1536033560-21541-10-git-send-email-ajoseph@caviumnetworks.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series Adding Cavium's OcteonTX crypto PMD |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Anoob Joseph Sept. 4, 2018, 3:58 a.m. UTC
  From: Murthy NSSR <nidadavolu.murthy@caviumnetworks.com>

This patch adds the symmetric algorithms capabilities
supported by octeontx crypto hardware.

Signed-off-by: Ankur Dwivedi <ankur.dwivedi@caviumnetworks.com>
Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Signed-off-by: Murthy NSSR <nidadavolu.murthy@caviumnetworks.com>
Signed-off-by: Nithin Dabilpuram <nithin.dabilpuram@caviumnetworks.com>
Signed-off-by: Ragothaman Jayaraman <rjayaraman@caviumnetworks.com>
Signed-off-by: Srisivasubramanian S <ssrinivasan@caviumnetworks.com>
Signed-off-by: Tejasree Kondoj <kondoj.tejasree@caviumnetworks.com>
---
 .../crypto/octeontx/otx_cryptodev_capabilities.h   | 595 +++++++++++++++++++++
 drivers/crypto/octeontx/otx_cryptodev_ops.c        |   6 +
 2 files changed, 601 insertions(+)
 create mode 100644 drivers/crypto/octeontx/otx_cryptodev_capabilities.h
  

Comments

Akhil Goyal Sept. 17, 2018, 12:01 p.m. UTC | #1
> diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c
> index d25f9c1..cc0030e 100644
> --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
> +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
> @@ -10,9 +10,15 @@
>   #include "cpt_pmd_logs.h"
>   
>   #include "otx_cryptodev.h"
> +#include "otx_cryptodev_capabilities.h"
>   #include "otx_cryptodev_hw_access.h"
>   #include "otx_cryptodev_ops.h"
>   
> +static const struct rte_cryptodev_capabilities otx_capabilities[] = {
> +	OTX_SYM_CAPABILITIES,
> +	RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
> +};
> +

better to have otx_capabilities structure defined in the otx_cryptodev_capabilities.h

I don't see any value addition of creating a macro in one file using in a separate structure in another file

which doesn't have anything new in that structure. It would also give checkpatch error.

You can directly have a capability structure without the #define.

>   /* Alarm routines */
>   
>   static void
>
  
Anoob Joseph Sept. 17, 2018, 12:35 p.m. UTC | #2
Hi Akhil,

On 17-09-2018 17:31, Akhil Goyal wrote:
> External Email
>
>> diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c 
>> b/drivers/crypto/octeontx/otx_cryptodev_ops.c
>> index d25f9c1..cc0030e 100644
>> --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
>> +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
>> @@ -10,9 +10,15 @@
>>   #include "cpt_pmd_logs.h"
>>
>>   #include "otx_cryptodev.h"
>> +#include "otx_cryptodev_capabilities.h"
>>   #include "otx_cryptodev_hw_access.h"
>>   #include "otx_cryptodev_ops.h"
>>
>> +static const struct rte_cryptodev_capabilities otx_capabilities[] = {
>> +     OTX_SYM_CAPABILITIES,
>> +     RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
>> +};
>> +
>
> better to have otx_capabilities structure defined in the 
> otx_cryptodev_capabilities.h
>
> I don't see any value addition of creating a macro in one file using 
> in a separate structure in another file
>
> which doesn't have anything new in that structure. It would also give 
> checkpatch error.
>
> You can directly have a capability structure without the #define.
This was the convention followed in qat driver.

https://git.dpdk.org/dpdk/tree/drivers/crypto/qat/qat_sym_capabilities.h

I guess it was to avoid variable definition in header. May be Pablo too 
can comment on this. I'll make the change accordingly.

Thanks,
Anoob
  
Anoob Joseph Sept. 24, 2018, 11:36 a.m. UTC | #3
Hi Fiona,

Can you please comment on this?

We are adding all capabilities of octeontx-crypto PMD as a macro in 
otx_cryptodev_capabilites.h file and then we are using it from 
otx_cryptodev_ops.c. This is the approach followed by QAT crypto PMD. As 
per my understanding, this is to ensure that cryptodev_ops file remains 
simple. For other PMDs with fewer number of capabilities, the structure 
can be populated in the .c file itself without the size of the file 
coming into the picture.

But this would cause checkpatch to report error. Akhil's suggestion is 
to move the entire definition to a header and include it from the .c 
file. I believe, the QAT approach was to avoid variable definition in 
the header. What do you think would be a better approach here?

Thanks,
Anoob
On 17-09-2018 18:05, Joseph, Anoob wrote:
> Hi Akhil,
>
> On 17-09-2018 17:31, Akhil Goyal wrote:
>> External Email
>>
>>> diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c 
>>> b/drivers/crypto/octeontx/otx_cryptodev_ops.c
>>> index d25f9c1..cc0030e 100644
>>> --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
>>> +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
>>> @@ -10,9 +10,15 @@
>>>   #include "cpt_pmd_logs.h"
>>>
>>>   #include "otx_cryptodev.h"
>>> +#include "otx_cryptodev_capabilities.h"
>>>   #include "otx_cryptodev_hw_access.h"
>>>   #include "otx_cryptodev_ops.h"
>>>
>>> +static const struct rte_cryptodev_capabilities otx_capabilities[] = {
>>> +     OTX_SYM_CAPABILITIES,
>>> +     RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
>>> +};
>>> +
>>
>> better to have otx_capabilities structure defined in the 
>> otx_cryptodev_capabilities.h
>>
>> I don't see any value addition of creating a macro in one file using 
>> in a separate structure in another file
>>
>> which doesn't have anything new in that structure. It would also give 
>> checkpatch error.
>>
>> You can directly have a capability structure without the #define.
> This was the convention followed in qat driver.
>
> https://git.dpdk.org/dpdk/tree/drivers/crypto/qat/qat_sym_capabilities.h
>
> I guess it was to avoid variable definition in header. May be Pablo 
> too can comment on this. I'll make the change accordingly.
>
> Thanks,
> Anoob
>
  
Anoob Joseph Sept. 28, 2018, 11:14 a.m. UTC | #4
Hi Fiona,

Did you get a chance to look at this?

Thanks,
Anoob
On 24-09-2018 17:06, Joseph, Anoob wrote:
> Hi Fiona,
>
> Can you please comment on this?
>
> We are adding all capabilities of octeontx-crypto PMD as a macro in 
> otx_cryptodev_capabilites.h file and then we are using it from 
> otx_cryptodev_ops.c. This is the approach followed by QAT crypto PMD. 
> As per my understanding, this is to ensure that cryptodev_ops file 
> remains simple. For other PMDs with fewer number of capabilities, the 
> structure can be populated in the .c file itself without the size of 
> the file coming into the picture.
>
> But this would cause checkpatch to report error. Akhil's suggestion is 
> to move the entire definition to a header and include it from the .c 
> file. I believe, the QAT approach was to avoid variable definition in 
> the header. What do you think would be a better approach here?
>
> Thanks,
> Anoob
> On 17-09-2018 18:05, Joseph, Anoob wrote:
>> Hi Akhil,
>>
>> On 17-09-2018 17:31, Akhil Goyal wrote:
>>> External Email
>>>
>>>> diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c 
>>>> b/drivers/crypto/octeontx/otx_cryptodev_ops.c
>>>> index d25f9c1..cc0030e 100644
>>>> --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
>>>> +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
>>>> @@ -10,9 +10,15 @@
>>>>   #include "cpt_pmd_logs.h"
>>>>
>>>>   #include "otx_cryptodev.h"
>>>> +#include "otx_cryptodev_capabilities.h"
>>>>   #include "otx_cryptodev_hw_access.h"
>>>>   #include "otx_cryptodev_ops.h"
>>>>
>>>> +static const struct rte_cryptodev_capabilities otx_capabilities[] = {
>>>> +     OTX_SYM_CAPABILITIES,
>>>> +     RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
>>>> +};
>>>> +
>>>
>>> better to have otx_capabilities structure defined in the 
>>> otx_cryptodev_capabilities.h
>>>
>>> I don't see any value addition of creating a macro in one file using 
>>> in a separate structure in another file
>>>
>>> which doesn't have anything new in that structure. It would also 
>>> give checkpatch error.
>>>
>>> You can directly have a capability structure without the #define.
>> This was the convention followed in qat driver.
>>
>> https://git.dpdk.org/dpdk/tree/drivers/crypto/qat/qat_sym_capabilities.h
>>
>> I guess it was to avoid variable definition in header. May be Pablo 
>> too can comment on this. I'll make the change accordingly.
>>
>> Thanks,
>> Anoob
>>
>
  
Thomas Monjalon Oct. 1, 2018, 10:05 a.m. UTC | #5
24/09/2018 13:36, Joseph, Anoob:
> Hi Fiona,
> 
> Can you please comment on this?
> 
> We are adding all capabilities of octeontx-crypto PMD as a macro in 
> otx_cryptodev_capabilites.h file and then we are using it from 
> otx_cryptodev_ops.c. This is the approach followed by QAT crypto PMD. As 
> per my understanding, this is to ensure that cryptodev_ops file remains 
> simple. For other PMDs with fewer number of capabilities, the structure 
> can be populated in the .c file itself without the size of the file 
> coming into the picture.
> 
> But this would cause checkpatch to report error. Akhil's suggestion is 
> to move the entire definition to a header and include it from the .c 
> file. I believe, the QAT approach was to avoid variable definition in 
> the header. What do you think would be a better approach here?

I think we should avoid adding some code in a .h file.
And it is even worst when using macros.

I suggest defining the capabilities in a .c file.
If you don't want to bloat the main .c file, you can create a function
defined in another .c file.
  
Fiona Trahe Oct. 8, 2018, 3:59 p.m. UTC | #6
Hi Akhil, Joseph, Thomas,
Just spotted this now.
See below.

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Monday, October 1, 2018 11:05 AM
> To: Joseph, Anoob <Anoob.Joseph@caviumnetworks.com>
> Cc: dev@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>; Akhil Goyal <akhil.goyal@nxp.com>; Anoob
> Joseph <ajoseph@caviumnetworks.com>; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>;
> Murthy NSSR <nidadavolu.murthy@caviumnetworks.com>; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>; Narayana Prasad
> <narayanaprasad.athreya@caviumnetworks.com>; Ankur Dwivedi
> <ankur.dwivedi@caviumnetworks.com>; Nithin Dabilpuram
> <nithin.dabilpuram@caviumnetworks.com>; Ragothaman Jayaraman
> <rjayaraman@caviumnetworks.com>; Srisivasubramanian S <ssrinivasan@caviumnetworks.com>;
> Tejasree Kondoj <kondoj.tejasree@caviumnetworks.com>
> Subject: Re: [dpdk-dev] [PATCH v2 09/33] crypto/octeontx: adds symmetric capabilities
> 
> 24/09/2018 13:36, Joseph, Anoob:
> > Hi Fiona,
> >
> > Can you please comment on this?
> >
> > We are adding all capabilities of octeontx-crypto PMD as a macro in
> > otx_cryptodev_capabilites.h file and then we are using it from
> > otx_cryptodev_ops.c. This is the approach followed by QAT crypto PMD. As
> > per my understanding, this is to ensure that cryptodev_ops file remains
> > simple. For other PMDs with fewer number of capabilities, the structure
> > can be populated in the .c file itself without the size of the file
> > coming into the picture.
> >
> > But this would cause checkpatch to report error. Akhil's suggestion is
> > to move the entire definition to a header and include it from the .c
> > file. I believe, the QAT approach was to avoid variable definition in
> > the header. What do you think would be a better approach here?
> 
> I think we should avoid adding some code in a .h file.
> And it is even worst when using macros.
> 
> I suggest defining the capabilities in a .c file.
> If you don't want to bloat the main .c file, you can create a function
> defined in another .c file.
> 
I can't remember all the variations we tried, but there were a few.
I think the macro works well in this case. 
What is the issue we need to solve?
  
Thomas Monjalon Oct. 8, 2018, 8:27 p.m. UTC | #7
08/10/2018 17:59, Trahe, Fiona:
> Hi Akhil, Joseph, Thomas,
> Just spotted this now.
> See below.
> 
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > 24/09/2018 13:36, Joseph, Anoob:
> > > Hi Fiona,
> > >
> > > Can you please comment on this?
> > >
> > > We are adding all capabilities of octeontx-crypto PMD as a macro in
> > > otx_cryptodev_capabilites.h file and then we are using it from
> > > otx_cryptodev_ops.c. This is the approach followed by QAT crypto PMD. As
> > > per my understanding, this is to ensure that cryptodev_ops file remains
> > > simple. For other PMDs with fewer number of capabilities, the structure
> > > can be populated in the .c file itself without the size of the file
> > > coming into the picture.
> > >
> > > But this would cause checkpatch to report error. Akhil's suggestion is
> > > to move the entire definition to a header and include it from the .c
> > > file. I believe, the QAT approach was to avoid variable definition in
> > > the header. What do you think would be a better approach here?
> > 
> > I think we should avoid adding some code in a .h file.
> > And it is even worst when using macros.
> > 
> > I suggest defining the capabilities in a .c file.
> > If you don't want to bloat the main .c file, you can create a function
> > defined in another .c file.
> > 
> I can't remember all the variations we tried, but there were a few.
> I think the macro works well in this case. 
> What is the issue we need to solve?

It is a discussion about best practice.
My answer is: avoid long macros and avoid instructions in .h file.
  
Anoob Joseph Oct. 10, 2018, 5:39 a.m. UTC | #8
Hi Fiona,

We were following the QAT approach for defining the capabilities. OCTEON 
TX crypto PMD has similar number of capabilities and QAT was the close 
model that we could follow. I can see the advantages of the macro 
approach, but that would give a checkpatch warning. Also, Thomas didn't 
really like the idea of having long macros. So we have fixed it in the 
upstream code.

I would like to understand what would be your approach when you add 
asymmetric support. We are also adding asymmetric support and would like 
to understand how you would be adding, while supporting devices with 
varying capability.

Thanks,
Anoob
On 09-10-2018 01:57, Thomas Monjalon wrote:
> External Email
>
> 08/10/2018 17:59, Trahe, Fiona:
>> Hi Akhil, Joseph, Thomas,
>> Just spotted this now.
>> See below.
>>
>> From: Thomas Monjalon [mailto:thomas@monjalon.net]
>>> 24/09/2018 13:36, Joseph, Anoob:
>>>> Hi Fiona,
>>>>
>>>> Can you please comment on this?
>>>>
>>>> We are adding all capabilities of octeontx-crypto PMD as a macro in
>>>> otx_cryptodev_capabilites.h file and then we are using it from
>>>> otx_cryptodev_ops.c. This is the approach followed by QAT crypto PMD. As
>>>> per my understanding, this is to ensure that cryptodev_ops file remains
>>>> simple. For other PMDs with fewer number of capabilities, the structure
>>>> can be populated in the .c file itself without the size of the file
>>>> coming into the picture.
>>>>
>>>> But this would cause checkpatch to report error. Akhil's suggestion is
>>>> to move the entire definition to a header and include it from the .c
>>>> file. I believe, the QAT approach was to avoid variable definition in
>>>> the header. What do you think would be a better approach here?
>>> I think we should avoid adding some code in a .h file.
>>> And it is even worst when using macros.
>>>
>>> I suggest defining the capabilities in a .c file.
>>> If you don't want to bloat the main .c file, you can create a function
>>> defined in another .c file.
>>>
>> I can't remember all the variations we tried, but there were a few.
>> I think the macro works well in this case.
>> What is the issue we need to solve?
> It is a discussion about best practice.
> My answer is: avoid long macros and avoid instructions in .h file.
>
>
>
  
Joseph, Anoob Oct. 17, 2018, 5:40 a.m. UTC | #9
Hi Fiona,

Reminder!!

Thanks,
Anoob

> -----Original Message-----
> From: Joseph, Anoob
> Sent: 10 October 2018 11:10
> To: Thomas Monjalon <thomas@monjalon.net>; Trahe, Fiona
> <fiona.trahe@intel.com>
> Cc: dev@dpdk.org; Akhil Goyal <akhil.goyal@nxp.com>; Joseph, Anoob
> <Anoob.Joseph@cavium.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>; Murthy, Nidadavolu
> <Nidadavolu.Murthy@cavium.com>; Jacob, Jerin
> <Jerin.JacobKollanukkaran@cavium.com>; Athreya, Narayana Prasad
> <NarayanaPrasad.Athreya@cavium.com>; Dwivedi, Ankur
> <Ankur.Dwivedi@cavium.com>; Dabilpuram, Nithin
> <Nithin.Dabilpuram@cavium.com>; Jayaraman, Ragothaman
> <Ragothaman.Jayaraman@cavium.com>; Srinivasan, Srisivasubramanian
> <Srisivasubramanian.Srinivasan@cavium.com>; Tejasree, Kondoj
> <Kondoj.Tejasree@cavium.com>
> Subject: Re: [dpdk-dev] [PATCH v2 09/33] crypto/octeontx: adds symmetric
> capabilities
> 
> Hi Fiona,
> 
> We were following the QAT approach for defining the capabilities. OCTEON
> TX crypto PMD has similar number of capabilities and QAT was the close
> model that we could follow. I can see the advantages of the macro approach,
> but that would give a checkpatch warning. Also, Thomas didn't really like the
> idea of having long macros. So we have fixed it in the upstream code.
> 
> I would like to understand what would be your approach when you add
> asymmetric support. We are also adding asymmetric support and would like
> to understand how you would be adding, while supporting devices with
> varying capability.
> 
> Thanks,
> Anoob
> On 09-10-2018 01:57, Thomas Monjalon wrote:
> > External Email
> >
> > 08/10/2018 17:59, Trahe, Fiona:
> >> Hi Akhil, Joseph, Thomas,
> >> Just spotted this now.
> >> See below.
> >>
> >> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> >>> 24/09/2018 13:36, Joseph, Anoob:
> >>>> Hi Fiona,
> >>>>
> >>>> Can you please comment on this?
> >>>>
> >>>> We are adding all capabilities of octeontx-crypto PMD as a macro in
> >>>> otx_cryptodev_capabilites.h file and then we are using it from
> >>>> otx_cryptodev_ops.c. This is the approach followed by QAT crypto
> >>>> PMD. As per my understanding, this is to ensure that cryptodev_ops
> >>>> file remains simple. For other PMDs with fewer number of
> >>>> capabilities, the structure can be populated in the .c file itself
> >>>> without the size of the file coming into the picture.
> >>>>
> >>>> But this would cause checkpatch to report error. Akhil's suggestion
> >>>> is to move the entire definition to a header and include it from
> >>>> the .c file. I believe, the QAT approach was to avoid variable
> >>>> definition in the header. What do you think would be a better approach
> here?
> >>> I think we should avoid adding some code in a .h file.
> >>> And it is even worst when using macros.
> >>>
> >>> I suggest defining the capabilities in a .c file.
> >>> If you don't want to bloat the main .c file, you can create a
> >>> function defined in another .c file.
> >>>
> >> I can't remember all the variations we tried, but there were a few.
> >> I think the macro works well in this case.
> >> What is the issue we need to solve?
> > It is a discussion about best practice.
> > My answer is: avoid long macros and avoid instructions in .h file.
> >
> >
> >
  
Fiona Trahe Oct. 19, 2018, 9:09 p.m. UTC | #10
Hi Anoob,

Sorry for the delay, I've been travelling a lot lately.
We don't have an alternative solution - will have to explore options
when we get to that stage of the asym PMD development.
I think the macro works well for this specific case, however we'll 
look for an alternative. At the moment we don't have 
bandwidth to investigate further. If you come up with a 
neat solution we'll be happy to follow it.

Fiona

> -----Original Message-----
> From: Joseph, Anoob [mailto:Anoob.Joseph@cavium.com]
> Sent: Tuesday, October 16, 2018 10:41 PM
> To: Thomas Monjalon <thomas@monjalon.net>; Trahe, Fiona <fiona.trahe@intel.com>
> Cc: dev@dpdk.org; Akhil Goyal <akhil.goyal@nxp.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>; Murthy, Nidadavolu <Nidadavolu.Murthy@cavium.com>; Jacob, Jerin
> <Jerin.JacobKollanukkaran@cavium.com>; Athreya, Narayana Prasad
> <NarayanaPrasad.Athreya@cavium.com>; Dwivedi, Ankur <Ankur.Dwivedi@cavium.com>; Dabilpuram,
> Nithin <Nithin.Dabilpuram@cavium.com>; Jayaraman, Ragothaman
> <Ragothaman.Jayaraman@cavium.com>; Srinivasan, Srisivasubramanian
> <Srisivasubramanian.Srinivasan@cavium.com>; Tejasree, Kondoj <Kondoj.Tejasree@cavium.com>
> Subject: RE: [dpdk-dev] [PATCH v2 09/33] crypto/octeontx: adds symmetric capabilities
> 
> Hi Fiona,
> 
> Reminder!!
> 
> Thanks,
> Anoob
> 
> > -----Original Message-----
> > From: Joseph, Anoob
> > Sent: 10 October 2018 11:10
> > To: Thomas Monjalon <thomas@monjalon.net>; Trahe, Fiona
> > <fiona.trahe@intel.com>
> > Cc: dev@dpdk.org; Akhil Goyal <akhil.goyal@nxp.com>; Joseph, Anoob
> > <Anoob.Joseph@cavium.com>; De Lara Guarch, Pablo
> > <pablo.de.lara.guarch@intel.com>; Murthy, Nidadavolu
> > <Nidadavolu.Murthy@cavium.com>; Jacob, Jerin
> > <Jerin.JacobKollanukkaran@cavium.com>; Athreya, Narayana Prasad
> > <NarayanaPrasad.Athreya@cavium.com>; Dwivedi, Ankur
> > <Ankur.Dwivedi@cavium.com>; Dabilpuram, Nithin
> > <Nithin.Dabilpuram@cavium.com>; Jayaraman, Ragothaman
> > <Ragothaman.Jayaraman@cavium.com>; Srinivasan, Srisivasubramanian
> > <Srisivasubramanian.Srinivasan@cavium.com>; Tejasree, Kondoj
> > <Kondoj.Tejasree@cavium.com>
> > Subject: Re: [dpdk-dev] [PATCH v2 09/33] crypto/octeontx: adds symmetric
> > capabilities
> >
> > Hi Fiona,
> >
> > We were following the QAT approach for defining the capabilities. OCTEON
> > TX crypto PMD has similar number of capabilities and QAT was the close
> > model that we could follow. I can see the advantages of the macro approach,
> > but that would give a checkpatch warning. Also, Thomas didn't really like the
> > idea of having long macros. So we have fixed it in the upstream code.
> >
> > I would like to understand what would be your approach when you add
> > asymmetric support. We are also adding asymmetric support and would like
> > to understand how you would be adding, while supporting devices with
> > varying capability.
> >
> > Thanks,
> > Anoob
> > On 09-10-2018 01:57, Thomas Monjalon wrote:
> > > External Email
> > >
> > > 08/10/2018 17:59, Trahe, Fiona:
> > >> Hi Akhil, Joseph, Thomas,
> > >> Just spotted this now.
> > >> See below.
> > >>
> > >> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > >>> 24/09/2018 13:36, Joseph, Anoob:
> > >>>> Hi Fiona,
> > >>>>
> > >>>> Can you please comment on this?
> > >>>>
> > >>>> We are adding all capabilities of octeontx-crypto PMD as a macro in
> > >>>> otx_cryptodev_capabilites.h file and then we are using it from
> > >>>> otx_cryptodev_ops.c. This is the approach followed by QAT crypto
> > >>>> PMD. As per my understanding, this is to ensure that cryptodev_ops
> > >>>> file remains simple. For other PMDs with fewer number of
> > >>>> capabilities, the structure can be populated in the .c file itself
> > >>>> without the size of the file coming into the picture.
> > >>>>
> > >>>> But this would cause checkpatch to report error. Akhil's suggestion
> > >>>> is to move the entire definition to a header and include it from
> > >>>> the .c file. I believe, the QAT approach was to avoid variable
> > >>>> definition in the header. What do you think would be a better approach
> > here?
> > >>> I think we should avoid adding some code in a .h file.
> > >>> And it is even worst when using macros.
> > >>>
> > >>> I suggest defining the capabilities in a .c file.
> > >>> If you don't want to bloat the main .c file, you can create a
> > >>> function defined in another .c file.
> > >>>
> > >> I can't remember all the variations we tried, but there were a few.
> > >> I think the macro works well in this case.
> > >> What is the issue we need to solve?
> > > It is a discussion about best practice.
> > > My answer is: avoid long macros and avoid instructions in .h file.
> > >
> > >
> > >
  
Joseph, Anoob Oct. 22, 2018, 3:49 a.m. UTC | #11
Hi Fiona,

I do agree that your solution seems to be a neat way for organizing capabilities. But Akhil & Thomas were against that idea and we had to come up with one array with all capabilities. This would not scale well when we start supporting devices with varying capabilities.

If your plan is to follow the same approach for asym support, maybe we will also follow suit and submit the required patches.

@Akhil, Thomas, thoughts?

Thanks,
Anoob

> -----Original Message-----
> From: Trahe, Fiona <fiona.trahe@intel.com>
> Sent: 20 October 2018 02:40
> To: Joseph, Anoob <Anoob.Joseph@cavium.com>; Thomas Monjalon
> <thomas@monjalon.net>
> Cc: dev@dpdk.org; Akhil Goyal <akhil.goyal@nxp.com>; De Lara Guarch,
> Pablo <pablo.de.lara.guarch@intel.com>; Murthy, Nidadavolu
> <Nidadavolu.Murthy@cavium.com>; Jacob, Jerin
> <Jerin.JacobKollanukkaran@cavium.com>; Athreya, Narayana Prasad
> <NarayanaPrasad.Athreya@cavium.com>; Dwivedi, Ankur
> <Ankur.Dwivedi@cavium.com>; Dabilpuram, Nithin
> <Nithin.Dabilpuram@cavium.com>; Jayaraman, Ragothaman
> <Ragothaman.Jayaraman@cavium.com>; Srinivasan, Srisivasubramanian
> <Srisivasubramanian.Srinivasan@cavium.com>; Tejasree, Kondoj
> <Kondoj.Tejasree@cavium.com>; Trahe, Fiona <fiona.trahe@intel.com>
> Subject: RE: [dpdk-dev] [PATCH v2 09/33] crypto/octeontx: adds symmetric
> capabilities
> 
> External Email
> 
> Hi Anoob,
> 
> Sorry for the delay, I've been travelling a lot lately.
> We don't have an alternative solution - will have to explore options when we
> get to that stage of the asym PMD development.
> I think the macro works well for this specific case, however we'll look for an
> alternative. At the moment we don't have bandwidth to investigate further.
> If you come up with a neat solution we'll be happy to follow it.
> 
> Fiona
> 
> > -----Original Message-----
> > From: Joseph, Anoob [mailto:Anoob.Joseph@cavium.com]
> > Sent: Tuesday, October 16, 2018 10:41 PM
> > To: Thomas Monjalon <thomas@monjalon.net>; Trahe, Fiona
> > <fiona.trahe@intel.com>
> > Cc: dev@dpdk.org; Akhil Goyal <akhil.goyal@nxp.com>; De Lara Guarch,
> > Pablo <pablo.de.lara.guarch@intel.com>; Murthy, Nidadavolu
> > <Nidadavolu.Murthy@cavium.com>; Jacob, Jerin
> > <Jerin.JacobKollanukkaran@cavium.com>; Athreya, Narayana Prasad
> > <NarayanaPrasad.Athreya@cavium.com>; Dwivedi, Ankur
> > <Ankur.Dwivedi@cavium.com>; Dabilpuram, Nithin
> > <Nithin.Dabilpuram@cavium.com>; Jayaraman, Ragothaman
> > <Ragothaman.Jayaraman@cavium.com>; Srinivasan, Srisivasubramanian
> > <Srisivasubramanian.Srinivasan@cavium.com>; Tejasree, Kondoj
> > <Kondoj.Tejasree@cavium.com>
> > Subject: RE: [dpdk-dev] [PATCH v2 09/33] crypto/octeontx: adds
> > symmetric capabilities
> >
> > Hi Fiona,
> >
> > Reminder!!
> >
> > Thanks,
> > Anoob
> >
> > > -----Original Message-----
> > > From: Joseph, Anoob
> > > Sent: 10 October 2018 11:10
> > > To: Thomas Monjalon <thomas@monjalon.net>; Trahe, Fiona
> > > <fiona.trahe@intel.com>
> > > Cc: dev@dpdk.org; Akhil Goyal <akhil.goyal@nxp.com>; Joseph, Anoob
> > > <Anoob.Joseph@cavium.com>; De Lara Guarch, Pablo
> > > <pablo.de.lara.guarch@intel.com>; Murthy, Nidadavolu
> > > <Nidadavolu.Murthy@cavium.com>; Jacob, Jerin
> > > <Jerin.JacobKollanukkaran@cavium.com>; Athreya, Narayana Prasad
> > > <NarayanaPrasad.Athreya@cavium.com>; Dwivedi, Ankur
> > > <Ankur.Dwivedi@cavium.com>; Dabilpuram, Nithin
> > > <Nithin.Dabilpuram@cavium.com>; Jayaraman, Ragothaman
> > > <Ragothaman.Jayaraman@cavium.com>; Srinivasan, Srisivasubramanian
> > > <Srisivasubramanian.Srinivasan@cavium.com>; Tejasree, Kondoj
> > > <Kondoj.Tejasree@cavium.com>
> > > Subject: Re: [dpdk-dev] [PATCH v2 09/33] crypto/octeontx: adds
> > > symmetric capabilities
> > >
> > > Hi Fiona,
> > >
> > > We were following the QAT approach for defining the capabilities.
> > > OCTEON TX crypto PMD has similar number of capabilities and QAT was
> > > the close model that we could follow. I can see the advantages of
> > > the macro approach, but that would give a checkpatch warning. Also,
> > > Thomas didn't really like the idea of having long macros. So we have fixed
> it in the upstream code.
> > >
> > > I would like to understand what would be your approach when you add
> > > asymmetric support. We are also adding asymmetric support and would
> > > like to understand how you would be adding, while supporting devices
> > > with varying capability.
> > >
> > > Thanks,
> > > Anoob
> > > On 09-10-2018 01:57, Thomas Monjalon wrote:
> > > > External Email
> > > >
> > > > 08/10/2018 17:59, Trahe, Fiona:
> > > >> Hi Akhil, Joseph, Thomas,
> > > >> Just spotted this now.
> > > >> See below.
> > > >>
> > > >> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > > >>> 24/09/2018 13:36, Joseph, Anoob:
> > > >>>> Hi Fiona,
> > > >>>>
> > > >>>> Can you please comment on this?
> > > >>>>
> > > >>>> We are adding all capabilities of octeontx-crypto PMD as a
> > > >>>> macro in otx_cryptodev_capabilites.h file and then we are using
> > > >>>> it from otx_cryptodev_ops.c. This is the approach followed by
> > > >>>> QAT crypto PMD. As per my understanding, this is to ensure that
> > > >>>> cryptodev_ops file remains simple. For other PMDs with fewer
> > > >>>> number of capabilities, the structure can be populated in the
> > > >>>> .c file itself without the size of the file coming into the picture.
> > > >>>>
> > > >>>> But this would cause checkpatch to report error. Akhil's
> > > >>>> suggestion is to move the entire definition to a header and
> > > >>>> include it from the .c file. I believe, the QAT approach was to
> > > >>>> avoid variable definition in the header. What do you think
> > > >>>> would be a better approach
> > > here?
> > > >>> I think we should avoid adding some code in a .h file.
> > > >>> And it is even worst when using macros.
> > > >>>
> > > >>> I suggest defining the capabilities in a .c file.
> > > >>> If you don't want to bloat the main .c file, you can create a
> > > >>> function defined in another .c file.
> > > >>>
> > > >> I can't remember all the variations we tried, but there were a few.
> > > >> I think the macro works well in this case.
> > > >> What is the issue we need to solve?
> > > > It is a discussion about best practice.
> > > > My answer is: avoid long macros and avoid instructions in .h file.
> > > >
> > > >
> > > >
  
Thomas Monjalon Oct. 22, 2018, 6:51 a.m. UTC | #12
22/10/2018 05:49, Joseph, Anoob:
> Hi Fiona,
> 
> I do agree that your solution seems to be a neat way for organizing capabilities. But Akhil & Thomas were against that idea and we had to come up with one array with all capabilities. This would not scale well when we start supporting devices with varying capabilities.
> 
> If your plan is to follow the same approach for asym support, maybe we will also follow suit and submit the required patches.
> 
> @Akhil, Thomas, thoughts?

Generally speaking, macros are bad.

Why cannot you just write functions?
I don't understand your issue.
  
Joseph, Anoob Oct. 23, 2018, 8:48 a.m. UTC | #13
Hi Thomas,

I had replaced macro with functions when I revised the patch. But when more devices (with varying capabilities) need to be supported, this can get complicated. Macro approach would be simpler in that case. Right now QAT has macros and we would like to stick to what is being followed in the community.

Following would be the use case for macros,

#define QAT_BASE_GEN1_SYM_CAPABILITIES, 	\
{	CAPABILITES,				\
	...					\
}

#define QAT_EXTRA_GEN2_SYM_CAPABILITIES  	\
{	CAPABILITES,				\
	...					\
}

static const struct rte_cryptodev_capabilities qat_gen1_sym_capabilities[] = {
	QAT_BASE_GEN1_SYM_CAPABILITIES,
	RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
};

static const struct rte_cryptodev_capabilities qat_gen2_sym_capabilities[] = {
	QAT_BASE_GEN1_SYM_CAPABILITIES,
	QAT_EXTRA_GEN2_SYM_CAPABILITIES,
	RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
};

Without the macros, we will be required to populate the array there itself and would mean repetition of GEN1 capabilities. Either approach is fine for us, but this could complicate things when we add support for ASYM. Since QAT is already doing this, is it fine to move to that approach as we add support for ASYM? Or if QAT is to follow any other scheme, I'm fine with adopting that as well. Whatever is simple and uniform would work. 

Thanks,
Anoob

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: 22 October 2018 12:22
> To: Joseph, Anoob <Anoob.Joseph@cavium.com>
> Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org; Akhil Goyal
> <akhil.goyal@nxp.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>; Murthy, Nidadavolu
> <Nidadavolu.Murthy@cavium.com>; Jacob, Jerin
> <Jerin.JacobKollanukkaran@cavium.com>; Athreya, Narayana Prasad
> <NarayanaPrasad.Athreya@cavium.com>; Dwivedi, Ankur
> <Ankur.Dwivedi@cavium.com>; Dabilpuram, Nithin
> <Nithin.Dabilpuram@cavium.com>; Jayaraman, Ragothaman
> <Ragothaman.Jayaraman@cavium.com>; Srinivasan, Srisivasubramanian
> <Srisivasubramanian.Srinivasan@cavium.com>; Tejasree, Kondoj
> <Kondoj.Tejasree@cavium.com>
> Subject: Re: [dpdk-dev] [PATCH v2 09/33] crypto/octeontx: adds symmetric
> capabilities
> 
> External Email
> 
> 22/10/2018 05:49, Joseph, Anoob:
> > Hi Fiona,
> >
> > I do agree that your solution seems to be a neat way for organizing
> capabilities. But Akhil & Thomas were against that idea and we had to come up
> with one array with all capabilities. This would not scale well when we start
> supporting devices with varying capabilities.
> >
> > If your plan is to follow the same approach for asym support, maybe we will
> also follow suit and submit the required patches.
> >
> > @Akhil, Thomas, thoughts?
> 
> Generally speaking, macros are bad.
> 
> Why cannot you just write functions?
> I don't understand your issue.
>
  
Thomas Monjalon Oct. 23, 2018, 9:03 a.m. UTC | #14
23/10/2018 10:48, Joseph, Anoob:
> From: Thomas Monjalon <thomas@monjalon.net>
> > 22/10/2018 05:49, Joseph, Anoob:
> > > Hi Fiona,
> > >
> > > I do agree that your solution seems to be a neat way for organizing
> > capabilities. But Akhil & Thomas were against that idea and we had to come up
> > with one array with all capabilities. This would not scale well when we start
> > supporting devices with varying capabilities.
> > >
> > > If your plan is to follow the same approach for asym support, maybe we will
> > also follow suit and submit the required patches.
> > >
> > > @Akhil, Thomas, thoughts?
> > 
> > Generally speaking, macros are bad.
> > 
> > Why cannot you just write functions?
> > I don't understand your issue.
> 
> I had replaced macro with functions when I revised the patch. But when more devices (with varying capabilities) need to be supported, this can get complicated. Macro approach would be simpler in that case. Right now QAT has macros and we would like to stick to what is being followed in the community.
> 
> Following would be the use case for macros,
> 
> #define QAT_BASE_GEN1_SYM_CAPABILITIES, 	\
> {	CAPABILITES,				\
> 	...					\
> }
> 
> #define QAT_EXTRA_GEN2_SYM_CAPABILITIES  	\
> {	CAPABILITES,				\
> 	...					\
> }
> 
> static const struct rte_cryptodev_capabilities qat_gen1_sym_capabilities[] = {
> 	QAT_BASE_GEN1_SYM_CAPABILITIES,
> 	RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
> };
> 
> static const struct rte_cryptodev_capabilities qat_gen2_sym_capabilities[] = {
> 	QAT_BASE_GEN1_SYM_CAPABILITIES,
> 	QAT_EXTRA_GEN2_SYM_CAPABILITIES,
> 	RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
> };
> 
> Without the macros, we will be required to populate the array there itself and would mean repetition of GEN1 capabilities. Either approach is fine for us, but this could complicate things when we add support for ASYM. Since QAT is already doing this, is it fine to move to that approach as we add support for ASYM? Or if QAT is to follow any other scheme, I'm fine with adopting that as well. Whatever is simple and uniform would work.

You can use simple assignments in functions and avoid repetition.

There is a warning in checkpatch about macros.
I think we should be more strict with this warning.
  

Patch

diff --git a/drivers/crypto/octeontx/otx_cryptodev_capabilities.h b/drivers/crypto/octeontx/otx_cryptodev_capabilities.h
new file mode 100644
index 0000000..55ddb14
--- /dev/null
+++ b/drivers/crypto/octeontx/otx_cryptodev_capabilities.h
@@ -0,0 +1,595 @@ 
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Cavium, Inc
+ */
+
+#ifndef _OTX_CRYPTODEV_CAPABILITIES_H_
+#define _OTX_CRYPTODEV_CAPABILITIES_H_
+
+#define OTX_SYM_CAPABILITIES						\
+	{	/* NULL (AUTH) */					\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,	\
+			{.auth = {					\
+				.algo = RTE_CRYPTO_AUTH_NULL,		\
+				.block_size = 1,			\
+				.key_size = {				\
+					.min = 0,			\
+					.max = 0,			\
+					.increment = 0			\
+				},					\
+				.digest_size = {			\
+					.min = 0,			\
+					.max = 0,			\
+					.increment = 0			\
+				},					\
+			}, },						\
+		}, },							\
+	},								\
+	{	/* AES GMAC (AUTH) */					\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,	\
+			{.auth = {					\
+				.algo = RTE_CRYPTO_AUTH_AES_GMAC,	\
+				.block_size = 16,			\
+				.key_size = {				\
+					.min = 16,			\
+					.max = 32,			\
+					.increment = 8			\
+				},					\
+				.digest_size = {			\
+					.min = 8,			\
+					.max = 16,			\
+					.increment = 4			\
+				},					\
+				.iv_size = {				\
+					.min = 12,			\
+					.max = 12,			\
+					.increment = 0			\
+				}					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* KASUMI (F9) */					\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,	\
+			{.auth = {					\
+				.algo = RTE_CRYPTO_AUTH_KASUMI_F9,	\
+				.block_size = 8,			\
+				.key_size = {				\
+					.min = 16,			\
+					.max = 16,			\
+					.increment = 0			\
+				},					\
+				.digest_size = {			\
+					.min = 4,			\
+					.max = 4,			\
+					.increment = 0			\
+				},					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* MD5 */						\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,	\
+			{.auth = {					\
+				.algo = RTE_CRYPTO_AUTH_MD5,		\
+				.block_size = 64,			\
+				.key_size = {				\
+					.min = 0,			\
+					.max = 0,			\
+					.increment = 0			\
+				},					\
+				.digest_size = {			\
+					.min = 1,			\
+					.max = 16,			\
+					.increment = 1			\
+				},					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* MD5 HMAC */						\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,	\
+			{.auth = {					\
+				.algo = RTE_CRYPTO_AUTH_MD5_HMAC,	\
+				.block_size = 64,			\
+				.key_size = {				\
+					.min = 8,			\
+					.max = 64,			\
+					.increment = 8			\
+				},					\
+				.digest_size = {			\
+					.min = 1,			\
+					.max = 16,			\
+					.increment = 1			\
+				},					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* SHA1 */						\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,	\
+			{.auth = {					\
+				.algo = RTE_CRYPTO_AUTH_SHA1,		\
+				.block_size = 64,			\
+				.key_size = {				\
+					.min = 0,			\
+					.max = 0,			\
+					.increment = 0			\
+				},					\
+				.digest_size = {			\
+					.min = 1,			\
+					.max = 20,			\
+					.increment = 1			\
+				},					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* SHA1 HMAC */						\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,	\
+			{.auth = {					\
+				.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,	\
+				.block_size = 64,			\
+				.key_size = {				\
+					.min = 64,			\
+					.max = 64,			\
+					.increment = 0			\
+				},					\
+				.digest_size = {			\
+					.min = 1,			\
+					.max = 20,			\
+					.increment = 1			\
+				},					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* SHA224 */						\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,	\
+			{.auth = {					\
+				.algo = RTE_CRYPTO_AUTH_SHA224,		\
+				.block_size = 64,			\
+					.key_size = {			\
+					.min = 0,			\
+					.max = 0,			\
+					.increment = 0			\
+				},					\
+				.digest_size = {			\
+					.min = 1,			\
+					.max = 28,			\
+					.increment = 1			\
+				},					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* SHA224 HMAC */					\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,	\
+			{.auth = {					\
+				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,	\
+				.block_size = 64,			\
+					.key_size = {			\
+					.min = 64,			\
+					.max = 64,			\
+					.increment = 0			\
+				},					\
+				.digest_size = {			\
+					.min = 1,			\
+					.max = 28,			\
+					.increment = 1			\
+				},					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* SHA256 */						\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,	\
+			{.auth = {					\
+				.algo = RTE_CRYPTO_AUTH_SHA256,		\
+				.block_size = 64,			\
+				.key_size = {				\
+					.min = 0,			\
+					.max = 0,			\
+					.increment = 0			\
+				},					\
+				.digest_size = {			\
+					.min = 1,			\
+					.max = 32,			\
+					.increment = 1			\
+				},					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* SHA256 HMAC */					\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,	\
+			{.auth = {					\
+				.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,	\
+				.block_size = 64,			\
+				.key_size = {				\
+					.min = 64,			\
+					.max = 64,			\
+					.increment = 0			\
+				},					\
+				.digest_size = {			\
+					.min = 1,			\
+					.max = 32,			\
+					.increment = 1			\
+				},					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* SHA384 */						\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,	\
+			{.auth = {					\
+				.algo = RTE_CRYPTO_AUTH_SHA384,		\
+				.block_size = 64,			\
+				.key_size = {				\
+					.min = 0,			\
+					.max = 0,			\
+					.increment = 0			\
+				},					\
+				.digest_size = {			\
+					.min = 1,			\
+					.max = 48,			\
+					.increment = 1			\
+					},				\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* SHA384 HMAC */					\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,	\
+			{.auth = {					\
+				.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,	\
+				.block_size = 64,			\
+				.key_size = {				\
+					.min = 64,			\
+					.max = 64,			\
+					.increment = 0			\
+				},					\
+				.digest_size = {			\
+					.min = 1,			\
+					.max = 48,			\
+					.increment = 1			\
+					},				\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* SHA512 */						\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,	\
+			{.auth = {					\
+				.algo = RTE_CRYPTO_AUTH_SHA512,		\
+				.block_size = 128,			\
+				.key_size = {				\
+					.min = 0,			\
+					.max = 0,			\
+					.increment = 0			\
+				},					\
+				.digest_size = {			\
+					.min = 1,			\
+					.max = 64,			\
+					.increment = 1			\
+				},					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* SHA512 HMAC */					\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,	\
+			{.auth = {					\
+				.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,	\
+				.block_size = 128,			\
+				.key_size = {				\
+					.min = 64,			\
+					.max = 64,			\
+					.increment = 0			\
+				},					\
+				.digest_size = {			\
+					.min = 1,			\
+					.max = 64,			\
+					.increment = 1			\
+				},					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* SNOW 3G (UIA2) */					\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,	\
+			{.auth = {					\
+				.algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2,	\
+				.block_size = 16,			\
+				.key_size = {				\
+					.min = 16,			\
+					.max = 16,			\
+					.increment = 0			\
+				},					\
+				.digest_size = {			\
+					.min = 4,			\
+					.max = 4,			\
+					.increment = 0			\
+				},					\
+				.iv_size = {				\
+					.min = 16,			\
+					.max = 16,			\
+					.increment = 0			\
+				}					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* ZUC (EIA3) */					\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,	\
+			{.auth = {					\
+				.algo = RTE_CRYPTO_AUTH_ZUC_EIA3,	\
+				.block_size = 16,			\
+				.key_size = {				\
+					.min = 16,			\
+					.max = 16,			\
+					.increment = 0			\
+				},					\
+				.digest_size = {			\
+					.min = 4,			\
+					.max = 4,			\
+					.increment = 0			\
+				},					\
+				.iv_size = {				\
+					.min = 16,			\
+					.max = 16,			\
+					.increment = 0			\
+				}					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* NULL (CIPHER) */					\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,	\
+			{.cipher = {					\
+				.algo = RTE_CRYPTO_CIPHER_NULL,		\
+				.block_size = 1,			\
+				.key_size = {				\
+					.min = 0,			\
+					.max = 0,			\
+					.increment = 0			\
+				},					\
+				.iv_size = {				\
+					.min = 0,			\
+					.max = 0,			\
+					.increment = 0			\
+				}					\
+			}, },						\
+		}, }							\
+	},								\
+	{	/* 3DES CBC */						\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,	\
+			{.cipher = {					\
+				.algo = RTE_CRYPTO_CIPHER_3DES_CBC,	\
+				.block_size = 8,			\
+				.key_size = {				\
+					.min = 24,			\
+					.max = 24,			\
+					.increment = 0			\
+				},					\
+				.iv_size = {				\
+					.min = 8,			\
+					.max = 16,			\
+					.increment = 8			\
+				}					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* 3DES ECB */						\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,	\
+			{.cipher = {					\
+				.algo = RTE_CRYPTO_CIPHER_3DES_ECB,	\
+				.block_size = 8,			\
+				.key_size = {				\
+					.min = 24,			\
+					.max = 24,			\
+					.increment = 0			\
+				},					\
+				.iv_size = {				\
+					.min = 0,			\
+					.max = 0,			\
+					.increment = 0			\
+				}					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* AES CBC */						\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,	\
+			{.cipher = {					\
+				.algo = RTE_CRYPTO_CIPHER_AES_CBC,	\
+				.block_size = 16,			\
+				.key_size = {				\
+					.min = 16,			\
+					.max = 32,			\
+					.increment = 8			\
+				},					\
+				.iv_size = {				\
+					.min = 16,			\
+					.max = 16,			\
+					.increment = 0			\
+				}					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* AES CTR */						\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,	\
+			{.cipher = {					\
+				.algo = RTE_CRYPTO_CIPHER_AES_CTR,	\
+				.block_size = 16,			\
+				.key_size = {				\
+					.min = 16,			\
+					.max = 32,			\
+					.increment = 8			\
+				},					\
+				.iv_size = {				\
+					.min = 12,			\
+					.max = 16,			\
+					.increment = 4			\
+				}					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* AES XTS */						\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,	\
+			{.cipher = {					\
+				.algo = RTE_CRYPTO_CIPHER_AES_XTS,	\
+				.block_size = 16,			\
+				.key_size = {				\
+					.min = 32,			\
+					.max = 64,			\
+					.increment = 0			\
+				},					\
+				.iv_size = {				\
+					.min = 16,			\
+					.max = 16,			\
+					.increment = 0			\
+				}					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* DES CBC */						\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,	\
+			{.cipher = {					\
+				.algo = RTE_CRYPTO_CIPHER_DES_CBC,	\
+				.block_size = 8,			\
+				.key_size = {				\
+					.min = 8,			\
+					.max = 8,			\
+					.increment = 0			\
+				},					\
+				.iv_size = {				\
+					.min = 8,			\
+					.max = 8,			\
+					.increment = 0			\
+				}					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* KASUMI (F8) */					\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,	\
+			{.cipher = {					\
+				.algo = RTE_CRYPTO_CIPHER_KASUMI_F8,	\
+				.block_size = 8,			\
+				.key_size = {				\
+					.min = 16,			\
+					.max = 16,			\
+					.increment = 0			\
+				},					\
+				.iv_size = {				\
+					.min = 8,			\
+					.max = 8,			\
+					.increment = 0			\
+				}					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* SNOW 3G (UEA2) */					\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,	\
+			{.cipher = {					\
+				.algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2,	\
+				.block_size = 16,			\
+				.key_size = {				\
+					.min = 16,			\
+					.max = 16,			\
+					.increment = 0			\
+				},					\
+				.iv_size = {				\
+					.min = 16,			\
+					.max = 16,			\
+					.increment = 0			\
+				}					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* ZUC (EEA3) */					\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,	\
+			{.cipher = {					\
+				.algo = RTE_CRYPTO_CIPHER_ZUC_EEA3,	\
+				.block_size = 16,			\
+				.key_size = {				\
+					.min = 16,			\
+					.max = 16,			\
+					.increment = 0			\
+				},					\
+				.iv_size = {				\
+					.min = 16,			\
+					.max = 16,			\
+					.increment = 0			\
+				}					\
+			}, }						\
+		}, }							\
+	},								\
+	{	/* AES GCM */						\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AEAD,	\
+			{.aead = {					\
+				.algo = RTE_CRYPTO_AEAD_AES_GCM,	\
+				.block_size = 16,			\
+				.key_size = {				\
+					.min = 16,			\
+					.max = 32,			\
+					.increment = 8			\
+				},					\
+				.digest_size = {			\
+					.min = 8,			\
+					.max = 16,			\
+					.increment = 4			\
+				},					\
+				.aad_size = {				\
+					.min = 0,			\
+					.max = 1024,			\
+					.increment = 1			\
+				},					\
+				.iv_size = {				\
+					.min = 12,			\
+					.max = 12,			\
+					.increment = 0			\
+				}					\
+			}, }						\
+		}, }							\
+	}
+
+#endif /* _OTX_CRYPTODEV_CAPABILITIES_H_ */
diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c
index d25f9c1..cc0030e 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
+++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
@@ -10,9 +10,15 @@ 
 #include "cpt_pmd_logs.h"
 
 #include "otx_cryptodev.h"
+#include "otx_cryptodev_capabilities.h"
 #include "otx_cryptodev_hw_access.h"
 #include "otx_cryptodev_ops.h"
 
+static const struct rte_cryptodev_capabilities otx_capabilities[] = {
+	OTX_SYM_CAPABILITIES,
+	RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
+};
+
 /* Alarm routines */
 
 static void