> -----Original Message----- > From: Dmitry Eremin-Solenikov [mailto:[email protected]] > Sent: Wednesday, June 14, 2017 8:54 PM > To: Petri Savolainen <[email protected]>; lng- > [email protected] > Subject: Re: [lng-odp] [API-NEXT PATCH v2 2/3] api: ipsec: change IPSEC > result to packet > > On 14.06.2017 17:08, Petri Savolainen wrote: > > Input and output of IPSEC operations are packets. Parameter and > > result structures are cleaner when packet arrays are direct > > parameters to functions. Also API is more flexible for > > application and API pipelining when output is packets with > > additional metadata. Application or API pipeline stages which > > do not care about IPSEC results may work on basic packet metadata. > > > > IPSEC result event type changes from ODP_EVENT_IPSEC_RESULT to > > ODP_EVENT_PACKET. Event subtype (ODP_EVENT_PACKET_IPSEC) can be > > used to identify packets with IPSEC metadata. > > > > Signed-off-by: Petri Savolainen <[email protected]> > > --- > > include/odp/api/spec/ipsec.h | 412 +++++++++++++++++++++--------- > ------- > > platform/linux-generic/odp_ipsec.c | 67 ++++-- > > 2 files changed, 279 insertions(+), 200 deletions(-) > > [skipped] > > > */ > > -int odp_ipsec_in(const odp_ipsec_op_param_t *input, > > - odp_ipsec_op_result_t *output); > > +int odp_ipsec_in(const odp_packet_t pkt_in[], int num_in, > > + odp_packet_t pkt_out[], int *num_out, > > + const odp_ipsec_in_param_t *param); > > Any reason for having arrays here (and further) instead of pointers? >
This matches our API design pattern. We use arrays when passing multiple packets/things in and out: int odp_pktin_recv(odp_pktin_queue_t queue, odp_packet_t packets[], int num); int odp_pktout_send(odp_pktout_queue_t queue, const odp_packet_t packets[], int num); int odp_schedule_multi(odp_queue_t *from, uint64_t wait, odp_event_t events[],int num); int odp_queue_enq_multi(odp_queue_t queue, const odp_event_t events[], int num); -Petri
