Hi,

> 
> There is connected interesting question, which should be though wrt. all
> 'packet-consuming' functions. Should such functions always consume and
> free incoming packet? IOW:
> 
>  - odp_crypto_operation() returned -1. Should the app free inbound
> packet afterwards?

The API spec is not crystal clear about it but the way I read it is
that on failure the crypto operation does nothing to the input packets.
So the input packets continue to be owned by the application which needs
take care of them (maybe free them).

> 
>  - odp_ipsec_*() returned -1. Should inbound packets be freed by an app?
> 

I think the IPsec API is slightly more clear since it says that a positive
return value indicates the number of packets consumed by the operation.
So on error none of the input packets were consumed. In that case they
need to be freed or otherwise taken care of by the application which
still owns them.

> Would it be sane for the app to assume that it should re-read inbound
> packet/packet array from params(!) and free all non-INVALID packets (or
> requeque them, etc).

When the IPsec processing function returns a negative status, none
of the input packets were consumed. ODP does not update the operation
parameter struct and the input packet table in there, but there is also
no need to check the status packet-by-packet in that case. Per-packet
errors can occur only when the operation as a whole succeeds. Per-packet
errors are then indicated in the operation result struct.

        Janne


Reply via email to