On 12/08/2014 01:30 PM, Bala wrote:
On Friday 05 December 2014 10:16 PM, Taras Kondratiuk wrote:
On 12/05/2014 04:38 PM, Bala Manoharan wrote:
Hi,
In case of synchronous crypto operation the completion event is need
only in case of an error hence the application can check the return code
for failure and get info from completion event buffer only during that
scenario. This will greatly optimize the performance in synchronous
crypto operations.
This RFC aims to eliminate completion event handling by application, so
implementation (if capable) can optimize it and use output packet
instead. Both sync and async implementation will benefit in the same
way.
What you are asking is a separate optimization for sync mode which also
can be achieved on top of this RFC. We can add a note to
odp_crypto_operation() description: "if the function succeeded and it
was synchronous an output packet can be queried without status check".
----------------- implementation ---------------------------
int
odp_crypto_operation(odp_crypto_op_params_t *params,
odp_buffer_t *completion_event)
{
...
process_packet(params->in_pkt, params->out_pkt);
*completion_event = odp_packet_to_buffer(params->out_pkt)
...
return 0;
}
odp_packet_t
odp_crypto_get_operation_compl_packet(odp_buffer_t completion_event)
{
return odp_packet_from_buffer(completion_event);
}
void
odp_crypto_operation_compl_free(odp_buffer_t completion_event)
{
}
----------------- application (odp_ipsec.c)----------------------------
/* Issue crypto request */
if (odp_crypto_operation(¶ms, &completion)) {
/* Call odp_crypto_get_operation_status(completion) if details
are needed */
return PKT_DROP;
}
if (completion != ODP_BUFFER_INVALID) {
*pkt = odp_crypto_get_operation_compl_packet(completion);
return (*pkt != ODP_PACKET_INVALID) ? PKT_CONTINUE :
PKT_DROP:
} else {
return PKT_POSTED;
If buffer<->packet conversion is just casting, then overhead is zero.
Will it work for you?
In Sync crypto operation the output pkt is specified as part of the
odp_crypto_op_params_t by the original design.
Hence it will not required to get the packet from completion event. The
completion event needs to be checked
only during failure and during success the same can be ignored by the
application.
Actually sync/async mode doesn't change a way how output packet is
handled from application point of view. There are two options:
1. Packet is allocated by application and specified in out_pkt.
If operation is finished synchronously and successfully, then output
packet is present in out_pkt.
2. out_pkt is set to ODP_PACKET_INVALID, so implementation allocates it.
In this case output packet have to be obtained as in the code above.
So in general, will it help you to have next to zero overhead?
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp