On Fri, Apr 28, 2017 at 5:44 AM, Dmitry Eremin-Solenikov < dmitry.ereminsoleni...@linaro.org> wrote:
> On 28.04.2017 12:03, Peltonen, Janne (Nokia - FI/Espoo) wrote: > > > >> -----Original Message----- > >> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of > Bill Fischofer > >> Sent: Friday, April 28, 2017 4:06 AM > >> To: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org> > >> Cc: lng-odp-forward <lng-odp@lists.linaro.org> > >> Subject: Re: [lng-odp] [[RFCv2] 3/4] api: ipsec: change semantics of > odp_ipsec_result > >> function > >> > >> On Thu, Apr 27, 2017 at 7:50 PM, Dmitry Eremin-Solenikov < > >> dmitry.ereminsoleni...@linaro.org> wrote: > >> > >>> On 28.04.2017 03:45, Bill Fischofer wrote: > >>>> > >>>> > >>>> On Thu, Apr 27, 2017 at 5:49 PM, Dmitry Eremin-Solenikov > >>>> <dmitry.ereminsoleni...@linaro.org > >>>> <mailto:dmitry.ereminsoleni...@linaro.org>> wrote: > >>>> > >>>> On 28.04.2017 01:46, Bill Fischofer wrote: > >>>> > > >>>> > > >>>> > On Thu, Apr 27, 2017 at 6:51 AM, Dmitry Eremin-Solenikov > >>>> > <dmitry.ereminsoleni...@linaro.org > >>>> <mailto:dmitry.ereminsoleni...@linaro.org> > >>>> > <mailto:dmitry.ereminsoleni...@linaro.org > >>>> <mailto:dmitry.ereminsoleni...@linaro.org>>> wrote: > > >>>> Also, shouldn't the signature of this API be: > >>>> > >>>> int odp_ipsec_result(odp_ipsec_op_result_t *result, > odp_ipsec_result_t > >>>> ipsec_ev)? > >>> > >>> odp_ipsec_result_t is an internal API used to odp_event code to pass > >>> event to odp_ipsec_result_* handling. Maybe I should drop it > alltogether > >>> and replace with just odp_event_t. What do you think? > >>> > >> > >> odp_event_t is a generic type that encompasses any specific event so > that > >> odp_queue_enq/deq() don't have to be generic functions (since generic > >> functions aren't supported in C99). The events that come out of IPsec > >> operations are odp_ipsec_result_t events so best to use that here, no? > >> > > > > In the ODP API there are only generic events from which one can get > > odp_ipsec_op_result_t objects through this function and that is why > > ipsec_ev should be odp_event_t here. > > > > odp_ipsec_result_t is an internal type used in this implementation > > where ipsec events happen to be of that type. In other implementations > > they may be equal to other types. But from application point of view > > ipsec events are opaque (and thus odp_event_t is all one needs) and > > need to be interpreted through this API function. > > Most probably we should also make odp_crypto_* API to use odp_event_t > and hide odp_crypto_compl_t as internal API. > Packets also arrive as ODP events, but the odp_packet_xxx() APIs take odp_packet_t objects, not odp_event_t. The same for odp_buffer_xxx() APIs taking odp_buffer_t. odp_timeout_xxx() APIs taking odp_timeout_t, and odp_crypto_xxx() APIs taking odp_crypto_xxx_ events. This is an odp_ipsec_xxx API, not an odp_event_xxx API hence it should take an odp_ipsec_xxx type for consistency. > > > It would be more correct to say that the function is valid only > > for events of type ODP_EVENT_IPSEC_RESULT. At API level there is > > no separate type defined as it would not be very useful. > > It is stated so in API docs. > The consistent way to state this (as is done for other APIs) is to have it take an odp_ipsec_xxx type and note that the odp_ipsec_result_from_event() call is only meaningful when given events of type ODP_EVENT_IPSEC_RESULT. > > -- > With best wishes > Dmitry >