Ack.
Thanks
Shally

>-----Original Message-----
>From: De Lara Guarch, Pablo [mailto:[email protected]]
>Sent: 26 June 2018 14:50
>To: Verma, Shally <[email protected]>
>Cc: Trahe, Fiona <[email protected]>; [email protected]; [email protected]; 
>Athreya, Narayana Prasad
><[email protected]>; Sahu, Sunila <[email protected]>; 
>Gupta, Ashish <[email protected]>
>Subject: RE: [PATCH v3 2/6] lib/cryptodev: add asym op support in cryptodev
>
>External Email
>
>Hi Shally,
>
>> -----Original Message-----
>> From: Shally Verma [mailto:[email protected]]
>> Sent: Wednesday, May 16, 2018 7:05 AM
>> To: De Lara Guarch, Pablo <[email protected]>
>> Cc: Trahe, Fiona <[email protected]>; [email protected];
>> [email protected]; [email protected]; Sunila Sahu
>> <[email protected]>; Ashish Gupta
>> <[email protected]>
>> Subject: [PATCH v3 2/6] lib/cryptodev: add asym op support in cryptodev
>>
>> Extend DPDK librte_cryptodev to:
>> - define asym op type in rte_crypto_op_type and associated
>>   op pool create/alloc APIs
>> - define asym session and associated session APIs
>>
>> If PMD shows in its feature flag that it supports both sym and asym then it 
>> must
>> support those on all its qps.
>>
>> Changes from v2:
>> - added rte_cryptodev_asym_session_set/get_private_data for app to setup
>> private data in a session as per latest dpdk-next-crypto spec
>> - rename rte_cryptodev_get_asym_session_private_size to be consistent with
>> other API names
>> - correct rte_cryptodev_asym_session_create to pass void** to
>> rte_mempool_get() and add for private_data_size flag
>>
>> Changes from v1
>>     - resolve new line error in librte_cryptodev/rte_cryptodev_version.map
>>
>> Signed-off-by: Shally Verma <[email protected]>
>> Signed-off-by: Sunila Sahu <[email protected]>
>> Signed-off-by: Ashish Gupta <[email protected]>
>
>...
>
>> +int __rte_experimental
>> +rte_cryptodev_asym_session_init(uint8_t dev_id,
>> +             struct rte_cryptodev_asym_session *sess,
>> +             struct rte_crypto_asym_xform *xforms,
>> +             struct rte_mempool *mp)
>> +{
>> +     struct rte_cryptodev *dev;
>> +     uint8_t index;
>> +     int ret;
>> +
>> +     dev = rte_cryptodev_pmd_get_dev(dev_id);
>> +
>> +     if (sess == NULL || xforms == NULL || dev == NULL)
>> +             return -EINVAL;
>> +
>> +     index = dev->driver_id;
>> +
>
>Check if asym_session_configure is implemented in the device, like this:
>
>RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_configure, -ENOTSUP);
>
>This way, there won't be a segmentation fault when using a device that
>does not support asymmetric operations.
>
>> +     if (sess->sess_private_data[index] == NULL) {
>> +             ret = dev->dev_ops->asym_session_configure(dev,
>> +                                                     xforms,
>> +                                                     sess, mp);
>> +             if (ret < 0) {
>> +                     CDEV_LOG_ERR(
>> +                             "dev_id %d failed to configure session 
>> details",
>> +                             dev_id);
>> +                     return ret;
>
>...
>
>> +int __rte_experimental
>> +rte_cryptodev_asym_session_clear(uint8_t dev_id,
>> +             struct rte_cryptodev_asym_session *sess) {
>> +     struct rte_cryptodev *dev;
>> +
>> +     dev = rte_cryptodev_pmd_get_dev(dev_id);
>> +
>> +     if (dev == NULL || sess == NULL)
>> +             return -EINVAL;
>> +
>
>Same as above, add the following.
>
>RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->asym_session_clear, -ENOTSUP);
>
>> +     dev->dev_ops->asym_session_clear(dev, sess);
>> +
>> +     return 0;
>> +}
>
>I will send a patch doing the same for symmetric.
>
>Pablo

Reply via email to