[dpdk-dev] [RFC PATCH 0/1] IPSec Inline and look aside crypto offload

Akhil Goyal akhil.goyal at nxp.com
Thu Aug 31 12:52:22 CEST 2017


On 8/31/2017 3:36 PM, Thomas Monjalon wrote:
> 31/08/2017 11:37, Akhil Goyal:
>> On 8/29/2017 8:19 PM, Thomas Monjalon wrote:
>>> 25/07/2017 13:21, Akhil Goyal:
>>>> These are very similar to what Declan proposed with a few additions.
>>>> This can be updated further for other security protocols like MACSec and DTLS
>>>
>>> You should avoid referencing another proposal without
>>> - link to the proposal
>>> - summary of the proposal
>> The link is not mentioned in the cover note but the patches are sent in
>> reply to the same thread that I have mentioned. If we see the complete
>> thread, then there should not be any gap.
>>>
>>> [...]
>>>> Now, after the application configures the session using above APIs, it needs to
>>>> attach the  session with the crypto_op in case the session is configured for
>>>> crypto look aside protocol offload. For IPSec inline/ full protocol offload
>>>> using NIC, the mbuf ol_flags can be set as per the RFC suggested by Boris.
>>>
>>> Again a missing reference (link + summary).
>>>
>>> Even worst, the RFCv2 references this v1 without copying the explanations.
>>> It is too hard to track, or maybe it is cryptic on purpose ;)
>> Same comment, patches are sent within the same thread.
>> Please let me know what is not clear with the thread.
>>
>> Also, I would take care about this comment, that I need to copy the
>> content of previous versions, in my future patches.
>>
>> As this was an RFC series of patches, the content may not 100% stable,
>> and things may get finalized during the course of development across
>> Intel/NXP/Mellanox and may be others.
>>
>> As per my understanding all the information is there in the complete
>> thread and nothing looks cryptic to me.
> 
> I am sure nothing looks cryptic to you :)
> But you are not writing it for yourself. My feedback is that it would be
> easier to read if you summarize the whole status in the same cover letter.
> You are free to consider my feedback or not.
> 
>>> [...]
>>>> Now the application(ipsec-secgw) have 4 paths to decide for the data path.
>>>> 1. Non-protocol offload (currently implemented)
>>>> 2. IPSec inline(only crypto operations using NIC)
>>>> 3. full protocol offload(crypto operations along with all the IPsec header
>>>>      and trailer processing using NIC)
>>>> 4. look aside protocol offload(single-pass encryption and authentication with
>>>>      additional levels of protocol processing offload using crypto device)
>>>
>>> I feel these 4 paths are the most important to discuss.
>>> Unfortunately there are not enough detailed.
>>> Please explain the purpose and implementation of each one.
>> Yes these are 4 paths which can be used for IPSEC.
>> 1. Non protocol offload(RTE_SECURITY_SESS_NONE) - the existing
>> application works on this path, the crypto devices perform the crypto
>> operations without protocol knowledge.
> 
> This mode is when using cryptodev API, right?
> Are you proposing to use rte_security as a simple wrapper of cryptodev
> in the mode RTE_SECURITY_SESS_NONE?
No, rte_security is not a wrapper over cryptodev. It stands parallel to 
cryptodev APIs.
RTE_SECURITY_SESS_NONE denotes that there is no security session 
involved and user will be using the existing functionality i.e. 
non-protocol offload and use crypto devices for crypto operations.

> 
>> 2. Ipsec inline(RTE_SECURITY_SESS_ETH_INLINE_CRYPTO) - This is when the
>> crypto operations are performed by ethernet device instead of crypto
>> device. This is also without protocol knowledge inside the ethernet device
> 
> If the ethernet device can act as a crypto device, this function
> should be offered via the cryptodev interface.
yes this could be thought of but the intent was to keep cryptodev and 
ethdev separate, as this would create confusion and will become 
difficult to manage.
> How is it different from mode RTE_SECURITY_SESS_NONE?
In RTE_SECURITY_SESS_NONE - crypto device is used for crypto operations.
In RTE_SECURITY_SESS_ETH_INLINE_CRYPTO - ethernet device is used for 
crypto operations.
For details of the data path of this mode, refer to the covernote of RFC 
patch from Boris.
http://dpdk.org/ml/archives/dev/2017-July/070793.html

For implementation of this mode, see patches from Radu,
http://dpdk.org/ml/archives/dev/2017-August/073587.html


> Is there direct Rx/Tx involved in this mode?
No the packet will come to the application and will add/remove relevant 
headers and then send the packet to the appropriate eth dev after route 
lookup.

> 
>> 3. full protocol offload(RTE_SECURITY_SESS_ETH_PROTO_OFFLOAD) - This is
>> same as 2 but with protocol support in the ethernet device.
> 
> Is there direct Rx/Tx in RTE_SECURITY_SESS_ETH_PROTO_OFFLOAD?
No, there should not be direct rx/tx as the application will do route 
lookup and send the packet to relevant ethernet interface.
> 
>> 4. look aside protocol offload(RTE_SECURITY_SESS_CRYPTO_PROTO_OFFLOAD) -
>> This is same as 1 but with protocol support in crypto device.
> 
> Who is responsible for Rx/Tx in RTE_SECURITY_SESS_CRYPTO_PROTO_OFFLOAD?
The packet is returned back to the application as in the case of non 
protocol offload. But the application doesnt need to take care of the 
headers and other protocol specifics. It just need to forward the packet 
to the relevent eth dev after route lookup.
Please refer to RFC v2 of the proposal it has more details in the header 
file rte_security.h and the implementation using the ipsec-secgw 
application.
http://dpdk.org/ml/archives/dev/2017-August/072900.html

> 
> [...]
>>>> The application can decide using the below action types
>>>> enum rte_security_session_action_type {
>>>>           RTE_SECURITY_SESS_ETH_INLINE_CRYPTO,
>>>>           /**< Crypto operations are performed by Network interface */
>>>
>>> In this mode, the ethdev port does the same thing as a crypto port?
>>
>> not exactly everything. In this mode, only cipher and auth operations
>> are performed by the eth device. No intelligence about the protocol is
>> done. This is similar to what the current implementation do with the
>> crypto device(Non protocol offload).
> 
> Are you saying no but yes?
> I say "ethdev port does the same thing as a crypto port"
> You say "similar to what the current implementation do with the crypto device"
This is said so because the crypto device may also support protocol offload.
> 
>>>>           RTE_SECURITY_SESS_ETH_PROTO_OFFLOAD,
>>>>           /**< Crypto operations with protocol support are performed
>>>>            * by Network/ethernet device.
>>>>            */
>>>>           RTE_SECURITY_SESS_CRYPTO_PROTO_OFFLOAD,
>>>>           /**< Crypto operations with protocol support are performed
>>>>            * by Crypto device.
>>>>            */
>>>
>>> I guess the difference between ETH_PROTO_OFFLOAD and CRYPTO_PROTO_OFFLOAD
>>> is that we must re-inject packets from CRYPTO_PROTO_OFFLOAD to the NIC?
>>
>> yes
> 
> OK
> Who is responsible to re-inject packets from CRYPTO_PROTO_OFFLOAD to the NIC?
Application will do the forwarding after route lookup
> 
>>>>           RTE_SECURITY_SESS_NONE
>>>> 	/**< Non protocol offload. Application need to manage everything */
>>>> };
>>>
>>> What RTE_SECURITY_SESS_NONE does? It is said to be implemented above.
>>
>> It is non protocol offload mentioned above.
> 
> How is it different from using cryptodev?
No it is not different. It is just to mention that there is no security 
session involved and the application will use the cryptodev.
> 

-Akhil


More information about the dev mailing list