On 05/05/2017 11:55 PM, Dmitry Eremin-Solenikov wrote:
On 05.05.2017 15:34, Petri Savolainen wrote:
Added maximum number of packets per result event to make it easy
for application to prepare enough storage for packets.
I'm still not sure that this is a good idea.

It will be good to get agreement here before merging...

Maxim.

Patches 1 and 3 are:
Reviewed-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>

Signed-off-by: Petri Savolainen <petri.savolai...@linaro.org>
---
  include/odp/api/spec/ipsec.h | 15 ++++++++++++---
  1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h
index bec9c561..255fee50 100644
--- a/include/odp/api/spec/ipsec.h
+++ b/include/odp/api/spec/ipsec.h
@@ -270,6 +270,11 @@ typedef struct odp_ipsec_capability_t {
        /** Supported authentication algorithms */
        odp_crypto_auth_algos_t   auths;
+ /** Maximum number of packets in operation result
+        *  (odp_ipsec_op_result_t) per event.
+        */
+       int max_op_res_pkt;
+
  } odp_ipsec_capability_t;
/**
@@ -1283,14 +1288,18 @@ int odp_ipsec_out_inline(const odp_ipsec_op_param_t 
*op_param,
   * type ODP_EVENT_IPSEC_RESULT. It must be freed before the application passes
   * any resulting packet handles to other ODP calls.
   *
+ * The operation returns number of packets in the event. If this is larger than
+ * 'result.num_pkt', all packets did not fit into result struct and
+ * application must call the function again with a larger result struct. IPsec
+ * capability max_op_res_pkt defines the maximum number of packets an event may
+ * contain.
+ *
   * @param[out]    result  Pointer to operation result for output. Maybe NULL, 
if
   *                        application is interested only on the number of
   *                        packets.
   * @param         event   An ODP_EVENT_IPSEC_RESULT event
   *
- * @return Number of packets in the event. If this is larger than
- *         'result.num_pkt', all packets did not fit into result struct and
- *         application must call the function again with a larger result 
struct.
+ * @return Number of packets in the event.
   * @retval <0     On failure
   *
   * @see odp_ipsec_in_enq(), odp_ipsec_out_enq()



Reply via email to