This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, api-next has been updated via f9dcbcc3f45fcd6d825c087fc55c631d6b30fa8c (commit) via 845743bd80da73f2a296f24090dfe058d3be7dec (commit) via bbd08a6c0c31c12275089c3134c9e7e58eb0fafa (commit) via 0468dc01b3ae1517d57cf960b511ab066a9d5f05 (commit) via 274a0b016d8c2eed9f065186ad5458c5edb94dad (commit) via 0ce5d628d817003ca0f96beddece3f618f4593bb (commit) via 65a46f66bfcb6b2034d4b0563facc36cbac1e286 (commit) via 441fb964f22b2baaa97641e6f8dda88d32d153f6 (commit) via d5ff31f14e87c815d3a0e0461206aa2687152dd5 (commit) via 09a7800c4c4a093fb962e362952f9cf562d2fc98 (commit) via ddf2ac38b1288283f7b3d7c9e16e36f392685866 (commit) via f4337956ee3be1e783e2389eb5a5ceecb4b0b0ca (commit) via cd1f187d33d65cb54781b5a3c0864229b19c11c3 (commit) via 0d24adacfe17c8e0e1348f19cd8b75b64cb13ccf (commit) from 4bcd15e2bfb839ac0ef6419aa9e7b720958638f7 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit f9dcbcc3f45fcd6d825c087fc55c631d6b30fa8c Author: Bill Fischofer bill.fischofer@linaro.org Date: Tue Jun 13 07:55:15 2017 -0500
doc: userguide: add odp_init_global() documentation for unused features
Update User Guide startup section to include current parameters for odp_init_global() and odp_init_local() as well as optimization hints for unused features.
Signed-off-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/doc/users-guide/users-guide.adoc b/doc/users-guide/users-guide.adoc index ead8da5e..d78e0777 100755 --- a/doc/users-guide/users-guide.adoc +++ b/doc/users-guide/users-guide.adoc @@ -530,20 +530,44 @@ calling the terminate functions should only be done when the application is sure it has closed the ingress and subsequently drained all queues, etc.
=== Startup -The first API that must be called by an ODP application is 'odp_init_global()'. +The first API that must be called by an ODP application is `odp_init_global()`: +[source,c] +----- +int odp_init_global(odp_instance_t *instance, + const odp_init_t *param, + const odp_platform_init_t *platform_param); +----- This takes two pointers. The first, `odp_init_t`, contains ODP initialization data that is platform independent and portable, while the second, `odp_platform_init_t`, is passed unparsed to the implementation to be used for platform specific data that is not yet, or may never be -suitable for the ODP API. +suitable for the ODP API. Each of these parameters is optional and may be +specified as NULL to accept the implementation-defined default initialization +values.
-Calling odp_init_global() establishes the ODP API framework and MUST be +Calling `odp_init_global()` establishes the ODP API framework and MUST be called before any other ODP API may be called. Note that it is only called -once per application. Following global initialization, each thread in turn +once per application. A successful call to `odp_init_global()` returns rc = 0 +and sets the `instance` variable supplied as input to the call to an handle +representing this unique ODP instance. + +The `odp_init_t` parameter is used to specify various customizations to the +ODP environment being established by this call. For example, the caller can +specify the maximum number of worker threads it will use, the thread masks +associated with these threads, as well as whether the default logging or +abort functions are to be overridden with an application-supplied handler. + +The application may also provide optimization hints to the ODP implementation +if it knows that it will never use specific ODP feature sets, such as the +packet classifier or traffic manager. Implementations may use such hints to +provide optimized behavior to applications that are known not to need these +features. + +Following global initialization, each thread in turn calls 'odp_init_local()'. This establishes the local ODP thread context for that thread and MUST be called before other ODP APIs may be -called by that thread. The sole argument to this call is the _thread type_, -which is either `ODP_THREAD_WORKER` or `ODP_THREAD_CONTROL`. +called by that thread. The sole argument to this call is the `instance` +variable returned by `odp_init_global()`.
=== Shutdown Shutdown is the logical reverse of the initialization procedure, with
commit 845743bd80da73f2a296f24090dfe058d3be7dec Author: Bill Fischofer bill.fischofer@linaro.org Date: Tue Jun 13 07:55:14 2017 -0500
validation: init: use odp_init_param_init() in init tests
Provide test coverage for odp_init_param_init() API.
Signed-off-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/common_plat/validation/api/init/init.c b/test/common_plat/validation/api/init/init.c index 61055fad..6f9556d7 100644 --- a/test/common_plat/validation/api/init/init.c +++ b/test/common_plat/validation/api/init/init.c @@ -24,10 +24,10 @@ static int odp_init_log(odp_log_level_t level, const char *fmt, ...); void init_test_odp_init_global_replace_abort(void) { int status; - struct odp_init_t init_data; + odp_init_t init_data; odp_instance_t instance;
- memset(&init_data, 0, sizeof(init_data)); + odp_init_param_init(&init_data); init_data.abort_fn = &odp_init_abort;
status = odp_init_global(&instance, &init_data, NULL); @@ -77,10 +77,10 @@ int init_main_abort(int argc, char *argv[]) void init_test_odp_init_global_replace_log(void) { int status; - struct odp_init_t init_data; + odp_init_t init_data; odp_instance_t instance;
- memset(&init_data, 0, sizeof(init_data)); + odp_init_param_init(&init_data); init_data.log_fn = &odp_init_log;
replacement_logging_used = 0;
commit bbd08a6c0c31c12275089c3134c9e7e58eb0fafa Author: Bill Fischofer bill.fischofer@linaro.org Date: Tue Jun 13 07:55:13 2017 -0500
linux-generic: init: implement odp_init_param_init()
Signed-off-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 31bd7c73..62a1fbc2 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -147,6 +147,11 @@ static int read_configfile(void) return 0; }
+void odp_init_param_init(odp_init_t *param) +{ + memset(param, 0, sizeof(odp_init_t)); +} + int odp_init_global(odp_instance_t *instance, const odp_init_t *params, const odp_platform_init_t *platform_params ODP_UNUSED)
commit 0468dc01b3ae1517d57cf960b511ab066a9d5f05 Author: Bill Fischofer bill.fischofer@linaro.org Date: Tue Jun 13 07:55:12 2017 -0500
api: init: add support for unused features
Add the not_used field to odp_init_t to permit applications to specify that they will not use various ODP features. This may allow implementations to provide optimized behavior.
Also add the odp_init_param_init() API to initialize odp_init_t to default values.
Signed-off-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h index 154cdf8f..e8ec4113 100644 --- a/include/odp/api/spec/init.h +++ b/include/odp/api/spec/init.h @@ -29,6 +29,7 @@ extern "C" {
#include <odp/api/std_types.h> #include <odp/api/hints.h> +#include <odp/api/feature.h> #include <odp/api/thread.h> #include <odp/api/cpumask.h>
@@ -153,9 +154,23 @@ typedef struct odp_init_t { odp_log_func_t log_fn; /** Replacement for the default abort fn */ odp_abort_func_t abort_fn; + /** Unused features. These are hints to the ODP implementation that + * the application will not use any APIs associated with these + * features. Implementations may use this information to provide + * optimized behavior. Results are undefined if applications assert + * that a feature will not be used and it is used anyway. + */ + odp_feature_t not_used; } odp_init_t;
/** + * Initialize the odp_init_t to default values for all fields + * + * @param[out] param Address of the odp_init_t to be initialized + */ +void odp_init_param_init(odp_init_t *param); + +/** * @typedef odp_platform_init_t * ODP platform initialization data *
commit 274a0b016d8c2eed9f065186ad5458c5edb94dad Author: Bill Fischofer bill.fischofer@linaro.org Date: Tue Jun 13 07:55:11 2017 -0500
api: feature: add odp feature bits
Add new odp_feature_t bits that permit other APIs/components to refer to various ODP features.
Signed-off-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/feature.h b/include/odp/api/spec/feature.h new file mode 100644 index 00000000..0cfc141d --- /dev/null +++ b/include/odp/api/spec/feature.h @@ -0,0 +1,69 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP features. + * Define various ODP feature sets that can be referenced by other + * components. + */ + +#ifndef ODP_API_FEATURE_H_ +#define ODP_API_FEATURE_H_ +#include <odp/visibility_begin.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp/api/std_types.h> + +/** @defgroup odp_features ODP_FEATURE + * ODP feature definitions + * @{ + */ + +/** Definition of ODP features */ +typedef union odp_feature_t { + /** All features */ + uint32_t all_feat; + + /** Individual feature bits */ + struct { + /** Classifier APIs, e.g., odp_cls_xxx(), odp_cos_xxx() */ + uint32_t cls:1; + + /** Crypto APIs, e.g., odp_crypto_xxx() */ + uint32_t crypto:1; + + /** IPsec APIs, e.g., odp_ipsec_xxx() */ + uint32_t ipsec:1; + + /** Scheduler APIs, e.g., odp_schedule_xxx() */ + uint32_t schedule:1; + + /** Time APIs are, e.g., odp_time_xxx() */ + uint32_t time:1; + + /** Timer APIs, e.g., odp_timer_xxx(), odp_timeout_xxx() */ + uint32_t timer:1; + + /** Traffic Manager APIs, e.g., odp_tm_xxx() */ + uint32_t tm:1; + } feat; +} odp_feature_t; + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#include <odp/visibility_end.h> +#endif diff --git a/include/odp_api.h b/include/odp_api.h index 8146e024..86232ee1 100644 --- a/include/odp_api.h +++ b/include/odp_api.h @@ -32,6 +32,7 @@ extern "C" { #include <odp/api/barrier.h> #include <odp/api/spinlock.h> #include <odp/api/atomic.h> +#include <odp/api/feature.h> #include <odp/api/init.h> #include <odp/api/system_info.h> #include <odp/api/thread.h> diff --git a/platform/Makefile.inc b/platform/Makefile.inc index 5343bfe1..24f06914 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -32,6 +32,7 @@ odpapispecinclude_HEADERS = \ $(top_srcdir)/include/odp/api/spec/deprecated.h \ $(top_srcdir)/include/odp/api/spec/errno.h \ $(top_srcdir)/include/odp/api/spec/event.h \ + $(top_srcdir)/include/odp/api/spec/feature.h \ $(top_srcdir)/include/odp/api/spec/support.h \ $(top_srcdir)/include/odp/api/spec/hash.h \ $(top_srcdir)/include/odp/api/spec/hints.h \ diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index ecb581c1..e6ff0033 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -38,7 +38,7 @@ odpapiinclude_HEADERS = \ $(srcdir)/include/odp/api/deprecated.h \ $(srcdir)/include/odp/api/errno.h \ $(srcdir)/include/odp/api/event.h \ - $(srcdir)/include/odp/api/support.h \ + $(srcdir)/include/odp/api/feature.h \ $(srcdir)/include/odp/api/hash.h \ $(srcdir)/include/odp/api/hints.h \ $(srcdir)/include/odp/api/init.h \ @@ -59,6 +59,7 @@ odpapiinclude_HEADERS = \ $(srcdir)/include/odp/api/spinlock_recursive.h \ $(srcdir)/include/odp/api/std_clib.h \ $(srcdir)/include/odp/api/std_types.h \ + $(srcdir)/include/odp/api/support.h \ $(srcdir)/include/odp/api/sync.h \ $(srcdir)/include/odp/api/system_info.h \ $(srcdir)/include/odp/api/thread.h \ diff --git a/platform/linux-generic/include/odp/api/feature.h b/platform/linux-generic/include/odp/api/feature.h new file mode 100644 index 00000000..55a86a83 --- /dev/null +++ b/platform/linux-generic/include/odp/api/feature.h @@ -0,0 +1,34 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP features. + */ + +#ifndef ODP_PLAT_FEATURE_H_ +#define ODP_PLAT_FEATURE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** @ingroup odp_feature + * @{ + */ + +/** + * @} + */ + +#include <odp/api/spec/feature.h> + +#ifdef __cplusplus +} +#endif + +#endif
commit 0ce5d628d817003ca0f96beddece3f618f4593bb Author: Petri Savolainen petri.savolainen@linaro.org Date: Fri Jun 16 13:49:40 2017 +0300
api: ipsec: disable event is the last event
Disable event is guaranteed to be the last event for the SA, so that application can use it for SA destroy synchronization.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Balasubramanian Manoharan bala.manoharan@linaro.org Reviewed-by: Nikhil Agarwal Nikhil.agarwal@linaro.org Reviewed-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 372ef462..e602e4b8 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -818,7 +818,10 @@ odp_ipsec_sa_t odp_ipsec_sa_create(const odp_ipsec_sa_param_t *param); * * When in synchronous operation mode, the call will return when it's possible * to destroy the SA. In asynchronous mode, the same is indicated by an - * ODP_EVENT_IPSEC_STATUS event sent to the queue specified for the SA. + * ODP_EVENT_IPSEC_STATUS event sent to the queue specified for the SA. The + * status event is guaranteed to be the last event for the SA, i.e. all + * in-progress operations have completed and resulting events (including status + * events) have been enqueued before it. * * @param sa IPSEC SA to be disabled *
commit 65a46f66bfcb6b2034d4b0563facc36cbac1e286 Author: Petri Savolainen petri.savolainen@linaro.org Date: Fri Jun 16 13:49:39 2017 +0300
api: ipsec: change IPSEC result to packet
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 petri.savolainen@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Balasubramanian Manoharan bala.manoharan@linaro.org Reviewed-by: Nikhil Agarwal Nikhil.agarwal@linaro.org Reviewed-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 65f0b066..372ef462 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -552,16 +552,18 @@ typedef enum odp_ipsec_frag_mode_t {
/** * Packet lookup mode + * + * Lookup mode controls how an SA participates in SA lookup offload. + * Inbound operations perform SA lookup if application does not provide a SA as + * a parameter. In inline mode, a lookup miss directs the packet back to normal + * packet input interface processing. SA lookup failure status (error.sa_lookup) + * is reported through odp_ipsec_packet_result_t. */ typedef enum odp_ipsec_lookup_mode_t { - /** Inbound SA lookup is disabled. */ + /** Inbound SA lookup is disabled for the SA. */ ODP_IPSEC_LOOKUP_DISABLED = 0,
- /** Inbound SA lookup is enabled. Lookup matches only SPI value. - * In inline mode, a lookup miss directs the packet back to normal - * packet input interface processing. In other modes, the SA lookup - * failure status (error.sa_lookup) is reported through - * odp_ipsec_packet_result_t. */ + /** Inbound SA lookup is enabled. Lookup matches only SPI value. */ ODP_IPSEC_LOOKUP_SPI,
/** Inbound SA lookup is enabled. Lookup matches both SPI value and @@ -572,13 +574,13 @@ typedef enum odp_ipsec_lookup_mode_t { } odp_ipsec_lookup_mode_t;
/** - * Result event pipeline configuration + * IPSEC pipeline configuration */ typedef enum odp_ipsec_pipeline_t { - /** Do not pipeline */ + /** Do not pipeline. Send all resulting events to the application. */ ODP_IPSEC_PIPELINE_NONE = 0,
- /** Send IPSEC result events to the classifier. + /** Send resulting packets to the classifier * * IPSEC capability 'pipeline_cls' determines if pipelined * classification is supported. */ @@ -659,9 +661,9 @@ typedef struct odp_ipsec_sa_param_t { */ uint32_t mtu;
- /** Select pipelined destination for IPSEC result events + /** Select pipelined destination for resulting events * - * Asynchronous and inline modes generate result events. Select where + * Asynchronous and inline modes generate events. Select where * those events are sent. Inbound SAs may choose to use pipelined * classification. The default value is ODP_IPSEC_PIPELINE_NONE. */ @@ -670,18 +672,19 @@ typedef struct odp_ipsec_sa_param_t { /** Destination queue for IPSEC events * * Operations in asynchronous or inline mode enqueue resulting events - * into this queue. + * into this queue. The default queue ('default_queue') is used when + * SA is not known. */ odp_queue_t dest_queue;
- /** Classifier destination CoS for IPSEC result events + /** Classifier destination CoS for resulting packets * - * Result events for successfully decapsulated packets are sent to - * classification through this CoS. Other result events are sent to - * 'dest_queue'. This field is considered only when 'pipeline' is + * Successfully decapsulated packets are sent to classification + * through this CoS. Other resulting events are sent to 'dest_queue'. + * This field is considered only when 'pipeline' is * ODP_IPSEC_PIPELINE_CLS. The CoS must not be shared between any pktio * interface default CoS. The maximum number of different CoS supported - * is defined by IPsec capability max_cls_cos. + * is defined by IPSEC capability max_cls_cos. */ odp_cos_t dest_cos;
@@ -850,17 +853,6 @@ int odp_ipsec_sa_destroy(odp_ipsec_sa_t sa); */ uint64_t odp_ipsec_sa_to_u64(odp_ipsec_sa_t sa);
-/** - * IPSEC operation level options - * - * These may be used to override some SA level options - */ -typedef struct odp_ipsec_op_opt_t { - /** Fragmentation mode */ - odp_ipsec_frag_mode_t mode; - -} odp_ipsec_op_opt_t; - /** IPSEC operation status has no errors */ #define ODP_IPSEC_OK 0
@@ -870,7 +862,8 @@ typedef struct odp_ipsec_op_status_t { union { /** Error flags */ struct { - /** Protocol error. Not a valid ESP or AH packet. */ + /** Protocol error. Not a valid ESP or AH packet, + * packet data length error, etc. */ uint32_t proto : 1;
/** SA lookup failed */ @@ -934,41 +927,70 @@ typedef struct odp_ipsec_op_status_t { } odp_ipsec_op_status_t;
/** - * IPSEC operation input parameters + * IPSEC outbound operation options + * + * These may be used to override some SA level options */ -typedef struct odp_ipsec_op_param_t { - /** Number of packets to be processed */ - int num_pkt; +typedef struct odp_ipsec_out_opt_t { + /** Fragmentation mode */ + odp_ipsec_frag_mode_t mode; + +} odp_ipsec_out_opt_t;
+/** + * IPSEC outbound operation parameters + */ +typedef struct odp_ipsec_out_param_t { /** Number of SAs * + * Outbound IPSEC operation needs SA from application. Use either + * single SA for all packets, or a SA per packet. + * * Valid values are: - * * 0: No SAs (default) - * * 1: Single SA for all packets - * * num_pkt: SA per packet + * - 1: Single SA for all packets + * - N: A SA per packet. N must match the number of packets. */ int num_sa;
- /** Number of operation options + /** Number of outbound operation options * * Valid values are: - * * 0: No options (default) - * * 1: Single option for all packets - * * num_pkt: An option per packet + * - 0: No options + * - 1: Single option for all packets + * - N: An option per packet. N must match the number of packets. */ int num_opt;
- /** Pointer to an array of packets + /** Pointer to an array of IPSEC SAs */ + odp_ipsec_sa_t *sa; + + /** Pointer to an array of outbound operation options + * + * May be NULL when num_opt is zero. + */ + odp_ipsec_out_opt_t *opt; + +} odp_ipsec_out_param_t; + +/** + * IPSEC inbound operation parameters + */ +typedef struct odp_ipsec_in_param_t { + /** Number of SAs * - * Each packet must have a valid value for these metadata: - * * L3 offset: Offset to the first byte of the (outmost) IP header - * * L4 offset: For inbound direction, when udp_encap is enabled - - * offset to the first byte of the encapsulating UDP - * header + * Inbound IPSEC operation processes a packet using the SA provided by + * the application. If the application does not provide an SA, the + * operation searches for the SA by matching the input packet with all + * inbound SAs according to the lookup mode (odp_ipsec_lookup_mode_t) + * configured in each SA. When passing SAs, use either single SA for + * all packets, or a SA per packet. * - * @see odp_packet_l3_offset(), odp_packet_l4_offset() + * Valid values are: + * - 0: No SAs. SA lookup is done for all packets. + * - 1: Single SA for all packets + * - N: A SA per packet. N must match the number of packets. */ - odp_packet_t *pkt; + int num_sa;
/** Pointer to an array of IPSEC SAs * @@ -976,18 +998,12 @@ typedef struct odp_ipsec_op_param_t { */ odp_ipsec_sa_t *sa;
- /** Pointer to an array of operation options - * - * May be NULL when num_opt is zero. - */ - odp_ipsec_op_opt_t *opt; - -} odp_ipsec_op_param_t; +} odp_ipsec_in_param_t;
/** * Outbound inline IPSEC operation parameters */ -typedef struct odp_ipsec_inline_op_param_t { +typedef struct odp_ipsec_out_inline_param_t { /** Packet output interface for inline output operation * * Outbound inline IPSEC operation uses this packet IO interface to @@ -1011,7 +1027,7 @@ typedef struct odp_ipsec_inline_op_param_t { uint32_t len; } outer_hdr;
-} odp_ipsec_inline_op_param_t; +} odp_ipsec_out_inline_param_t;
/** * IPSEC operation result for a packet @@ -1020,16 +1036,6 @@ typedef struct odp_ipsec_packet_result_t { /** IPSEC operation status */ odp_ipsec_op_status_t status;
- /** Number of output packets created from the corresponding input packet - * - * Without fragmentation offload this is always one. However, if the - * input packet was fragmented during the operation this is larger than - * one for the first returned fragment and zero for the rest of the - * fragments. All the fragments (of the same source packet) are stored - * consecutively in the 'pkt' array. - */ - int num_out; - /** IPSEC SA that was used to create the packet * * Operation updates this SA handle value, when SA look up is performed @@ -1040,7 +1046,8 @@ typedef struct odp_ipsec_packet_result_t { odp_ipsec_sa_t sa;
/** Packet outer header status before inbound inline processing. - * This is valid only when status.flag.inline_mode is set. + * This is valid only when outer headers are retained + * (see odp_ipsec_inbound_config_t) and status.flag.inline_mode is set. */ struct { /** Points to the first byte of retained outer headers. These @@ -1048,7 +1055,7 @@ typedef struct odp_ipsec_packet_result_t { * implementation specific memory space. Since the memory space * may overlap with e.g. packet head/tailroom, the content * becomes invalid if packet data storage is modified in - * anyway. The memory space may not be sharable to other + * any way. The memory space may not be shareable to other * threads. */ uint8_t *ptr;
@@ -1059,51 +1066,6 @@ typedef struct odp_ipsec_packet_result_t { } odp_ipsec_packet_result_t;
/** - * IPSEC operation results - */ -typedef struct odp_ipsec_op_result_t { - /** Number of packets - * - * Application sets this to the maximum number of packets the operation - * may output (number of elements in 'pkt' and 'res' arrays). - * The operation updates it with the actual number of packets - * outputted. - */ - int num_pkt; - - /** Pointer to an array of packets - * - * Operation outputs packets into this array. The array must have - * at least 'num_pkt' elements. - * - * Each successfully transformed packet has a valid value for these - * metadata regardless of the inner packet parse configuration. - * (odp_ipsec_inbound_config_t): - * * L3 offset: Offset to the first byte of the (outmost) IP header - * * pktio: For inbound inline IPSEC processed packets, original - * packet input interface - * - * Other metadata for parse results and error checks depend on - * configuration (selected parse and error check levels). - */ - odp_packet_t *pkt; - - /** Pointer to an array of per packet operation results - * - * Operation outputs results for each outputted packet into this array. - * The array must have at least 'num_pkt' elements. The results include - * operation status and packet form information for each outputted - * packet. - * - * For example, some packets may not have been transformed due to - * an error, but the original packet is returned with appropriate - * packet result information instead. - */ - odp_ipsec_packet_result_t *res; - -} odp_ipsec_op_result_t; - -/** * IPSEC status ID */ typedef enum odp_ipsec_status_id_t { @@ -1136,20 +1098,33 @@ typedef struct odp_ipsec_status_t { * * This operation does inbound IPSEC processing in synchronous mode * (ODP_IPSEC_OP_MODE_SYNC). A successful operation returns the number of - * packets consumed and outputs a new packet handle as well as an operation - * result for each outputted packet. The operation does not modify packets that - * it does not consume. It cannot consume all input packets if 'output.num_pkt' - * is smaller than 'input.num_pkt'. + * packets consumed and outputs a new packet handle for each outputted packet. + * Outputted packets contain IPSEC result metadata (odp_ipsec_packet_result_t), + * which should be checked for transformation errors, etc. Outputted packets + * with error status have not been transformed but the original packet is + * returned. The operation does not modify packets that it does not consume. + * It cannot consume all input packets if 'num_out' is smaller than 'num_in'. * * Packet context pointer and user area content are copied from input to output * packets. Output packets are allocated from the same pool(s) as input packets. * - * When 'input.num_sa' is zero, this operation performs SA look up for each + * When 'param.num_sa' is zero, this operation performs SA look up for each * packet. Otherwise, application must provide the SA(s) as part of operation - * input parameters (odp_ipsec_op_param_t). The operation outputs used SA(s) as - * part of per packet operation results (odp_ipsec_packet_result_t), or an error + * input parameters (odp_ipsec_in_param_t). The operation outputs used SA(s) as + * part of per packet results (odp_ipsec_packet_result_t), or an error * status if a SA was not found. * + * Each input packet must have a valid value for these metadata (other metadata + * is ignored): + * - L3 offset: Offset to the first byte of the (outmost) IP header + * - L4 offset: When udp_encap is enabled, offset to the first byte of the + * encapsulating UDP header + * + * Additionally, implementation checks input IP packet length (odp_packet_len() + * minus odp_packet_l3_offset()) against protocol headers and reports an error + * (status.error.proto) if packet data length is less than protocol headers + * indicate. + * * Packets are processed in the input order. Packet order is maintained from * input 'pkt' array to output 'pkt' array. Packet order is not guaranteed * between calling threads. @@ -1162,35 +1137,61 @@ typedef struct odp_ipsec_status_t { * restored. The amount and content of packet data before the IP header is * undefined. * - * @param input Operation input parameters - * @param[out] output Operation results - * - * @return Number of input packets consumed (0 ... input.num_pkt) + * Each successfully transformed packet has a valid value for these metadata + * regardless of the inner packet parse configuration + * (odp_ipsec_inbound_config_t): + * - L3 offset: Offset to the first byte of the (outmost) IP header + * - pktio: For inline IPSEC processed packets, original packet input + * interface + * + * Other metadata for parse results and error checks depend on configuration + * (selected parse and error check levels). + * + * @param pkt_in Packets to be processed + * @param num_in Number of packets to be processed + * @param[out] pkt_out Packet handle array for resulting packets + * @param[in, out] num_out Number of resulting packets. Application sets this + * to 'pkt_out' array size. A successful operation sets + * this to the number of outputted packets + * (1 ... num_out). + * @param param Inbound operation parameters + * + * @return Number of input packets consumed (0 ... num_in) * @retval <0 On failure * - * @see odp_packet_user_ptr(), odp_packet_user_area() + * @see odp_packet_user_ptr(), odp_packet_user_area(), odp_packet_l3_offset(), + * odp_packet_l4_offset() */ -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);
/** * Outbound synchronous IPSEC operation * * This operation does outbound IPSEC processing in synchronous mode * (ODP_IPSEC_OP_MODE_SYNC). A successful operation returns the number of - * packets consumed and outputs a new packet handle as well as an operation - * result for each outputted packet. The operation does not modify packets that - * it does not consume. It cannot consume all input packets if 'output.num_pkt' - * is smaller than 'input.num_pkt'. + * packets consumed and outputs a new packet handle for each outputted packet. + * Outputted packets contain IPSEC result metadata (odp_ipsec_packet_result_t), + * which should be checked for transformation errors, etc. Outputted packets + * with error status have not been transformed but the original packet is + * returned. The operation does not modify packets that it does not consume. + * It cannot consume all input packets if 'num_out' is smaller than 'num_in'. * * Packet context pointer and user area content are copied from input to output * packets. Output packets are allocated from the same pool(s) as input packets. * * When outbound IP fragmentation offload is enabled, the number of outputted - * packets (and corresponding per packet results) may be greater than - * the number of input packets. In that case, application may examine 'num_out' - * of each packet result (odp_ipsec_packet_result_t) to find out which - * fragments are originated from which input packet. + * packets may be greater than the number of input packets. + * + * Each input packet must have a valid value for these metadata (other metadata + * is ignored): + * - L3 offset: Offset to the first byte of the (outmost) IP header + * - L4 offset: Offset to the L4 header if L4 checksum offload is requested + * + * Additionally, input IP packet length (odp_packet_len() minus + * odp_packet_l3_offset()) must match values in protocol headers. Otherwise + * results are undefined. * * Packets are processed in the input order. Packet order is maintained from * input 'pkt' array to output 'pkt' array. Packet order is not guaranteed @@ -1201,31 +1202,40 @@ int odp_ipsec_in(const odp_ipsec_op_param_t *input, * with IPSEC, etc headers constructed according to the standards. The amount * and content of packet data before the IP header is undefined. * - * @param input Operation input parameters - * @param[out] output Operation results + * Each successfully transformed packet has a valid value for these metadata: + * - L3 offset: Offset to the first byte of the (outmost) IP header + * + * @param pkt_in Packets to be processed + * @param num_in Number of packets to be processed + * @param[out] pkt_out Packet handle array for resulting packets + * @param[in, out] num_out Number of resulting packets. Application sets this + * to 'pkt_out' array size. A successful operation sets + * this to the number of outputted packets + * (1 ... num_out). + * @param param Outbound operation parameters * - * @return Number of input packets consumed (0 ... input.num_pkt) + * @return Number of input packets consumed (0 ... num_in) * @retval <0 On failure * - * @see odp_packet_user_ptr(), odp_packet_user_area() + * @see odp_packet_user_ptr(), odp_packet_user_area(), odp_packet_l3_offset() */ -int odp_ipsec_out(const odp_ipsec_op_param_t *input, - odp_ipsec_op_result_t *output); +int odp_ipsec_out(const odp_packet_t pkt_in[], int num_in, + odp_packet_t pkt_out[], int *num_out, + const odp_ipsec_out_param_t *param);
/** * Inbound asynchronous IPSEC operation * * This operation does inbound IPSEC processing in asynchronous mode. It - * processes packets otherwise identically to odp_ipsec_in(), but outputs all - * results through one or more ODP_EVENT_IPSEC_RESULT events with the following - * ordering considerations. + * processes packets otherwise identically to odp_ipsec_in(), but outputs + * resulting packets as ODP_EVENT_PACKET events (with ODP_EVENT_PACKET_IPSEC + * subtype). The following ordering considerations apply to the events. * * Asynchronous mode maintains packet order per SA when application calls the * operation within an ordered or atomic scheduler context of the same queue. - * Resulting events for the same SA are enqueued in order and packet handles - * (for the same SA) are stored in order within an event. Packet order per SA at - * a destination queue is the same as if application would have enqueued packets - * there with odp_queue_enq_multi(). + * Resulting events for the same SA are enqueued in order. Packet order per SA + * at a destination queue is the same as if application would have enqueued + * packets there with odp_queue_enq_multi(). * * Packet order is also maintained when application otherwise guarantees * (e.g. using locks) that the operation is not called simultaneously from @@ -1239,29 +1249,31 @@ int odp_ipsec_out(const odp_ipsec_op_param_t *input, * may be processed simultaneously in both modes (initiated by this function * and inline operation). * - * @param input Operation input parameters + * @param pkt Packets to be processed + * @param num Number of packets to be processed + * @param param Inbound operation parameters * - * @return Number of input packets consumed (0 ... input.num_pkt) + * @return Number of input packets consumed (0 ... num) * @retval <0 On failure * * @see odp_ipsec_in(), odp_ipsec_result() */ -int odp_ipsec_in_enq(const odp_ipsec_op_param_t *input); +int odp_ipsec_in_enq(const odp_packet_t pkt[], int num, + const odp_ipsec_in_param_t *param);
/** * Outbound asynchronous IPSEC operation * * This operation does outbound IPSEC processing in asynchronous mode. It - * processes packets otherwise identically to odp_ipsec_out(), but outputs all - * results through one or more ODP_EVENT_IPSEC_RESULT events with the following - * ordering considerations. + * processes packets otherwise identically to odp_ipsec_out(), but outputs + * resulting packets as ODP_EVENT_PACKET events (with ODP_EVENT_PACKET_IPSEC + * subtype). The following ordering considerations apply to the events. * * Asynchronous mode maintains packet order per SA when application calls the * operation within an ordered or atomic scheduler context of the same queue. - * Resulting events for the same SA are enqueued in order and packet handles - * (for the same SA) are stored in order within an event. Packet order per SA at - * a destination queue is the same as if application would have enqueued packets - * there with odp_queue_enq_multi(). + * Resulting events for the same SA are enqueued in order. Packet order per SA + * at a destination queue is the same as if application would have enqueued + * packets there with odp_queue_enq_multi(). * * Packet order is also maintained when application otherwise guarantees * (e.g. using locks) that the operation is not called simultaneously from @@ -1273,14 +1285,17 @@ int odp_ipsec_in_enq(const odp_ipsec_op_param_t *input); * The function may be used also in inline processing mode, e.g. for IPSEC * packets for which inline processing is not possible. * - * @param input Operation input parameters + * @param pkt Packets to be processed + * @param num Number of packets to be processed + * @param param Outbound operation parameters * - * @return Number of input packets consumed (0 ... input.num_pkt) + * @return Number of input packets consumed (0 ... num) * @retval <0 On failure * * @see odp_ipsec_out(), odp_ipsec_result() */ -int odp_ipsec_out_enq(const odp_ipsec_op_param_t *input); +int odp_ipsec_out_enq(const odp_packet_t pkt[], int num, + const odp_ipsec_out_param_t *param);
/** * Outbound inline IPSEC operation @@ -1288,42 +1303,75 @@ int odp_ipsec_out_enq(const odp_ipsec_op_param_t *input); * This operation does outbound inline IPSEC processing for the packets. It's * otherwise identical to odp_ipsec_out_enq(), but outputs all successfully * transformed packets to the specified output interface, instead of generating - * result events for those. + * events for those. * * Inline operation parameters are defined per packet. The array of parameters - * must have 'op_param.num_pkt' elements and is pointed to by 'inline_param'. + * must have 'num' elements and is pointed to by 'inline_param'. * - * @param op_param Operation parameters - * @param inline_param Outbound inline operation specific parameters + * @param pkt Packets to be processed + * @param num Number of packets to be processed + * @param param Outbound operation parameters + * @param inline_param Outbound inline operation specific parameters * - * @return Number of packets consumed (0 ... op_param.num_pkt) + * @return Number of packets consumed (0 ... num) * @retval <0 On failure * * @see odp_ipsec_out_enq() */ -int odp_ipsec_out_inline(const odp_ipsec_op_param_t *op_param, - const odp_ipsec_inline_op_param_t *inline_param); +int odp_ipsec_out_inline(const odp_packet_t pkt[], int num, + const odp_ipsec_out_param_t *param, + const odp_ipsec_out_inline_param_t *inline_param); + +/** + * Convert IPSEC processed packet event to packet handle + * + * Get packet handle to an IPSEC processed packet event. Event subtype must be + * ODP_EVENT_IPSEC_PACKET. IPSEC operation results can be examined with + * odp_ipsec_result(). + * + * @param ev Event handle + * + * @return Packet handle + * + * @see odp_event_subtype(), odp_ipsec_result() + */ +odp_packet_t odp_ipsec_packet_from_event(odp_event_t ev);
/** - * Get IPSEC results from an ODP_EVENT_IPSEC_RESULT event + * Convert IPSEC processed packet handle to event + * + * The packet handle must be an output of an IPSEC operation. * - * Copies IPSEC operation results from an event. The event must be of - * type ODP_EVENT_IPSEC_RESULT. It must be freed before the application passes - * any resulting packet handles to other ODP calls. + * @param pkt Packet handle from IPSEC operation * - * @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 Event handle + */ +odp_event_t odp_ipsec_packet_to_event(odp_packet_t pkt); + +/** + * Get IPSEC operation results from an IPSEC processed packet * - * @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. + * Successful IPSEC operations of all types (SYNC, ASYNC and INLINE) produce + * packets which contain IPSEC result metadata. This function copies the + * operation results from an IPSEC processed packet. Event subtype of this kind + * of packet is ODP_EVENT_PACKET_IPSEC. Results are undefined if a non-IPSEC + * processed packet is passed as input. + * + * Some packet API operations output a new packet handle + * (e.g. odp_packet_concat()). IPSEC metadata remain valid as long as the packet + * handle is not changed from the original (output of e.g. odp_ipsec_in() or + * odp_ipsec_packet_from_event() call) IPSEC processed packet handle. + * + * @param[out] result Pointer to operation result for output + * @param packet An IPSEC processed packet (ODP_EVENT_PACKET_IPSEC) + * + * @retval 0 On success * @retval <0 On failure * - * @see odp_ipsec_in_enq(), odp_ipsec_out_enq() + * @see odp_ipsec_in(), odp_ipsec_in_enq(), odp_ipsec_out(), + * odp_ipsec_out_enq(), odp_ipsec_packet_from_event() */ -int odp_ipsec_result(odp_ipsec_op_result_t *result, odp_event_t event); +int odp_ipsec_result(odp_ipsec_packet_result_t *result, odp_packet_t packet);
/** * Get IPSEC status information from an ODP_EVENT_IPSEC_STATUS event diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index 10918dfb..c7eeb4ec 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -73,51 +73,68 @@ int odp_ipsec_sa_destroy(odp_ipsec_sa_t sa) return -1; }
-int odp_ipsec_in(const odp_ipsec_op_param_t *input, - odp_ipsec_op_result_t *output) -{ - (void)input; - (void)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) +{ + (void)pkt_in; + (void)num_in; + (void)pkt_out; + (void)num_out; + (void)param;
return -1; }
-int odp_ipsec_out(const odp_ipsec_op_param_t *input, - odp_ipsec_op_result_t *output) +int odp_ipsec_out(const odp_packet_t pkt_in[], int num_in, + odp_packet_t pkt_out[], int *num_out, + const odp_ipsec_out_param_t *param) { - (void)input; - (void)output; + (void)pkt_in; + (void)num_in; + (void)pkt_out; + (void)num_out; + (void)param;
return -1; }
-int odp_ipsec_in_enq(const odp_ipsec_op_param_t *input) +int odp_ipsec_in_enq(const odp_packet_t pkt[], int num, + const odp_ipsec_in_param_t *param) { - (void)input; + (void)pkt; + (void)num; + (void)param;
return -1; }
-int odp_ipsec_out_enq(const odp_ipsec_op_param_t *input) +int odp_ipsec_out_enq(const odp_packet_t pkt[], int num, + const odp_ipsec_out_param_t *param) { - (void)input; + (void)pkt; + (void)num; + (void)param;
return -1; }
-int odp_ipsec_out_inline(const odp_ipsec_op_param_t *op_param, - const odp_ipsec_inline_op_param_t *inline_param) +int odp_ipsec_out_inline(const odp_packet_t pkt[], int num, + const odp_ipsec_out_param_t *param, + const odp_ipsec_out_inline_param_t *inline_param) { - (void)op_param; + (void)pkt; + (void)num; + (void)param; (void)inline_param;
return -1; }
-int odp_ipsec_result(odp_ipsec_op_result_t *result, odp_event_t event) +int odp_ipsec_result(odp_ipsec_packet_result_t *result, odp_packet_t packet) { (void)result; - (void)event; + (void)packet;
return -1; } @@ -145,6 +162,20 @@ void *odp_ipsec_sa_context(odp_ipsec_sa_t sa) return NULL; }
+odp_packet_t odp_ipsec_packet_from_event(odp_event_t ev) +{ + (void)ev; + + return ODP_PACKET_INVALID; +} + +odp_event_t odp_ipsec_packet_to_event(odp_packet_t pkt) +{ + (void)pkt; + + return ODP_EVENT_INVALID; +} + uint64_t odp_ipsec_sa_to_u64(odp_ipsec_sa_t sa) { return _odp_pri(sa);
commit 441fb964f22b2baaa97641e6f8dda88d32d153f6 Author: Petri Savolainen petri.savolainen@linaro.org Date: Fri Jun 16 13:49:38 2017 +0300
api: event: add subtype to expand event type
Event subtype gives more detailed information about the event. Two subtypes (basic and IPSEC packet) are introduced initially. Later on, other packet producing APIs (crypto, comp, etc) may also produce packet events with additional subtypes.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Balasubramanian Manoharan bala.manoharan@linaro.org Reviewed-by: Nikhil Agarwal Nikhil.agarwal@linaro.org Reviewed-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/event.h b/include/odp/api/spec/event.h index f22efce5..2ad3ce84 100644 --- a/include/odp/api/spec/event.h +++ b/include/odp/api/spec/event.h @@ -37,21 +37,91 @@ extern "C" {
/** * @typedef odp_event_type_t - * ODP event types: - * ODP_EVENT_BUFFER, ODP_EVENT_PACKET, ODP_EVENT_TIMEOUT, - * ODP_EVENT_CRYPTO_COMPL, ODP_EVENT_IPSEC_RESULT, ODP_EVENT_IPSEC_STATUS + * Event type + * + * Event type specifies purpose and general format of an event. It can be + * checked with odp_event_type() or odp_event_types(). Each event type has + * functions (e.g. odp_buffer_from_event()) to convert between the generic event + * handle (odp_event_t) and the type specific handle (e.g. odp_buffer_t). + * Results are undefined, if conversion function of a wrong event type is used. + * Application cannot change event type by chaining conversion functions. + * + * List of event types: + * - ODP_EVENT_BUFFER + * - Buffer event (odp_buffer_t) for simple data storage and message passing + * - ODP_EVENT_PACKET + * - Packet event (odp_packet_t) containing packet data and plenty of + * packet processing related metadata + * - ODP_EVENT_TIMEOUT + * - Timeout event (odp_timeout_t) from a timer + * - ODP_EVENT_CRYPTO_COMPL + * - Crypto completion event (odp_crypto_compl_t) + * - ODP_EVENT_IPSEC_STATUS + * - IPSEC status update event (odp_ipsec_status_t) */
/** - * Get event type + * @typedef odp_event_subtype_t + * Event subtype * - * @param event Event handle + * Event subtype expands event type specification by providing more detailed + * purpose and format of an event. It can be checked with odp_event_subtype() or + * odp_event_types(). Each event subtype may define specific functions + * (e.g. odp_ipsec_packet_from_event()) to convert between the generic event + * handle (odp_event_t) and event type specific handle (e.g. odp_packet_t). When + * subtype is known, these subtype specific functions should be preferred over + * the event type general function (e.g. odp_packet_from_event()). Results are + * undefined, if conversion function of a wrong event subtype is used. + * Application cannot change event subtype by chaining conversion functions. + * + * List of event subtypes: + * - ODP_EVENT_PACKET_BASIC + * - Packet event (odp_packet_t) with basic packet metadata + * - ODP_EVENT_PACKET_IPSEC + * - Packet event (odp_packet_t) generated as a result of an IPsec + * operation. It contains IPSEC specific metadata in addition to the basic + * packet metadata. + * - ODP_EVENT_NO_SUBTYPE + * - An event type does not have any subtypes defined + */ + +/** + * Event type of an event + * + * Event type specifies purpose and general format of an event. + * + * @param event Event handle * * @return Event type */ odp_event_type_t odp_event_type(odp_event_t event);
/** + * Event subtype of an event + * + * Event subtype expands event type specification by providing more detailed + * purpose and format of an event. + * + * @param event Event handle + * + * @return Event subtype + */ +odp_event_subtype_t odp_event_subtype(odp_event_t event); + +/** + * Event type and subtype of an event + * + * Returns event type and outputs event subtype. + * + * @param event Event handle + * @param[out] subtype Pointer to event subtype for output + * + * @return Event type + */ +odp_event_type_t odp_event_types(odp_event_t event, + odp_event_subtype_t *subtype); + +/** * Get printable value for an odp_event_t * * @param hdl odp_event_t handle to be printed diff --git a/include/odp/arch/default/api/abi/event.h b/include/odp/arch/default/api/abi/event.h index 87220d63..ab3c0f75 100644 --- a/include/odp/arch/default/api/abi/event.h +++ b/include/odp/arch/default/api/abi/event.h @@ -29,10 +29,15 @@ typedef enum odp_event_type_t { ODP_EVENT_PACKET = 2, ODP_EVENT_TIMEOUT = 3, ODP_EVENT_CRYPTO_COMPL = 4, - ODP_EVENT_IPSEC_RESULT = 5, - ODP_EVENT_IPSEC_STATUS = 6 + ODP_EVENT_IPSEC_STATUS = 5 } odp_event_type_t;
+typedef enum odp_event_subtype_t { + ODP_EVENT_NO_SUBTYPE = 0, + ODP_EVENT_PACKET_BASIC = 1, + ODP_EVENT_PACKET_IPSEC = 2 +} odp_event_subtype_t; + /** * @} */ diff --git a/platform/linux-generic/include/odp/api/plat/event_types.h b/platform/linux-generic/include/odp/api/plat/event_types.h index 0f517834..5b3a07e3 100644 --- a/platform/linux-generic/include/odp/api/plat/event_types.h +++ b/platform/linux-generic/include/odp/api/plat/event_types.h @@ -39,9 +39,15 @@ typedef enum odp_event_type_t { ODP_EVENT_PACKET = 2, ODP_EVENT_TIMEOUT = 3, ODP_EVENT_CRYPTO_COMPL = 4, - ODP_EVENT_IPSEC_RESULT = 5 + ODP_EVENT_IPSEC_STATUS = 5 } odp_event_type_t;
+typedef enum odp_event_subtype_t { + ODP_EVENT_NO_SUBTYPE = 0, + ODP_EVENT_PACKET_BASIC = 1, + ODP_EVENT_PACKET_IPSEC = 2 +} odp_event_subtype_t; + /** * @} */
commit d5ff31f14e87c815d3a0e0461206aa2687152dd5 Merge: 4bcd15e2 09a7800c Author: Maxim Uvarov maxim.uvarov@linaro.org Date: Thu Jun 22 18:41:49 2017 +0300
Merge branch 'master' into api-next
diff --cc platform/linux-generic/odp_packet_io.c index 8fb5b5ee,e5436a90..4dd28549 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@@ -564,15 -563,14 +563,14 @@@ static inline int pktin_recv_buf(odp_pk for (i = 0; i < pkts; i++) { pkt = packets[i]; pkt_hdr = odp_packet_hdr(pkt); - buf = _odp_packet_to_buffer(pkt); - buf_hdr = buf_hdl_to_hdr(buf); + buf_hdr = packet_to_buf_hdr(pkt);
if (pkt_hdr->p.input_flags.dst_queue) { - queue_entry_t *dst_queue; + queue_t dst_queue; int ret;
- dst_queue = queue_to_qentry(pkt_hdr->dst_queue); - ret = queue_enq(dst_queue, buf_hdr); + dst_queue = queue_fn->from_ext(pkt_hdr->dst_queue); + ret = queue_fn->enq(dst_queue, buf_hdr); if (ret < 0) odp_packet_free(pkt); continue; @@@ -582,9 -580,9 +580,9 @@@ return num_rx; }
-int pktout_enqueue(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr) +int pktout_enqueue(queue_t qentry, odp_buffer_hdr_t *buf_hdr) { - odp_packet_t pkt = _odp_packet_from_buffer(buf_hdr->handle.handle); + odp_packet_t pkt = packet_from_buf_hdr(buf_hdr); int len = 1; int nbr;
@@@ -611,9 -612,9 +609,9 @@@ int pktout_enq_multi(queue_t qentry, od return nbr;
for (i = 0; i < num; ++i) - pkt_tbl[i] = _odp_packet_from_buffer(buf_hdr[i]->handle.handle); + pkt_tbl[i] = packet_from_buf_hdr(buf_hdr[i]);
- nbr = odp_pktout_send(qentry->s.pktout, pkt_tbl, num); + nbr = odp_pktout_send(queue_fn->get_pktout(qentry), pkt_tbl, num); return nbr; }
-----------------------------------------------------------------------
Summary of changes: .travis.yml | 1 + doc/application-api-guide/examples.dox | 5 + doc/users-guide/users-guide.adoc | 36 +- example/Makefile.am | 1 + example/ipfragreass/.gitignore | 3 + example/ipfragreass/Makefile.am | 23 + example/ipfragreass/odp_ipfragreass.c | 376 ++++++++++ example/ipfragreass/odp_ipfragreass_atomics.h | 55 ++ example/ipfragreass/odp_ipfragreass_atomics_arm.h | 120 ++++ example/ipfragreass/odp_ipfragreass_fragment.c | 99 +++ example/ipfragreass/odp_ipfragreass_fragment.h | 28 + example/ipfragreass/odp_ipfragreass_helpers.c | 124 ++++ example/ipfragreass/odp_ipfragreass_helpers.h | 79 +++ example/ipfragreass/odp_ipfragreass_ip.h | 251 +++++++ example/ipfragreass/odp_ipfragreass_reassemble.c | 771 +++++++++++++++++++++ example/ipfragreass/odp_ipfragreass_reassemble.h | 211 ++++++ example/m4/configure.m4 | 1 + include/odp/api/spec/event.h | 80 ++- include/odp/api/spec/feature.h | 69 ++ include/odp/api/spec/init.h | 15 + include/odp/api/spec/ipsec.h | 417 ++++++----- include/odp/arch/default/api/abi/event.h | 9 +- include/odp_api.h | 1 + platform/Makefile.inc | 1 + platform/linux-generic/Makefile.am | 3 +- platform/linux-generic/arch/arm/odp_cpu_arch.c | 38 +- .../include/odp/api/{support.h => feature.h} | 10 +- .../include/odp/api/plat/event_types.h | 8 +- .../linux-generic/include/odp_packet_internal.h | 10 + platform/linux-generic/odp_init.c | 5 + platform/linux-generic/odp_ipsec.c | 67 +- platform/linux-generic/odp_packet_io.c | 8 +- platform/linux-generic/pktio/loop.c | 4 +- test/common_plat/validation/api/init/init.c | 8 +- 34 files changed, 2704 insertions(+), 233 deletions(-) create mode 100644 example/ipfragreass/.gitignore create mode 100644 example/ipfragreass/Makefile.am create mode 100644 example/ipfragreass/odp_ipfragreass.c create mode 100644 example/ipfragreass/odp_ipfragreass_atomics.h create mode 100644 example/ipfragreass/odp_ipfragreass_atomics_arm.h create mode 100644 example/ipfragreass/odp_ipfragreass_fragment.c create mode 100644 example/ipfragreass/odp_ipfragreass_fragment.h create mode 100644 example/ipfragreass/odp_ipfragreass_helpers.c create mode 100644 example/ipfragreass/odp_ipfragreass_helpers.h create mode 100644 example/ipfragreass/odp_ipfragreass_ip.h create mode 100644 example/ipfragreass/odp_ipfragreass_reassemble.c create mode 100644 example/ipfragreass/odp_ipfragreass_reassemble.h create mode 100644 include/odp/api/spec/feature.h copy platform/linux-generic/include/odp/api/{support.h => feature.h} (59%)
hooks/post-receive