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(&params, &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.

Regards,
Bala


_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to