Hi Akhil,
> -----Original Message-----
> From: Akhil Goyal <[email protected]>
> Sent: Monday, September 21, 2020 4:49 PM
> To: Zhang, Roy Fan <[email protected]>; [email protected]; Ananyev,
> Konstantin <[email protected]>; Thomas Monjalon
> <[email protected]>
> Cc: Trahe, Fiona <[email protected]>; Kusztal, ArkadiuszX
> <[email protected]>; Dybkowski, AdamX
> <[email protected]>; Bronowski, PiotrX
> <[email protected]>; Anoob Joseph <[email protected]>
> Subject: RE: [dpdk-dev v9 1/4] cryptodev: add crypto data-path service APIs
>
> Hi Fan,
> > Hi AKhil
> >
> > ...
> > > IMO, the following union can clarify all doubts.
> > > @Ananyev, Konstantin: Any suggestions from your side?
> > >
> > > /** IV and aad information for various use cases. */
> > > union {
> > > /** Supposed to be used with CPU crypto API call. */
> > > struct {
> > > /** array of pointers to IV */
> > > void **iv;
> > > /** array of pointers to AAD */
> > > void **aad;
> > > /** array of pointers to digest */
> > > void **digest;
> > > } cpu_crypto; < or any other useful name>
> > > /* Supposed to be used with HW raw crypto API call. */
> > > struct {
> > > void *cipher_iv_ptr;
> > > rte_iova_t cipher_iv_iova;
> > > void *auth_iv_ptr;
> > > rte_iova_t auth_iv_iova;
> > > void *digest_ptr;
> > > rte_iova_t digest_iova;
> > > } hw_chain;
> > > /* Supposed to be used with HW raw crypto API call. */
> > > struct {
> > > void *iv_ptr;
> > > rte_iova_t iv_iova;
> > > void *digest_ptr;
> > > rte_iova_t digest_iova;
> > > void *aad_ptr;
> > > rte_iova_t aad_iova;
> > > } hw_aead;
> > > };
> > >
> > >
> >
> > The above structure cannot support the array of multiple jobs but a single
> job.
>
> So was your previous structure. Was it not tested before?
Of course it was tested in both DPDK and VPP. The previous structure is an
array to the union additional_data
" union rte_crypto_sym_additional_data *additional_data;". That's why the union
was declared in the first place.
I am ok with the way you propose with "*" in the beginning of every member.
>
> > So we have to use something like
> >
> > struct {
> > void **cipher_iv_ptr;
>
> You can even drop _ptr from the name of each of them.
>
> > rtei_iova_t *cipher_iv_iova;
> > ...
> > } hw_chain;
> > struct {
> > void **iv_ptr;
> > rte_iova_t *iv_iova;
> > ...
> > } hw_aead;
> >
> > Is it ok?
> >
> > Regards,
> > Fan
Regards,
Fan