aboutsummaryrefslogtreecommitdiff
path: root/include/odp/api/spec
diff options
context:
space:
mode:
Diffstat (limited to 'include/odp/api/spec')
-rw-r--r--include/odp/api/spec/classification.h8
-rw-r--r--include/odp/api/spec/crypto.h21
-rw-r--r--include/odp/api/spec/event.h3
-rw-r--r--include/odp/api/spec/packet.h151
-rw-r--r--include/odp/api/spec/packet_io.h56
-rw-r--r--include/odp/api/spec/system_info.h14
6 files changed, 252 insertions, 1 deletions
diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h
index c33aca13f..31ce3e794 100644
--- a/include/odp/api/spec/classification.h
+++ b/include/odp/api/spec/classification.h
@@ -818,6 +818,14 @@ uint64_t odp_cos_to_u64(odp_cos_t hdl);
uint64_t odp_pmr_to_u64(odp_pmr_t hdl);
/**
+ * Print classifier info
+ *
+ * Print implementation defined information about classifier. The information is
+ * intended to be used for debugging.
+ */
+void odp_cls_print_all(void);
+
+/**
* @}
*/
diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h
index 446d93a51..c5c3f0936 100644
--- a/include/odp/api/spec/crypto.h
+++ b/include/odp/api/spec/crypto.h
@@ -893,6 +893,27 @@ typedef struct odp_crypto_capability_t {
/** Authentication algorithms implemented with HW offload */
odp_crypto_auth_algos_t hw_auths;
+ /**
+ * Scheduled crypto completion queue support
+ *
+ * This defines whether scheduled queues are supported as crypto
+ * compl_queue.
+ * 0: Scheduled queues are not supported as crypto completion queues
+ * 1: Scheduled queues are supported as crypto completion queues
+ * @see odp_crypto_session_param_t
+ */
+ odp_bool_t queue_type_sched;
+
+ /**
+ * Plain crypto completion queue support
+ *
+ * This defines whether plain queues are supported as crypto
+ * compl_queue.
+ * 0: Plain queues are not supported as crypto completion queues
+ * 1: Plain queues are supported as crypto completion queues
+ * @see odp_crypto_session_param_t
+ */
+ odp_bool_t queue_type_plain;
} odp_crypto_capability_t;
/**
diff --git a/include/odp/api/spec/event.h b/include/odp/api/spec/event.h
index dc61b6e31..32fd37c29 100644
--- a/include/odp/api/spec/event.h
+++ b/include/odp/api/spec/event.h
@@ -60,6 +60,9 @@ extern "C" {
* - IPSEC status update event (odp_ipsec_status_t)
* - ODP_EVENT_PACKET_VECTOR
* - Vector of packet events (odp_packet_t) as odp_packet_vector_t
+ * - ODP_EVENT_PACKET_TX_COMPL
+ * - Packet Tx completion event (odp_packet_tx_compl_t) generated as a result of a Packet Tx
+ * completion.
*/
/**
diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h
index 3810c279a..d973b26a5 100644
--- a/include/odp/api/spec/packet.h
+++ b/include/odp/api/spec/packet.h
@@ -188,6 +188,16 @@ extern "C" {
*/
/**
+ * @typedef odp_packet_tx_compl_t
+ * ODP Packet Tx completion
+ */
+
+/**
+ * @def ODP_PACKET_TX_COMPL_INVALID
+ * Invalid packet Tx completion
+ */
+
+/**
* Protocol
*/
typedef enum odp_proto_t {
@@ -2140,6 +2150,92 @@ uint32_t odp_packet_payload_offset(odp_packet_t pkt);
*/
int odp_packet_payload_offset_set(odp_packet_t pkt, uint32_t offset);
+/**
+ * Enable or disable Tx packet aging
+ *
+ * Enable or disable Tx packet drop based on packet age. When enabled, packet will be dropped
+ * if it is in Tx pktout queue or traffic shapers/schedulers for longer than timeout set.
+ *
+ * When tmo_ns is
+ * !0: Aging is enabled
+ * 0: Aging is disabled
+ *
+ * Aging is disabled by default. Maximum tmo value is defined by max_tx_aging_tmo_ns capa.
+ *
+ * @param pkt Packet handle
+ * @param tmo_ns Packet aging drop timeout in nsec. When 0, aging drop is disabled (default).
+ *
+ * @see odp_pktio_capability_t::max_tx_aging_tmo_ns
+ */
+void odp_packet_aging_tmo_set(odp_packet_t pkt, uint64_t tmo_ns);
+
+/**
+ * Check if packet has Tx aging drop enabled
+ *
+ * @param pkt Packet handle
+ *
+ * @return Aging drop timeout if enabled.
+ * @retval >0 Aging drop timeout in nano seconds and implies aging drop is enabled.
+ * @retval 0 If Aging drop is disabled.
+ */
+uint64_t odp_packet_aging_tmo(odp_packet_t pkt);
+
+/** Packet Tx completion mode */
+typedef enum odp_packet_tx_compl_mode_t {
+ /** Packet Tx completion event is disabled
+ *
+ * When mode is disabled, all other fields of odp_packet_tx_compl_opt_t are ignored.
+ */
+ ODP_PACKET_TX_COMPL_DISABLED,
+ /** Packet Tx completion event is sent for all packets (both transmitted and dropped) */
+ ODP_PACKET_TX_COMPL_ALL,
+} odp_packet_tx_compl_mode_t;
+
+/**
+ * Tx completion request options
+ */
+typedef struct odp_packet_tx_compl_opt_t {
+ /** Queue handle
+ *
+ * Tx completion event will be posted to ODP queue identified by this handle.
+ */
+ odp_queue_t queue;
+
+ /** Packet Tx completion event mode */
+ odp_packet_tx_compl_mode_t mode;
+
+} odp_packet_tx_compl_opt_t;
+
+/**
+ * Request Tx completion event.
+ *
+ * Enables or disables TX completion event request for the packet. When
+ * enabled, an event of type ODP_EVENT_PACKET_TX_COMPL will be sent to the
+ * destination queue based on the TX completion mode. The event is sent only
+ * after pktio interface has finished processing the packet. A previously
+ * enabled request can be disabled by setting the mode to
+ * ODP_PACKET_TX_COMPL_DISABLED.
+ *
+ * TX completion event request is disabled by default.
+ *
+ * @param pkt Packet handle
+ * @param opt Points to TX completion event generation options
+ *
+ * @retval 0 On success
+ * @retval <0 On failure
+ */
+int odp_packet_tx_compl_request(odp_packet_t pkt, const odp_packet_tx_compl_opt_t *opt);
+
+/**
+ * Check if TX completion event is requested for the packet
+ *
+ * @param pkt Packet handle
+ *
+ * @retval non-zero TX completion event is requested
+ * @retval 0 TX completion event is not requested
+ */
+int odp_packet_has_tx_compl_request(odp_packet_t pkt);
+
/*
*
* Packet vector handling routines
@@ -2317,6 +2413,61 @@ uint64_t odp_packet_vector_to_u64(odp_packet_vector_t hdl);
/*
*
+ * Packet Tx completion event handling routines
+ * ********************************************************
+ */
+
+/**
+ * Get packet Tx completion handle from event
+ *
+ * Converts an ODP_EVENT_PACKET_TX_COMPL type event to packet Tx completion
+ * handle.
+ *
+ * @param ev Event handle
+ *
+ * @return Packet Tx completion handle
+ *
+ * @see odp_event_type()
+ */
+odp_packet_tx_compl_t odp_packet_tx_compl_from_event(odp_event_t ev);
+
+/** Convert packet Tx completion to event
+ *
+ * @param tx_compl Packet Tx completion
+ *
+ * @return Event handle
+ */
+odp_event_t odp_packet_tx_compl_to_event(odp_packet_tx_compl_t tx_compl);
+
+/**
+ * Free packet Tx completion
+ *
+ * Frees the packet Tx completion back to platform. It frees packet Tx
+ * completion that gets allocated as part of packet Tx completion request
+ * for a given packet.
+ *
+ * @param tx_compl Packet Tx completion handle
+ *
+ * @see odp_packet_tx_completion_request()
+ */
+void odp_packet_tx_compl_free(odp_packet_tx_compl_t tx_compl);
+
+/**
+ * User context pointer
+ *
+ * Return user context pointer from packet Tx completion event.
+ * This is the same value set to packet using odp_packet_user_ptr_set().
+ *
+ * @param tx_compl Packet Tx completion handle
+ *
+ * @return User context pointer
+ *
+ * @see odp_packet_user_ptr_set()
+ */
+void *odp_packet_tx_compl_user_ptr(odp_packet_tx_compl_t tx_compl);
+
+/*
+ *
* Debugging
* ********************************************************
*
diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h
index af3c72dde..03b7d094a 100644
--- a/include/odp/api/spec/packet_io.h
+++ b/include/odp/api/spec/packet_io.h
@@ -489,6 +489,22 @@ typedef union odp_pktout_config_opt_t {
*/
uint64_t no_packet_refs : 1;
+ /** Enable packet aging and drop
+ *
+ * 0: application will not request packet aging (default)
+ * 1: application may request packet aging
+ */
+ uint64_t aging_ena : 1;
+
+ /** Enable packet transmit completion event requests
+ *
+ * Use pktio capability tx_compl to check if TX completion events are supported.
+ *
+ * 0: Application will not request packet TX completion events (default)
+ * 1: Application may request packet TX completion events
+ */
+ uint64_t tx_compl_ena : 1;
+
} bit;
/** All bits of the bit field structure
@@ -845,6 +861,46 @@ typedef struct odp_pktio_capability_t {
uint32_t max_output;
} maxlen;
+ /**
+ * Max Tx aging timeout in nano seconds supported when packet aging
+ * feature is supported.
+ *
+ * 0: aging is not supported
+ * >0: maximum aging timeout supported in nanoseconds
+ */
+ uint64_t max_tx_aging_tmo_ns;
+
+ /** Supported packet Tx completion options */
+ struct {
+ /**
+ * Scheduled queue support
+ *
+ * This defines whether schedule queues are supported for receiving Tx
+ * completion events.
+ *
+ * 0: Scheduled queues are not supported for receiving Tx completion events.
+ * 1: Scheduled queues are supported for receiving Tx completion events.
+ * @see odp_packet_tx_compl_request()
+ */
+ odp_bool_t queue_type_sched;
+
+ /**
+ * Plain queue support
+ *
+ * This defines whether plain queues are supported for receiving Tx
+ * completion events.
+ *
+ * 0: Plain queues are not supported for receiving Tx completion events.
+ * 1: Plain queues are supported for receiving Tx completion events.
+ * @see odp_packet_tx_compl_request()
+ */
+ odp_bool_t queue_type_plain;
+
+ /** ODP_PACKET_TX_COMPL_ALL supported */
+ uint32_t mode_all:1;
+
+ } tx_compl;
+
} odp_pktio_capability_t;
/**
diff --git a/include/odp/api/spec/system_info.h b/include/odp/api/spec/system_info.h
index 5d4e3cb87..a73263984 100644
--- a/include/odp/api/spec/system_info.h
+++ b/include/odp/api/spec/system_info.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2020, Nokia
+ * Copyright (c) 2020-2021, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -84,6 +84,18 @@ typedef enum odp_cpu_arch_arm_t {
/** ARMv8.6-A ISA */
ODP_CPU_ARCH_ARMV8_6,
+ /** ARMv8.7-A ISA */
+ ODP_CPU_ARCH_ARMV8_7,
+
+ /** ARMv9.0-A ISA */
+ ODP_CPU_ARCH_ARMV9_0,
+
+ /** ARMv9.1-A ISA */
+ ODP_CPU_ARCH_ARMV9_1,
+
+ /** ARMv9.2-A ISA */
+ ODP_CPU_ARCH_ARMV9_2,
+
} odp_cpu_arch_arm_t;
/**