aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJerin Jacob <jerinj@marvell.com>2020-08-26 23:28:58 +0530
committerPetri Savolainen <petri.savolainen@nokia.com>2020-11-19 09:49:08 +0200
commit871d2424a402c5f6090478115ea64739354822d5 (patch)
tree7e77a1044ca5e9923fb7bf3fb8b479087df1223c /include
parent527561e9a4c71e7edcddf380a86478f824e46496 (diff)
api: pktio: configure pktin vector producer
There are two configuration aspects of the pktin vector producer. First, When pktin subsystem produces the vector of packets, it needs to choose the ODP_VECTOR_POOL to hold/form the vector. Second, The max timeout interval to accumulate a vector for packets. The odp_pktin_vector_config_t depicts the configuration parameters. Pktin subsystem forms a vector, when either max timeout or max vector size is reached, and injects it as an event to the event queue. The pktin configuration available either through pktio or classification subsystem based on the final odp queue delivery. This patch also introduces odp_pktin_vector_capability_t capability parameter to probe the pktin vector producer availability in the implementation as well as to know the max and min timeout value for accumulating the packet by the pktin vector producer and also the max_vector_size. Signed-off-by: Matias Elo <matias.elo@nokia.com> Signed-off-by: Jerin Jacob <jerinj@marvell.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Diffstat (limited to 'include')
-rw-r--r--include/odp/api/spec/classification.h3
-rw-r--r--include/odp/api/spec/packet_io.h83
2 files changed, 86 insertions, 0 deletions
diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h
index 176c53ff3..7c2c40fbb 100644
--- a/include/odp/api/spec/classification.h
+++ b/include/odp/api/spec/classification.h
@@ -285,6 +285,9 @@ typedef struct odp_cls_cos_param {
/** Back Pressure configuration */
odp_bp_param_t bp;
+
+ /** Packet input vector configuration */
+ odp_pktin_vector_config_t vector;
} odp_cls_cos_param_t;
/**
diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h
index d25d29751..940b712fa 100644
--- a/include/odp/api/spec/packet_io.h
+++ b/include/odp/api/spec/packet_io.h
@@ -160,6 +160,50 @@ typedef struct odp_pktin_queue_param_ovr_t {
} odp_pktin_queue_param_ovr_t;
/**
+ * Packet input vector configuration
+ */
+typedef struct odp_pktin_vector_config_t {
+ /** Enable packet input vector
+ *
+ * When true, packet input vector is enabled and configured with vector
+ * config parameters. Otherwise, packet input vector configuration
+ * parameters are ignored.
+ */
+ odp_bool_t enable;
+
+ /** Vector pool
+ *
+ * Vector pool to allocate the vectors to hold packets.
+ * The pool must have been created with the ODP_POOL_VECTOR type.
+ */
+ odp_pool_t pool;
+
+ /** Maximum time to wait for packets
+ *
+ * Maximum timeout in nanoseconds to wait for the producer to form the
+ * vector of packet events (odp_packet_vector_t). This value should be
+ * in the range of odp_pktin_vector_capability_t::min_tmo_ns to
+ * odp_pktin_vector_capability_t::max_tmo_ns.
+ */
+ uint64_t max_tmo_ns;
+
+ /** Maximum number of packets in a vector
+ *
+ * The packet input subsystem forms packet vector events when either
+ * it reaches odp_pktin_vector_config_t::max_tmo_ns or producer reaches
+ * max_size packets. This value should be in the range of
+ * odp_pktin_vector_capability_t::min_size to
+ * odp_pktin_vector_capability_t::max_size.
+ *
+ * @note The maximum number of packets this vector can hold is defined
+ * by odp_pool_param_t::vector::max_size with odp_pktin_vector_config_t::pool.
+ * The max_size should not be greater than odp_pool_param_t::vector::max_size.
+ */
+ uint32_t max_size;
+
+} odp_pktin_vector_config_t;
+
+/**
* Packet input queue parameters
*/
typedef struct odp_pktin_queue_param_t {
@@ -226,6 +270,10 @@ typedef struct odp_pktin_queue_param_t {
* NULL.
*/
odp_pktin_queue_param_ovr_t *queue_param_ovr;
+
+ /** Packet input vector configuration */
+ odp_pktin_vector_config_t vector;
+
} odp_pktin_queue_param_t;
/**
@@ -570,6 +618,37 @@ typedef union odp_pktio_set_op_t {
} odp_pktio_set_op_t;
/**
+ * Packet input vector capabilities
+ */
+typedef struct odp_pktin_vector_capability_t {
+ /** Packet input vector availability */
+ odp_support_t supported;
+
+ /** Maximum number of packets that can be accumulated into a packet
+ * vector by a producer
+ *
+ * odp_pktin_vector_config_t::max_size should not be greater than this
+ * value. */
+ uint32_t max_size;
+
+ /** Minimum value allowed to be configured to
+ * odp_pktin_vector_config_t::max_size */
+ uint32_t min_size;
+
+ /** Maximum timeout in nanoseconds for the producer to wait for the
+ * vector of packets
+ *
+ * odp_pktin_vector_config_t::max_tmo_ns should not be greater than this
+ * value. */
+ uint64_t max_tmo_ns;
+
+ /** Minimum value allowed to be configured to
+ * odp_pktin_vector_config_t::max_tmo_ns */
+ uint64_t min_tmo_ns;
+
+} odp_pktin_vector_capability_t;
+
+/**
* Packet IO capabilities
*/
typedef struct odp_pktio_capability_t {
@@ -590,6 +669,10 @@ typedef struct odp_pktio_capability_t {
/** @deprecated Use enable_loop inside odp_pktin_config_t */
odp_bool_t ODP_DEPRECATE(loop_supported);
+
+ /** Packet input vector capability */
+ odp_pktin_vector_capability_t vector;
+
} odp_pktio_capability_t;
/**