On 12/11/2014 04:25 PM, Robbie King (robking) wrote: > See [rk] below. > > -----Original Message----- > From: Taras Kondratiuk [mailto:taras.kondrat...@linaro.org] > Sent: Wednesday, December 10, 2014 7:12 PM > To: Robbie King (robking); lng-odp@lists.linaro.org > Subject: Re: [lng-odp] [RFC v2 3/3] Update IPsec example app to use new > completion event constructs > > On 12/10/2014 05:12 PM, Robbie King wrote: >> @@ -761,9 +766,9 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t pkt, >> */ >> static >> pkt_disposition_e do_ipsec_in_finish(odp_packet_t pkt, >> - pkt_ctx_t *ctx) >> + pkt_ctx_t *ctx, >> + odp_crypto_compl_event_t event) >> { >> - odp_buffer_t event; >> odp_crypto_compl_status_t cipher_rc; >> odp_crypto_compl_status_t auth_rc; >> odph_ipv4hdr_t *ip; >> @@ -771,8 +776,8 @@ pkt_disposition_e do_ipsec_in_finish(odp_packet_t pkt, >> int trl_len = 0; >> >> /* Check crypto result */ >> - event = odp_packet_to_buffer(pkt); >> odp_crypto_get_operation_compl_status(event, &cipher_rc, &auth_rc); >> + odp_crypto_release_compl_event(event); > > If operation is done synchronously but out of place, then 'pkt' is an > old packet. > > [rk] The packet handle passed back through the completion event should > be the output packet handle (see below), and in my changes "pkt" is > extracted from the completion event. Are you talking about the > line "event = ...(pkt)" above that was deleted? > > /* Build Result (no HW so no errors) */ > result = get_op_result_from_compl_event(completion_event); > result->magic = OP_RESULT_MAGIC; > result->ctx = ctx; > result->pkt = params->out_pkt; >
Maybe I'm missing something, but in a current patch packet is extracted from completion event only in asynchronous case when packet is dequeued from a queue. In synchronous case PKT_CONTINUE is returned from this function and old packet is used for a next step. -- Taras Kondratiuk _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org http://lists.linaro.org/mailman/listinfo/lng-odp