Re: [lng-odp] [PATCH API-NEXT v1] api: random early detection and back pressure

2017-11-06 Thread Github ODP bot
Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page:

include/odp/api/spec/pool.h
line 39
@@ -228,6 +243,12 @@ typedef struct odp_pool_param_t {
capability pkt.max_headroom.
Use zero if headroom is not needed. */
uint32_t headroom;
+
+   /* Random Early Detection configuration */
+   odp_red_param_t red;
+
+   /* Back Pressure configuration */
+   odp_bp_param_t bp;
} pkt;


Comment:
Need to clarify under what conditions RED (and BP) apply to pools. If an 
application calls `odp_packet_alloc()` that should either succeed or fail. 
"Drop probability" doesn't make any obvious sense here. Tying these concepts to 
`odp_pktio_t` configurations seems more in keeping with what's needed, but I 
understand the difficulties that that caused in the previous PR.

Perhaps tying this to a `odp_cos_t` might work? An `odp_cos_t` has an 
associated queue and pool and these can then be viewed as admission controls to 
packets being added to a CoS. That would mean that these features would only be 
applicable if the classifier is being used, but is that a significant drawback 
since we want to encourage its use anyway?

> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> Back pressure in this context presumably means that `odp_queue_enq()` calls 
> stall until the back pressure is relieved. Not sure if that's what's really 
> desired for queues in general.


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> RED for a queue in doesn't seem to make sense for queues in general. RED is 
>> used for admission control, which is why it's tied to PktIOs. If an 
>> application calls `odp_queue_enq()` that should either succeed or fail. A 
>> "drop probability" doesn't make sense here. We need to clarify that somehow 
>> and I'm not sure how that can be done without tying the configuration back 
>> to an `odp_pktio_t`.


>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>> Same comment as for pools. It would seem these should be individual 
>>> `odp_support_t` indications.


 Bill Fischofer(Bill-Fischofer-Linaro) wrote:
 Wouldn't these be better done as individual `odp_support_t` 
 configurations? That way implementations can indicate not just support but 
 preferences. 


> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> We've defined what we mean by RED as assigning a drop probability but 
> what we mean by "back pressure" seems very fuzzy here. This needs to be 
> more specific if an application is to know how to make use of this.


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> We use `_t` suffixes rather than `_e` for `enums` so 
>> `odp_threshold_type_t` would be more standard here, but we already have 
>> an `odp_threshold_type_t` defined above. The problem seems to be `_t` 
>> already implies type, so "type type" is redundant. 
>> 
>> Perhaps a better choice is an `odp_threshold_t` has an 
>> `odp_threshold_metric_t metric` field that is the enum above. It's not 
>> clear how the `odp_threshold_type_t` bits are intended to be used. 
>> Capabilities?


>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>> Need Doxygen for each struct and union


 Bill Fischofer(Bill-Fischofer-Linaro) wrote:
 Doxygen 1.8.13 requires every element to be documented.


> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> Again this new type should follow the PR #250 model.


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> Since we've given conceptual approval to PR #250, these changes 
>> should be based on that and this definition would be part of 
>> abi-default/std_types.h.


https://github.com/Linaro/odp/pull/277#discussion_r149240690
updated_at 2017-11-07 00:10:06


Re: [lng-odp] [PATCH API-NEXT v1] api: random early detection and back pressure

2017-11-06 Thread Github ODP bot
Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page:

include/odp/api/spec/threshold.h
line 89
@@ -0,0 +1,89 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP threshold descriptor
+ */
+
+#ifndef ODP_API_THRESHOLD_H_
+#define ODP_API_THRESHOLD_H_
+#include 
+#include 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Supported threshold types
+ *
+ * Supported threshold types in a bit field structure.
+ */
+typedef union odp_threshold_type_t {
+   struct {
+   /** Percentage of the total size of pool or queue */
+   uint8_t percent:1;
+   /* Number of transient packets */
+   uint8_t pkt_cnt:1;
+   /* Total size of all transient packets in bytes */
+   uint8_t pkt_size:1;
+   };
+   /** All bits of the bit field structure */
+   uint8_t all_bits;
+} odp_threshold_type_t;
+
+/**
+ * ODP Threshold types
+ *
+ * Different types of threshold measurements
+ */
+typedefenum {
+   /** Percentage of the total size of pool or queue */
+   odp_percent_e,
+   /** Number of transient packets */
+   odp_pkt_count_e,
+   /** Total size of all transient packets in bytes */
+   odp_pkt_size_e
+} odp_threshold_type_e;
+
+/**
+ * ODP Threshold
+ *
+ * Threshold configuration
+ */
+typedef struct odp_threshold_t {
+   /** Type of threshold */
+   odp_threshold_type_e type;
+   union {
+   struct {
+   /** Max percentage value */
+   odp_percent_t max;
+   /** Min percentage value */
+   odp_percent_t min;
+   } percent;
+   struct {
+   /** Max packet count */
+   uint64_t max;
+   /** Min packet count */
+   uint64_t min;
+   } pkt_count;
+   struct {
+   /** Max size of all packets */
+   uint64_t max;
+   /** Min size of all packets */
+   uint64_t min;
+   } pkt_size;
+   };
+} odp_threshold_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#include 
+#endif


Comment:
Adding new files requires updates to the various Makefile.am and related 
autotools. That's why Travis is reporting failures since these new files aren't 
able to be found / used.

> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> Need to clarify under what conditions RED (and BP) apply to pools. If an 
> application calls `odp_packet_alloc()` that should either succeed or fail. 
> "Drop probability" doesn't make any obvious sense here. Tying these concepts 
> to `odp_pktio_t` configurations seems more in keeping with what's needed, but 
> I understand the difficulties that that caused in the previous PR.
> 
> Perhaps tying this to a `odp_cos_t` might work? An `odp_cos_t` has an 
> associated queue and pool and these can then be viewed as admission controls 
> to packets being added to a CoS. That would mean that these features would 
> only be applicable if the classifier is being used, but is that a significant 
> drawback since we want to encourage its use anyway?


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> Back pressure in this context presumably means that `odp_queue_enq()` calls 
>> stall until the back pressure is relieved. Not sure if that's what's really 
>> desired for queues in general.


>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>> RED for a queue in doesn't seem to make sense for queues in general. RED is 
>>> used for admission control, which is why it's tied to PktIOs. If an 
>>> application calls `odp_queue_enq()` that should either succeed or fail. A 
>>> "drop probability" doesn't make sense here. We need to clarify that somehow 
>>> and I'm not sure how that can be done without tying the configuration back 
>>> to an `odp_pktio_t`.


 Bill Fischofer(Bill-Fischofer-Linaro) wrote:
 Same comment as for pools. It would seem these should be individual 
 `odp_support_t` indications.


> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> Wouldn't these be better done as individual `odp_support_t` 
> configurations? That way implementations can indicate not just support 
> but preferences. 


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> We've defined what we mean by RED as assigning a drop probability but 
>> what we mean by "back pressure" seems very fuzzy here. This needs to be 
>> more specific if an application is to know how to make use of this.


>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>> We use `_t` suffixes rather than `_e` for `enums` so 
>>> `odp_threshold_type_t` would be more standard here, but we already have 
>>> an `odp_threshold_type_t` defined above. The problem seems to be `_t` 
>>> already i

Re: [lng-odp] [PATCH API-NEXT v1] api: random early detection and back pressure

2017-11-06 Thread Github ODP bot
Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page:

include/odp/api/spec/queue.h
line 37
@@ -202,6 +216,11 @@ typedef struct odp_queue_param_t {
  * default size. */
uint32_t size;
 
+   /* Random early detection configuration */
+   odp_red_param_t red;
+
+   /* Back Pressure configuration */
+   odp_bp_param_t bp;
 } odp_queue_param_t;


Comment:
Back pressure in this context presumably means that `odp_queue_enq()` calls 
stall until the back pressure is relieved. Not sure if that's what's really 
desired for queues in general.

> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> RED for a queue in doesn't seem to make sense for queues in general. RED is 
> used for admission control, which is why it's tied to PktIOs. If an 
> application calls `odp_queue_enq()` that should either succeed or fail. A 
> "drop probability" doesn't make sense here. We need to clarify that somehow 
> and I'm not sure how that can be done without tying the configuration back to 
> an `odp_pktio_t`.


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> Same comment as for pools. It would seem these should be individual 
>> `odp_support_t` indications.


>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>> Wouldn't these be better done as individual `odp_support_t` configurations? 
>>> That way implementations can indicate not just support but preferences. 


 Bill Fischofer(Bill-Fischofer-Linaro) wrote:
 We've defined what we mean by RED as assigning a drop probability but what 
 we mean by "back pressure" seems very fuzzy here. This needs to be more 
 specific if an application is to know how to make use of this.


> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> We use `_t` suffixes rather than `_e` for `enums` so 
> `odp_threshold_type_t` would be more standard here, but we already have 
> an `odp_threshold_type_t` defined above. The problem seems to be `_t` 
> already implies type, so "type type" is redundant. 
> 
> Perhaps a better choice is an `odp_threshold_t` has an 
> `odp_threshold_metric_t metric` field that is the enum above. It's not 
> clear how the `odp_threshold_type_t` bits are intended to be used. 
> Capabilities?


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> Need Doxygen for each struct and union


>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>> Doxygen 1.8.13 requires every element to be documented.


 Bill Fischofer(Bill-Fischofer-Linaro) wrote:
 Again this new type should follow the PR #250 model.


> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> Since we've given conceptual approval to PR #250, these changes 
> should be based on that and this definition would be part of 
> abi-default/std_types.h.


https://github.com/Linaro/odp/pull/277#discussion_r149239811
updated_at 2017-11-07 00:10:06


Re: [lng-odp] [PATCH API-NEXT v1] api: random early detection and back pressure

2017-11-06 Thread Github ODP bot
Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page:

include/odp/api/spec/queue.h
line 18
@@ -114,6 +116,18 @@ typedef struct odp_queue_capability_t {
/** Number of scheduling priorities */
unsigned sched_prios;
 
+   /** Support for Random Early Detection */
+   odp_support_t random_early_detection;
+
+   /** Supported threshold types for RED */
+   odp_threshold_type_t threshold_red;
+


Comment:
Same comment as for pools. It would seem these should be individual 
`odp_support_t` indications.

> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> Wouldn't these be better done as individual `odp_support_t` configurations? 
> That way implementations can indicate not just support but preferences. 


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> We've defined what we mean by RED as assigning a drop probability but what 
>> we mean by "back pressure" seems very fuzzy here. This needs to be more 
>> specific if an application is to know how to make use of this.


>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>> We use `_t` suffixes rather than `_e` for `enums` so `odp_threshold_type_t` 
>>> would be more standard here, but we already have an `odp_threshold_type_t` 
>>> defined above. The problem seems to be `_t` already implies type, so "type 
>>> type" is redundant. 
>>> 
>>> Perhaps a better choice is an `odp_threshold_t` has an 
>>> `odp_threshold_metric_t metric` field that is the enum above. It's not 
>>> clear how the `odp_threshold_type_t` bits are intended to be used. 
>>> Capabilities?


 Bill Fischofer(Bill-Fischofer-Linaro) wrote:
 Need Doxygen for each struct and union


> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> Doxygen 1.8.13 requires every element to be documented.


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> Again this new type should follow the PR #250 model.


>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>> Since we've given conceptual approval to PR #250, these changes should 
>>> be based on that and this definition would be part of 
>>> abi-default/std_types.h.


https://github.com/Linaro/odp/pull/277#discussion_r149238965
updated_at 2017-11-07 00:10:06


Re: [lng-odp] [PATCH API-NEXT v1] api: random early detection and back pressure

2017-11-06 Thread Github ODP bot
Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page:

include/odp/api/spec/queue.h
line 34
@@ -202,6 +216,11 @@ typedef struct odp_queue_param_t {
  * default size. */
uint32_t size;
 
+   /* Random early detection configuration */
+   odp_red_param_t red;
+


Comment:
RED for a queue in doesn't seem to make sense for queues in general. RED is 
used for admission control, which is why it's tied to PktIOs. If an application 
calls `odp_queue_enq()` that should either succeed or fail. A "drop 
probability" doesn't make sense here. We need to clarify that somehow and I'm 
not sure how that can be done without tying the configuration back to an 
`odp_pktio_t`.

> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> Same comment as for pools. It would seem these should be individual 
> `odp_support_t` indications.


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> Wouldn't these be better done as individual `odp_support_t` configurations? 
>> That way implementations can indicate not just support but preferences. 


>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>> We've defined what we mean by RED as assigning a drop probability but what 
>>> we mean by "back pressure" seems very fuzzy here. This needs to be more 
>>> specific if an application is to know how to make use of this.


 Bill Fischofer(Bill-Fischofer-Linaro) wrote:
 We use `_t` suffixes rather than `_e` for `enums` so 
 `odp_threshold_type_t` would be more standard here, but we already have an 
 `odp_threshold_type_t` defined above. The problem seems to be `_t` already 
 implies type, so "type type" is redundant. 
 
 Perhaps a better choice is an `odp_threshold_t` has an 
 `odp_threshold_metric_t metric` field that is the enum above. It's not 
 clear how the `odp_threshold_type_t` bits are intended to be used. 
 Capabilities?


> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> Need Doxygen for each struct and union


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> Doxygen 1.8.13 requires every element to be documented.


>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>> Again this new type should follow the PR #250 model.


 Bill Fischofer(Bill-Fischofer-Linaro) wrote:
 Since we've given conceptual approval to PR #250, these changes should 
 be based on that and this definition would be part of 
 abi-default/std_types.h.


https://github.com/Linaro/odp/pull/277#discussion_r149239587
updated_at 2017-11-07 00:10:06


Re: [lng-odp] [PATCH API-NEXT v1] api: random early detection and back pressure

2017-11-06 Thread Github ODP bot
Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page:

include/odp/api/spec/red.h
line 68
@@ -0,0 +1,79 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP RED
+ */
+
+#ifndef ODP_API_RED_H_
+#define ODP_API_RED_H_
+#include 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+#include 
+
+/** Random Early Detection (RED)
+ * Random Early Detection is enabled to initiate a drop probability
+ * for the incoming packet when the packets in the queue/pool reaches
+ * a specified threshold.
+ * When RED is enabled for a particular flow then further incoming
+ * packets are assigned a drop probability based on the size of the
+ * pool/queue and the drop probability becomes 100% when the queue/pool
+ * is full.
+ * RED can be configured either in pool or queue depending on the platform
+ * capabilities.
+ */
+typedef struct odp_red_param_t {
+   /** A boolean to enable RED
+* When true, RED is enabled and configured with RED parameters.
+* Otherwise, RED parameters are ignored. */
+   odp_bool_t red_enable;
+
+   /** Threshold parameters for RED
+* RED is enabled when the resource limit is equal to or greater than
+* the maximum threshold value and is disabled when resource limit
+* is less than or equal to minimum threshold value. */
+   odp_threshold_t red_threshold;
+} odp_red_param_t;
+
+/** Back pressure (BP)
+ * When back pressure is enabled for a particular flow, the HW can send
+ * back pressure information to the remote peer indicating a network 
congestion.
+ * Back pressure can be configured either in the pool or queue based on the
+ * platform capabilities.
+ */
+
+typedef struct odp_bp_param_t {
+   /** A boolean to enable Back pressure
+* When true, back pressure is enabled and configured with the BP
+* parameters. Otherwise BP parameters are ignored.
+*/
+   odp_bool_t bp_enable;
+
+   /** Threshold value for back pressure.
+* BP is enabled when queue or pool value is equal to or greater
+* than the max backpressure threshold.
+* Min threshold parameters are ignored for BP configuration.
+*/
+   odp_threshold_t bp_threshold;
+} odp_bp_param_t;


Comment:
We've defined what we mean by RED as assigning a drop probability but what we 
mean by "back pressure" seems very fuzzy here. This needs to be more specific 
if an application is to know how to make use of this.

> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> We use `_t` suffixes rather than `_e` for `enums` so `odp_threshold_type_t` 
> would be more standard here, but we already have an `odp_threshold_type_t` 
> defined above. The problem seems to be `_t` already implies type, so "type 
> type" is redundant. 
> 
> Perhaps a better choice is an `odp_threshold_t` has an 
> `odp_threshold_metric_t metric` field that is the enum above. It's not clear 
> how the `odp_threshold_type_t` bits are intended to be used. Capabilities?


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> Need Doxygen for each struct and union


>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>> Doxygen 1.8.13 requires every element to be documented.


 Bill Fischofer(Bill-Fischofer-Linaro) wrote:
 Again this new type should follow the PR #250 model.


> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> Since we've given conceptual approval to PR #250, these changes should be 
> based on that and this definition would be part of 
> abi-default/std_types.h.


https://github.com/Linaro/odp/pull/277#discussion_r149237219
updated_at 2017-11-07 00:10:06


Re: [lng-odp] [PATCH API-NEXT v1] api: random early detection and back pressure

2017-11-06 Thread Github ODP bot
Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page:

include/odp/api/spec/pool.h
line 19
@@ -134,6 +136,19 @@ typedef struct odp_pool_capability_t {
 * The value of zero means that limited only by the available
 * memory size for the pool. */
uint32_t max_uarea_size;
+
+   /** Support for Random Early Detection */
+   odp_support_t random_early_detection;
+
+   /** Supported threshold type for RED */
+   odp_threshold_type_t threshold_red;
+


Comment:
Wouldn't these be better done as individual `odp_support_t` configurations? 
That way implementations can indicate not just support but preferences. 

> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> We've defined what we mean by RED as assigning a drop probability but what we 
> mean by "back pressure" seems very fuzzy here. This needs to be more specific 
> if an application is to know how to make use of this.


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> We use `_t` suffixes rather than `_e` for `enums` so `odp_threshold_type_t` 
>> would be more standard here, but we already have an `odp_threshold_type_t` 
>> defined above. The problem seems to be `_t` already implies type, so "type 
>> type" is redundant. 
>> 
>> Perhaps a better choice is an `odp_threshold_t` has an 
>> `odp_threshold_metric_t metric` field that is the enum above. It's not clear 
>> how the `odp_threshold_type_t` bits are intended to be used. Capabilities?


>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>> Need Doxygen for each struct and union


 Bill Fischofer(Bill-Fischofer-Linaro) wrote:
 Doxygen 1.8.13 requires every element to be documented.


> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> Again this new type should follow the PR #250 model.


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> Since we've given conceptual approval to PR #250, these changes should 
>> be based on that and this definition would be part of 
>> abi-default/std_types.h.


https://github.com/Linaro/odp/pull/277#discussion_r149238819
updated_at 2017-11-07 00:10:06


Re: [lng-odp] [PATCH API-NEXT v1] api: random early detection and back pressure

2017-11-06 Thread Github ODP bot
Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page:

include/odp/api/spec/threshold.h
line 52
@@ -0,0 +1,89 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP threshold descriptor
+ */
+
+#ifndef ODP_API_THRESHOLD_H_
+#define ODP_API_THRESHOLD_H_
+#include 
+#include 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Supported threshold types
+ *
+ * Supported threshold types in a bit field structure.
+ */
+typedef union odp_threshold_type_t {
+   struct {
+   /** Percentage of the total size of pool or queue */
+   uint8_t percent:1;
+   /* Number of transient packets */
+   uint8_t pkt_cnt:1;
+   /* Total size of all transient packets in bytes */
+   uint8_t pkt_size:1;
+   };
+   /** All bits of the bit field structure */
+   uint8_t all_bits;
+} odp_threshold_type_t;
+
+/**
+ * ODP Threshold types
+ *
+ * Different types of threshold measurements
+ */
+typedefenum {
+   /** Percentage of the total size of pool or queue */
+   odp_percent_e,
+   /** Number of transient packets */
+   odp_pkt_count_e,
+   /** Total size of all transient packets in bytes */
+   odp_pkt_size_e
+} odp_threshold_type_e;


Comment:
We use `_t` suffixes rather than `_e` for `enums` so `odp_threshold_type_t` 
would be more standard here, but we already have an `odp_threshold_type_t` 
defined above. The problem seems to be `_t` already implies type, so "type 
type" is redundant. 

Perhaps a better choice is an `odp_threshold_t` has an `odp_threshold_metric_t 
metric` field that is the enum above. It's not clear how the 
`odp_threshold_type_t` bits are intended to be used. Capabilities?

> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> Need Doxygen for each struct and union


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> Doxygen 1.8.13 requires every element to be documented.


>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>> Again this new type should follow the PR #250 model.


 Bill Fischofer(Bill-Fischofer-Linaro) wrote:
 Since we've given conceptual approval to PR #250, these changes should be 
 based on that and this definition would be part of abi-default/std_types.h.


https://github.com/Linaro/odp/pull/277#discussion_r149236700
updated_at 2017-11-07 00:10:06


Re: [lng-odp] [PATCH API-NEXT v1] api: random early detection and back pressure

2017-11-06 Thread Github ODP bot
Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page:

include/odp/api/spec/threshold.h
line 64
@@ -0,0 +1,89 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP threshold descriptor
+ */
+
+#ifndef ODP_API_THRESHOLD_H_
+#define ODP_API_THRESHOLD_H_
+#include 
+#include 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Supported threshold types
+ *
+ * Supported threshold types in a bit field structure.
+ */
+typedef union odp_threshold_type_t {
+   struct {
+   /** Percentage of the total size of pool or queue */
+   uint8_t percent:1;
+   /* Number of transient packets */
+   uint8_t pkt_cnt:1;
+   /* Total size of all transient packets in bytes */
+   uint8_t pkt_size:1;
+   };
+   /** All bits of the bit field structure */
+   uint8_t all_bits;
+} odp_threshold_type_t;
+
+/**
+ * ODP Threshold types
+ *
+ * Different types of threshold measurements
+ */
+typedefenum {
+   /** Percentage of the total size of pool or queue */
+   odp_percent_e,
+   /** Number of transient packets */
+   odp_pkt_count_e,
+   /** Total size of all transient packets in bytes */
+   odp_pkt_size_e
+} odp_threshold_type_e;
+
+/**
+ * ODP Threshold
+ *
+ * Threshold configuration
+ */
+typedef struct odp_threshold_t {
+   /** Type of threshold */
+   odp_threshold_type_e type;
+   union {
+   struct {
+   /** Max percentage value */


Comment:
Need Doxygen for each struct and union

> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> Doxygen 1.8.13 requires every element to be documented.


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> Again this new type should follow the PR #250 model.


>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>> Since we've given conceptual approval to PR #250, these changes should be 
>>> based on that and this definition would be part of abi-default/std_types.h.


https://github.com/Linaro/odp/pull/277#discussion_r149235050
updated_at 2017-11-07 00:10:06


Re: [lng-odp] [PATCH API-NEXT v1] api: random early detection and back pressure

2017-11-06 Thread Github ODP bot
Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page:

include/odp/api/spec/threshold.h
line 28
@@ -0,0 +1,89 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP threshold descriptor
+ */
+
+#ifndef ODP_API_THRESHOLD_H_
+#define ODP_API_THRESHOLD_H_
+#include 
+#include 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Supported threshold types
+ *
+ * Supported threshold types in a bit field structure.
+ */
+typedef union odp_threshold_type_t {
+   struct {


Comment:
Doxygen 1.8.13 requires every element to be documented.

> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> Again this new type should follow the PR #250 model.


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> Since we've given conceptual approval to PR #250, these changes should be 
>> based on that and this definition would be part of abi-default/std_types.h.


https://github.com/Linaro/odp/pull/277#discussion_r149234952
updated_at 2017-11-07 00:10:06


Re: [lng-odp] [PATCH API-NEXT v1] api: random early detection and back pressure

2017-11-06 Thread Github ODP bot
Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page:

platform/linux-generic/include/odp/api/std_types.h
line 6
@@ -29,6 +29,8 @@ extern "C" {
 
 typedef int odp_bool_t;
 
+typedef uint16_t odp_percent_t;
+
 /**


Comment:
Since we've given conceptual approval to PR #250, these changes should be based 
on that and this definition would be part of abi-default/std_types.h.

https://github.com/Linaro/odp/pull/277#discussion_r149234218
updated_at 2017-11-07 00:10:06


Re: [lng-odp] [PATCH API-NEXT v1] api: random early detection and back pressure

2017-11-06 Thread Github ODP bot
Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page:

platform/linux-generic/include/odp/api/threshold.h
line 33
@@ -0,0 +1,34 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP threshold API - platform specific header
+ */
+
+#ifndef ODP_PLAT_THRESHOLD_H_
+#define ODP_PLAT_THRESHOLD_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @ingroup odp_threshold
+ *  @{
+ */
+
+/**
+ * @}
+ */
+
+#include 
+
+#ifdef __cplusplus
+}
+#endif
+


Comment:
Again this new type should follow the PR #250 model.

> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> Since we've given conceptual approval to PR #250, these changes should be 
> based on that and this definition would be part of abi-default/std_types.h.


https://github.com/Linaro/odp/pull/277#discussion_r149234513
updated_at 2017-11-07 00:10:06


[lng-odp] [PATCH v2 1/1] changelog: updates for odp v1.16.0.0

2017-11-06 Thread Github ODP bot
From: Bill Fischofer 

Signed-off-by: Bill Fischofer 
---
/** Email created from pull request 275 (Bill-Fischofer-Linaro:v1.16-changelog)
 ** https://github.com/Linaro/odp/pull/275
 ** Patch: https://github.com/Linaro/odp/pull/275.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: bb0af2fe74203f4b5aa28d5eaeac38035c111b46
 **/
 CHANGELOG | 207 ++
 1 file changed, 207 insertions(+)

diff --git a/CHANGELOG b/CHANGELOG
index 866e51e95..ec0f777cb 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,210 @@
+== OpenDataPlane (1.16.0.0)
+=== New Features
+ODP v1.16.0.0 is the final preview release before the official release of
+Tiger Moth. It introduces new APIs and extensions, as well as bug fixes and
+functional improvements.
+
+ APIs
+The following new and changed APIs are included in this release:
+
+= Initialization Changes
+The new `odp_feature_t` type is introduced that defines various feature bits
+for ODP components. This is used in an expanded `odp_init_t` argument to
+`odp_init_global()` to specify which ODP features are unused by the
+application. For example, if the application knows it will not be making use
+of crypto features or the classifier, this may permit the ODP implementation
+to configure itself more efficiently. Results are undefined if an application
+asserts that it will not be using a feature and it attempts to do so
+afterwards.
+
+Associated with this new support the `odp_init_param_init()` API is added
+to initialize the `odp_init_t` struct to default values.
+
+= Packet API Changes
+
+* The `odp_packet_unshared_len()` API is removed. Testing showed that this
+API was non-essential and conflicted with the goal of implementation
+efficiency.
+* The `odp_print_packet_data()` API is added. This permits packet data to
+be logged along with platform-defined metadata for debugging or diagnostic
+purposes.
+
+= PktIO API Changes
+
+* The `loop_supported` attribute of the `odp_pktio_capability_t` struct is
+deprecated since this is redundant. The `enable_loop` field of the
+`odp_pktio_config_t` struct (which is returned as part of the
+`odp_packet_capability_t` struct) is the proper way to determine whether a
+PktIO supports loopback mode.
+
+= System Info API Changes
+
+* The documentation for the `odp_sys_huge_page_size()` API is updated to
+clarify that a 0 return code indicates that huge pages are not supported by
+this platform.
+* The `odp_sys_huge_page_size_all()` API is added to return all
+huge page sizes supported by this platform.
+
+= Timer API Changes
+
+* The documentation for the various parameters contained in the
+`odp_timer_pool_param_t` struct are expanded and clarified.
+
+=== Miscellaneous Fixes and Improvements
+
+ Default Packet Headroom
+The default packet headroom in `odp-linux` has been increased from 66 to
+128 bytes for better compatibility with `odp-dpdk`.
+
+ Zero-copy Packet References
+The `odp-linux` reference implementation now fully supports zero-copy
+packet references. Previously these APIs were implemented via packet copies,
+which while functionally correct, were not how these APIs are intended to
+operate.
+
+ DPDK Zero-copy I/O support
+The `--enable-dpdk-zero-copy` `configure` option is added to allow DPDK PktIO
+devices to avoid data copies, leading to improved performance.
+
+ DPDK Checksum offload support
+DPDK PktIO now makes use of RX and TX IP/UDP/TCP checksum offload.
+
+ Shared memory stored in /dev/shm
+In the `odp-linux` reference implementation, shared memory is now backed to
+`/dev/shm` rather than `/tmp` for better reliability and robustness. This may
+be overridden as part of ODP build-time customization if desired.
+
+ IPC Improvements
+PktIO IPC support has received improvements in both performance and
+reliability and is now suitable for development use.
+
+=== Dependency Changes
+
+ Dependency on autoconf-archive removed
+Since some build environments do not supply autoconf-archive, this dependency
+is removed.
+
+ DPDK support upgraded to 17.08 release
+The ODP DPDK Packet I/O support has been upgraded to work with the DPDK 17.08
+release.
+
+ Added support for OpenSSL 1.1.x releases
+ODP use of OpenSSL for crypto processing has been upgraded to allow use of
+OpenSSL 1.1.x.
+
+=== Build System Restructure
+The ODP build system has been overhauled to support more comprehensive and
+efficient automated testing under Travis CI. Greater use of Autoconf is now
+made to control ODP configuration and build options, permitting greater
+environmental flexibility. This includes an expanded range of test coverage,
+including cross-compilation support for ARMv8, MIPS,and Power architectures,
+as well as testing under the latest levels of GCC and clang.
+
+=== Arm Architecture Support Improvements
+
+* ARMv8 generic timer support is now included
+* Improved time efficiency and accuracy by using na

[lng-odp] [PATCH v2 0/1] changelog: updates for odp v1.16.0.0

2017-11-06 Thread Github ODP bot
Signed-off-by: Bill Fischofer bill.fischo...@linaro.org

github
/** Email created from pull request 275 (Bill-Fischofer-Linaro:v1.16-changelog)
 ** https://github.com/Linaro/odp/pull/275
 ** Patch: https://github.com/Linaro/odp/pull/275.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: bb0af2fe74203f4b5aa28d5eaeac38035c111b46
 **/
/github

checkpatch.pl
total: 0 errors, 0 warnings, 0 checks, 210 lines checked


to_send-p-000.patch has no obvious style problems and is ready for submission.
/checkpatch.pl


[lng-odp] [PATCH v3 3/4] linux-generic: init: implement odp_init_param_init()

2017-11-06 Thread Github ODP bot
From: Bill Fischofer 

Signed-off-by: Bill Fischofer 
Reviewed-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 278 (muvarov:next2)
 ** https://github.com/Linaro/odp/pull/278
 ** Patch: https://github.com/Linaro/odp/pull/278.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: 7b1bdbd556cad7a42550ae18152f2f9281b6930e
 **/
 platform/linux-generic/odp_init.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/platform/linux-generic/odp_init.c 
b/platform/linux-generic/odp_init.c
index 92a583702..fe03709b7 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -25,6 +25,11 @@
 
 struct odp_global_data_s odp_global_data;
 
+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)



[lng-odp] [PATCH v3 1/4] api: feature: add odp feature bits

2017-11-06 Thread Github ODP bot
From: Bill Fischofer 

Add new odp_feature_t bits that permit other APIs/components to
refer to various ODP features.

Signed-off-by: Bill Fischofer 
Reviewed-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 278 (muvarov:next2)
 ** https://github.com/Linaro/odp/pull/278
 ** Patch: https://github.com/Linaro/odp/pull/278.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: 7b1bdbd556cad7a42550ae18152f2f9281b6930e
 **/
 include/Makefile.am  |  1 +
 include/odp/api/spec/feature.h   | 69 
 include/odp_api.h|  1 +
 platform/linux-generic/Makefile.am   |  1 +
 platform/linux-generic/include/odp/api/feature.h | 34 
 5 files changed, 106 insertions(+)
 create mode 100644 include/odp/api/spec/feature.h
 create mode 100644 platform/linux-generic/include/odp/api/feature.h

diff --git a/include/Makefile.am b/include/Makefile.am
index a3a7e1658..746b5975f 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -17,6 +17,7 @@ odpapispecinclude_HEADERS = \
  odp/api/spec/debug.h \
  odp/api/spec/errno.h \
  odp/api/spec/event.h \
+ odp/api/spec/feature.h \
  odp/api/spec/hash.h \
  odp/api/spec/hints.h \
  odp/api/spec/init.h \
diff --git a/include/odp/api/spec/feature.h b/include/odp/api/spec/feature.h
new file mode 100644
index 0..0cfc141db
--- /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 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+
+/** @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 
+#endif
diff --git a/include/odp_api.h b/include/odp_api.h
index 060ec888b..3a03a05b8 100644
--- a/include/odp_api.h
+++ b/include/odp_api.h
@@ -32,6 +32,7 @@ extern "C" {
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 0b29e613c..356f229bb 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -35,6 +35,7 @@ odpapiinclude_HEADERS = \
  include/odp/api/deprecated.h \
  include/odp/api/errno.h \
  include/odp/api/event.h \
+ include/odp/api/feature.h \
  include/odp/api/hash.h \
  include/odp/api/hints.h \
  include/odp/api/init.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 0..55a86a831
--- /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 
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif



[lng-odp] [PATCH v3 2/4] api: init: add support for unused features

2017-11-06 Thread Github ODP bot
From: Bill Fischofer 

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 
Reviewed-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 278 (muvarov:next2)
 ** https://github.com/Linaro/odp/pull/278
 ** Patch: https://github.com/Linaro/odp/pull/278.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: 7b1bdbd556cad7a42550ae18152f2f9281b6930e
 **/
 include/odp/api/spec/init.h | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h
index 154cdf8f3..e8ec41136 100644
--- a/include/odp/api/spec/init.h
+++ b/include/odp/api/spec/init.h
@@ -29,6 +29,7 @@ extern "C" {
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -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
  *



[lng-odp] [PATCH v3 4/4] validation: init: use odp_init_param_init() in init tests

2017-11-06 Thread Github ODP bot
From: Bill Fischofer 

Provide test coverage for odp_init_param_init() API.

Signed-off-by: Bill Fischofer 
Reviewed-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 278 (muvarov:next2)
 ** https://github.com/Linaro/odp/pull/278
 ** Patch: https://github.com/Linaro/odp/pull/278.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: 7b1bdbd556cad7a42550ae18152f2f9281b6930e
 **/
 test/validation/api/init/init.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/validation/api/init/init.c b/test/validation/api/init/init.c
index d44ff2347..3dc40ea5f 100644
--- a/test/validation/api/init/init.c
+++ b/test/validation/api/init/init.c
@@ -26,10 +26,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);
@@ -79,10 +79,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;



[lng-odp] [PATCH v3 0/4] port features commits from api-next to next v2

2017-11-06 Thread Github ODP bot


github
/** Email created from pull request 278 (muvarov:next2)
 ** https://github.com/Linaro/odp/pull/278
 ** Patch: https://github.com/Linaro/odp/pull/278.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: 7b1bdbd556cad7a42550ae18152f2f9281b6930e
 **/
/github

checkpatch.pl
total: 0 errors, 0 warnings, 0 checks, 124 lines checked


to_send-p-000.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 30 lines checked


to_send-p-001.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 11 lines checked


to_send-p-002.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 24 lines checked


to_send-p-003.patch has no obvious style problems and is ready for submission.
/checkpatch.pl


[lng-odp] [PATCH v1 4/4] validation: init: use odp_init_param_init() in init tests

2017-11-06 Thread Github ODP bot
From: Bill Fischofer 

Provide test coverage for odp_init_param_init() API.

Signed-off-by: Bill Fischofer 
Reviewed-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 278 (muvarov:next2)
 ** https://github.com/Linaro/odp/pull/278
 ** Patch: https://github.com/Linaro/odp/pull/278.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: c83975d85777ff167e18764bf9fd8f310a65e206
 **/
 test/validation/api/init/init.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/validation/api/init/init.c b/test/validation/api/init/init.c
index d44ff2347..3dc40ea5f 100644
--- a/test/validation/api/init/init.c
+++ b/test/validation/api/init/init.c
@@ -26,10 +26,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);
@@ -79,10 +79,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;



[lng-odp] [PATCH v1 2/4] api: init: add support for unused features

2017-11-06 Thread Github ODP bot
From: Bill Fischofer 

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 
Reviewed-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 278 (muvarov:next2)
 ** https://github.com/Linaro/odp/pull/278
 ** Patch: https://github.com/Linaro/odp/pull/278.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: c83975d85777ff167e18764bf9fd8f310a65e206
 **/
 include/odp/api/spec/init.h | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h
index 154cdf8f3..e8ec41136 100644
--- a/include/odp/api/spec/init.h
+++ b/include/odp/api/spec/init.h
@@ -29,6 +29,7 @@ extern "C" {
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -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
  *



[lng-odp] [PATCH v1 3/4] linux-generic: init: implement odp_init_param_init()

2017-11-06 Thread Github ODP bot
From: Bill Fischofer 

Signed-off-by: Bill Fischofer 
Reviewed-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 278 (muvarov:next2)
 ** https://github.com/Linaro/odp/pull/278
 ** Patch: https://github.com/Linaro/odp/pull/278.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: c83975d85777ff167e18764bf9fd8f310a65e206
 **/
 platform/linux-generic/odp_init.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/platform/linux-generic/odp_init.c 
b/platform/linux-generic/odp_init.c
index 92a583702..6a45f3986 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -25,6 +25,11 @@
 
 struct odp_global_data_s odp_global_data;
 
+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)



[lng-odp] [PATCH v1 0/4] port features commits from api-next to next v2

2017-11-06 Thread Github ODP bot


github
/** Email created from pull request 278 (muvarov:next2)
 ** https://github.com/Linaro/odp/pull/278
 ** Patch: https://github.com/Linaro/odp/pull/278.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: c83975d85777ff167e18764bf9fd8f310a65e206
 **/
/github

checkpatch.pl
total: 0 errors, 0 warnings, 0 checks, 124 lines checked


to_send-p-000.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 30 lines checked


to_send-p-001.patch has no obvious style problems and is ready for submission.
WARNING: please, no spaces at the start of a line
#30: FILE: platform/linux-generic/odp_init.c:30:
+   memset(param, 0, sizeof(odp_init_t));$

total: 0 errors, 1 warnings, 0 checks, 11 lines checked


to_send-p-002.patch has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 0 warnings, 0 checks, 24 lines checked


to_send-p-003.patch has no obvious style problems and is ready for submission.
/checkpatch.pl


[lng-odp] [PATCH v1 1/4] api: feature: add odp feature bits

2017-11-06 Thread Github ODP bot
From: Bill Fischofer 

Add new odp_feature_t bits that permit other APIs/components to
refer to various ODP features.

Signed-off-by: Bill Fischofer 
Reviewed-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 278 (muvarov:next2)
 ** https://github.com/Linaro/odp/pull/278
 ** Patch: https://github.com/Linaro/odp/pull/278.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: c83975d85777ff167e18764bf9fd8f310a65e206
 **/
 include/Makefile.am  |  1 +
 include/odp/api/spec/feature.h   | 69 
 include/odp_api.h|  1 +
 platform/linux-generic/Makefile.am   |  1 +
 platform/linux-generic/include/odp/api/feature.h | 34 
 5 files changed, 106 insertions(+)
 create mode 100644 include/odp/api/spec/feature.h
 create mode 100644 platform/linux-generic/include/odp/api/feature.h

diff --git a/include/Makefile.am b/include/Makefile.am
index a3a7e1658..746b5975f 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -17,6 +17,7 @@ odpapispecinclude_HEADERS = \
  odp/api/spec/debug.h \
  odp/api/spec/errno.h \
  odp/api/spec/event.h \
+ odp/api/spec/feature.h \
  odp/api/spec/hash.h \
  odp/api/spec/hints.h \
  odp/api/spec/init.h \
diff --git a/include/odp/api/spec/feature.h b/include/odp/api/spec/feature.h
new file mode 100644
index 0..0cfc141db
--- /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 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+
+/** @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 
+#endif
diff --git a/include/odp_api.h b/include/odp_api.h
index 060ec888b..3a03a05b8 100644
--- a/include/odp_api.h
+++ b/include/odp_api.h
@@ -32,6 +32,7 @@ extern "C" {
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 0b29e613c..356f229bb 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -35,6 +35,7 @@ odpapiinclude_HEADERS = \
  include/odp/api/deprecated.h \
  include/odp/api/errno.h \
  include/odp/api/event.h \
+ include/odp/api/feature.h \
  include/odp/api/hash.h \
  include/odp/api/hints.h \
  include/odp/api/init.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 0..55a86a831
--- /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 
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif



Re: [lng-odp] [PATCH API-NEXT v4] api: pool subparameters

2017-11-06 Thread Github ODP bot
Petri Savolainen(psavol) replied on github web page:

include/odp/api/spec/pool.h
line 212
@@ -163,79 +172,133 @@ typedef struct odp_pool_capability_t {
 int odp_pool_capability(odp_pool_capability_t *capa);
 
 /**
+ * Packet pool subparameters
+ */
+typedef struct odp_pool_pkt_subparam_t {
+   /** Number of 'len' byte packets. */
+   uint32_t num;
+
+   /** Packet length in bytes */
+   uint32_t len;
+
+} odp_pool_pkt_subparam_t;
+
+/**
  * Pool parameters
- * Used to communicate pool creation options.
- * @note A single thread may not be able to allocate all 'num' elements
- * from the pool at any particular time, as other threads or hardware
- * blocks are allowed to keep some for caching purposes.
+ *
+ * A note for all pool types: a single thread may not be able to allocate all
+ * 'num' elements from the pool at any particular time, as implementations are
+ * allowed to store some elements (per thread and HW engine) for caching
+ * purposes.
  */
 typedef struct odp_pool_param_t {
/** Pool type */
int type;
 
-   /** Variant parameters for different pool types */
-   union {
-   /** Parameters for buffer pools */
-   struct {
-   /** Number of buffers in the pool */
-   uint32_t num;
-
-   /** Buffer size in bytes. The maximum number of bytes
-   application will store in each buffer. */
-   uint32_t size;
-
-   /** Minimum buffer alignment in bytes. Valid values are
-   powers of two. Use 0 for default alignment.
-   Default will always be a multiple of 8. */
-   uint32_t align;
-   } buf;
-
-   /** Parameters for packet pools */
-   struct {
-   /** The number of packets that the pool must provide
-   that are packet length 'len' bytes or smaller.
-   The maximum value is defined by pool capability
-   pkt.max_num. */
-   uint32_t num;
-
-   /** Minimum packet length that the pool must provide
-   'num' packets. The number of packets may be less
-   than 'num' when packets are larger than 'len'.
-   The maximum value is defined by pool capability
-   pkt.max_len. Use 0 for default. */
-   uint32_t len;
-
-   /** Maximum packet length that will be allocated from
-   the pool. The maximum value is defined by pool
-   capability pkt.max_len. Use 0 for default (the
-   pool maximum). */
-   uint32_t max_len;
-
-   /** Minimum number of packet data bytes that are stored
-   in the first segment of a packet. The maximum value
-   is defined by pool capability pkt.max_seg_len.
-   Use 0 for default. */
-   uint32_t seg_len;
-
-   /** User area size in bytes. The maximum value is
-   defined by pool capability pkt.max_uarea_size.
-   Specify as 0 if no user area is needed. */
-   uint32_t uarea_size;
-
-   /** Minimum Headroom size in bytes. Each newly allocated
-   packet from the pool must have at least this much
-   headroom. The maximum value is defined by pool
-   capability pkt.max_headroom.
-   Use zero if headroom is not needed. */
-   uint32_t headroom;
-   } pkt;
-
-   /** Parameters for timeout pools */
-   struct {
-   /** Number of timeouts in the pool */
-   uint32_t num;
-   } tmo;
-   };
+   /** Parameters for buffer pools */
+   struct {
+   /** Number of buffers in the pool */
+   uint32_t num;
+
+   /** Buffer size in bytes. The maximum number of bytes
+*  application will store in each buffer.
+*/
+   uint32_t size;
+
+   /** Minimum buffer alignment in bytes. Valid values are
+*  powers of two. Use 0 for default alignment.
+*  Default will always be a multiple of 8.
+*/
+   uint32_t align;
+   } buf;
+
+   /** Parameters for packet pools */
+   struct {
+   /** Minimum number of 'len' byte packets.
+*
+*  The pool must contain at least this many packets that are
+*  'len' bytes or smaller. An implem

Re: [lng-odp] [PATCH API-NEXT v4] api: pool subparameters

2017-11-06 Thread Github ODP bot
Petri Savolainen(psavol) replied on github web page:

include/odp/api/spec/pool.h
line 48
@@ -163,79 +172,133 @@ typedef struct odp_pool_capability_t {
 int odp_pool_capability(odp_pool_capability_t *capa);
 
 /**
+ * Packet pool subparameters
+ */
+typedef struct odp_pool_pkt_subparam_t {
+   /** Number of 'len' byte packets. */
+   uint32_t num;
+
+   /** Packet length in bytes */
+   uint32_t len;
+
+} odp_pool_pkt_subparam_t;
+
+/**
  * Pool parameters
- * Used to communicate pool creation options.
- * @note A single thread may not be able to allocate all 'num' elements
- * from the pool at any particular time, as other threads or hardware
- * blocks are allowed to keep some for caching purposes.
+ *
+ * A note for all pool types: a single thread may not be able to allocate all
+ * 'num' elements from the pool at any particular time, as implementations are
+ * allowed to store some elements (per thread and HW engine) for caching
+ * purposes.


Comment:
This text didn't change other than I removed "@note" doxygen tag.

It says that application cannot assume that all free packets are allways 
available to all threads == per thread caching is allowed. 

> NikhilA-Linaro wrote
> This limitation is implementation specific. Why API wants to impose a generic 
> limitation of APIs


>> NikhilA-Linaro wrote
>> 1. Traditionally a  pool means - a fixed size memory chunks. In case of 
>> packet buffer pool,  the buffers units are of single size. If you need 
>> packet buffer pools of different size,  different packet buffers pools shall 
>> be attached to packet io or other entity.
>> 2. These sub parameters will create ambiguity when application allocates 
>> different packets of different sizes. API needs to define the clear 
>> requirement in that case.
>> 3.  Providing info for SG allocations from application is implementation 
>> specific. I don't think this suits for a common data plane API. 


https://github.com/Linaro/odp/pull/234#discussion_r149019279
updated_at 2017-11-06 08:44:32


[lng-odp] [PATCH API-NEXT v1 7/7] linux-generic: queue: implementation for RED and BP

2017-11-06 Thread Github ODP bot
From: Balasubramanian Manoharan 

linux-generic does not support RED and BP at queue level.

Signed-off-by: Balasubramanian Manoharan 
---
/** Email created from pull request 277 (bala-manoharan:RED)
 ** https://github.com/Linaro/odp/pull/277
 ** Patch: https://github.com/Linaro/odp/pull/277.patch
 ** Base sha: d22c949cc466bf28de559855a1cb525740578137
 ** Merge commit sha: f8726f45026a85ce1dde794190c1eb35945dca3f
 **/
 platform/linux-generic/odp_queue.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/platform/linux-generic/odp_queue.c 
b/platform/linux-generic/odp_queue.c
index 3f355e695..8d90bef54 100644
--- a/platform/linux-generic/odp_queue.c
+++ b/platform/linux-generic/odp_queue.c
@@ -151,7 +151,8 @@ static int queue_capability(odp_queue_capability_t *capa)
capa->sched_prios   = odp_schedule_num_prio();
capa->plain.max_num = capa->max_queues;
capa->sched.max_num = capa->max_queues;
-
+   capa->random_early_detection = ODP_SUPPORT_NO;
+   capa->back_pressure = ODP_SUPPORT_NO;
return 0;
 }
 



[lng-odp] [PATCH API-NEXT v1 6/7] linux-generic: pool: implementation for RED and BP

2017-11-06 Thread Github ODP bot
From: Balasubramanian Manoharan 

linux-generic does not support RED and BP at pool level

Signed-off-by: Balasubramanian Manoharan 
---
/** Email created from pull request 277 (bala-manoharan:RED)
 ** https://github.com/Linaro/odp/pull/277
 ** Patch: https://github.com/Linaro/odp/pull/277.patch
 ** Base sha: d22c949cc466bf28de559855a1cb525740578137
 ** Merge commit sha: f8726f45026a85ce1dde794190c1eb35945dca3f
 **/
 platform/linux-generic/odp_pool.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/platform/linux-generic/odp_pool.c 
b/platform/linux-generic/odp_pool.c
index 40114093a..f3262bae1 100644
--- a/platform/linux-generic/odp_pool.c
+++ b/platform/linux-generic/odp_pool.c
@@ -928,6 +928,8 @@ int odp_pool_capability(odp_pool_capability_t *capa)
capa->pkt.min_seg_len  = CONFIG_PACKET_SEG_LEN_MIN;
capa->pkt.max_seg_len  = max_seg_len;
capa->pkt.max_uarea_size   = MAX_SIZE;
+   capa->pkt.random_early_detection = ODP_SUPPORT_NO;
+   capa->pkt.back_pressure = ODP_SUPPORT_NO;
 
/* Timeout pools */
capa->tmo.max_pools = ODP_CONFIG_POOLS;



[lng-odp] [PATCH API-NEXT v1 5/7] api: queue: add RED and BP configuration

2017-11-06 Thread Github ODP bot
From: Balasubramanian Manoharan 

adds random early detection and back pressure configuration to queue

Signed-off-by: Balasubramanian Manoharan 
---
/** Email created from pull request 277 (bala-manoharan:RED)
 ** https://github.com/Linaro/odp/pull/277
 ** Patch: https://github.com/Linaro/odp/pull/277.patch
 ** Base sha: d22c949cc466bf28de559855a1cb525740578137
 ** Merge commit sha: f8726f45026a85ce1dde794190c1eb35945dca3f
 **/
 include/odp/api/spec/queue.h | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h
index 73598be06..504720e8d 100644
--- a/include/odp/api/spec/queue.h
+++ b/include/odp/api/spec/queue.h
@@ -21,6 +21,8 @@ extern "C" {
 
 #include 
 #include 
+#include 
+#include 
 
 /** @defgroup odp_queue ODP QUEUE
  *  Macros and operation on a queue.
@@ -114,6 +116,18 @@ typedef struct odp_queue_capability_t {
/** Number of scheduling priorities */
unsigned sched_prios;
 
+   /** Support for Random Early Detection */
+   odp_support_t random_early_detection;
+
+   /** Supported threshold types for RED */
+   odp_threshold_type_t threshold_red;
+
+   /** Support for Back Pressure to the remote peer */
+   odp_support_t back_pressure;
+
+   /** Supported threshold types for BP */
+   odp_threshold_type_t threshold_bp;
+
/** Plain queue capabilities */
struct {
/** Maximum number of plain queues of the default size. */
@@ -202,6 +216,11 @@ typedef struct odp_queue_param_t {
  * default size. */
uint32_t size;
 
+   /* Random early detection configuration */
+   odp_red_param_t red;
+
+   /* Back Pressure configuration */
+   odp_bp_param_t bp;
 } odp_queue_param_t;
 
 /**



[lng-odp] [PATCH API-NEXT v1 4/7] api: pool: add RED and BP configuration

2017-11-06 Thread Github ODP bot
From: Balasubramanian Manoharan 

adds random early detection and back pressure configuration to pool

Signed-off-by: Balasubramanian Manoharan 
---
/** Email created from pull request 277 (bala-manoharan:RED)
 ** https://github.com/Linaro/odp/pull/277
 ** Patch: https://github.com/Linaro/odp/pull/277.patch
 ** Base sha: d22c949cc466bf28de559855a1cb525740578137
 ** Merge commit sha: f8726f45026a85ce1dde794190c1eb35945dca3f
 **/
 include/odp/api/spec/pool.h | 21 +
 1 file changed, 21 insertions(+)

diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h
index 35f783775..beb2612e6 100644
--- a/include/odp/api/spec/pool.h
+++ b/include/odp/api/spec/pool.h
@@ -20,6 +20,8 @@ extern "C" {
 #endif
 
 #include 
+#include 
+#include 
 
 /** @defgroup odp_pool ODP POOL
  *  Operations on a pool.
@@ -134,6 +136,19 @@ typedef struct odp_pool_capability_t {
 * The value of zero means that limited only by the available
 * memory size for the pool. */
uint32_t max_uarea_size;
+
+   /** Support for Random Early Detection */
+   odp_support_t random_early_detection;
+
+   /** Supported threshold type for RED */
+   odp_threshold_type_t threshold_red;
+
+   /** Support for Back Pressure to the remote peer */
+   odp_support_t back_pressure;
+
+   /** Supported threshold type for BP */
+   odp_threshold_type_t threshold_bp;
+
} pkt;
 
/** Timeout pool capabilities  */
@@ -228,6 +243,12 @@ typedef struct odp_pool_param_t {
capability pkt.max_headroom.
Use zero if headroom is not needed. */
uint32_t headroom;
+
+   /* Random Early Detection configuration */
+   odp_red_param_t red;
+
+   /* Back Pressure configuration */
+   odp_bp_param_t bp;
} pkt;
 
/** Parameters for timeout pools */



[lng-odp] [PATCH API-NEXT v1 3/7] api: red: random early detection and back pressure

2017-11-06 Thread Github ODP bot
From: Balasubramanian Manoharan 

adds random early detection configuration parameter
adds back pressure configuration parameter

Signed-off-by: Balasubramanian Manoharan 
---
/** Email created from pull request 277 (bala-manoharan:RED)
 ** https://github.com/Linaro/odp/pull/277
 ** Patch: https://github.com/Linaro/odp/pull/277.patch
 ** Base sha: d22c949cc466bf28de559855a1cb525740578137
 ** Merge commit sha: f8726f45026a85ce1dde794190c1eb35945dca3f
 **/
 include/odp/api/spec/red.h   | 79 
 platform/linux-generic/include/odp/api/red.h | 30 +++
 2 files changed, 109 insertions(+)
 create mode 100644 include/odp/api/spec/red.h
 create mode 100644 platform/linux-generic/include/odp/api/red.h

diff --git a/include/odp/api/spec/red.h b/include/odp/api/spec/red.h
new file mode 100644
index 0..c1aee238c
--- /dev/null
+++ b/include/odp/api/spec/red.h
@@ -0,0 +1,79 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP RED
+ */
+
+#ifndef ODP_API_RED_H_
+#define ODP_API_RED_H_
+#include 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+#include 
+
+/** Random Early Detection (RED)
+ * Random Early Detection is enabled to initiate a drop probability
+ * for the incoming packet when the packets in the queue/pool reaches
+ * a specified threshold.
+ * When RED is enabled for a particular flow then further incoming
+ * packets are assigned a drop probability based on the size of the
+ * pool/queue and the drop probability becomes 100% when the queue/pool
+ * is full.
+ * RED can be configured either in pool or queue depending on the platform
+ * capabilities.
+ */
+typedef struct odp_red_param_t {
+   /** A boolean to enable RED
+* When true, RED is enabled and configured with RED parameters.
+* Otherwise, RED parameters are ignored. */
+   odp_bool_t red_enable;
+
+   /** Threshold parameters for RED
+* RED is enabled when the resource limit is equal to or greater than
+* the maximum threshold value and is disabled when resource limit
+* is less than or equal to minimum threshold value. */
+   odp_threshold_t red_threshold;
+} odp_red_param_t;
+
+/** Back pressure (BP)
+ * When back pressure is enabled for a particular flow, the HW can send
+ * back pressure information to the remote peer indicating a network 
congestion.
+ * Back pressure can be configured either in the pool or queue based on the
+ * platform capabilities.
+ */
+
+typedef struct odp_bp_param_t {
+   /** A boolean to enable Back pressure
+* When true, back pressure is enabled and configured with the BP
+* parameters. Otherwise BP parameters are ignored.
+*/
+   odp_bool_t bp_enable;
+
+   /** Threshold value for back pressure.
+* BP is enabled when queue or pool value is equal to or greater
+* than the max backpressure threshold.
+* Min threshold parameters are ignored for BP configuration.
+*/
+   odp_threshold_t bp_threshold;
+} odp_bp_param_t;
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#include 
+#endif
diff --git a/platform/linux-generic/include/odp/api/red.h 
b/platform/linux-generic/include/odp/api/red.h
new file mode 100644
index 0..8bd1596e5
--- /dev/null
+++ b/platform/linux-generic/include/odp/api/red.h
@@ -0,0 +1,30 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP RED
+ */
+
+#ifndef ODP_PLAT_RED_H_
+#define ODP_PLAT_RED_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @}
+ */
+
+#include 
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif



[lng-odp] [PATCH API-NEXT v1 2/7] api: threshold: add odp_threshold_t parameter

2017-11-06 Thread Github ODP bot
From: Balasubramanian Manoharan 

odp_threshold_t is used to configure different threshold types

Signed-off-by: Balasubramanian Manoharan 
---
/** Email created from pull request 277 (bala-manoharan:RED)
 ** https://github.com/Linaro/odp/pull/277
 ** Patch: https://github.com/Linaro/odp/pull/277.patch
 ** Base sha: d22c949cc466bf28de559855a1cb525740578137
 ** Merge commit sha: f8726f45026a85ce1dde794190c1eb35945dca3f
 **/
 include/odp/api/spec/threshold.h   | 89 ++
 platform/linux-generic/include/odp/api/threshold.h | 34 +
 2 files changed, 123 insertions(+)
 create mode 100644 include/odp/api/spec/threshold.h
 create mode 100644 platform/linux-generic/include/odp/api/threshold.h

diff --git a/include/odp/api/spec/threshold.h b/include/odp/api/spec/threshold.h
new file mode 100644
index 0..d9ee53aeb
--- /dev/null
+++ b/include/odp/api/spec/threshold.h
@@ -0,0 +1,89 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP threshold descriptor
+ */
+
+#ifndef ODP_API_THRESHOLD_H_
+#define ODP_API_THRESHOLD_H_
+#include 
+#include 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Supported threshold types
+ *
+ * Supported threshold types in a bit field structure.
+ */
+typedef union odp_threshold_type_t {
+   struct {
+   /** Percentage of the total size of pool or queue */
+   uint8_t percent:1;
+   /* Number of transient packets */
+   uint8_t pkt_cnt:1;
+   /* Total size of all transient packets in bytes */
+   uint8_t pkt_size:1;
+   };
+   /** All bits of the bit field structure */
+   uint8_t all_bits;
+} odp_threshold_type_t;
+
+/**
+ * ODP Threshold types
+ *
+ * Different types of threshold measurements
+ */
+typedefenum {
+   /** Percentage of the total size of pool or queue */
+   odp_percent_e,
+   /** Number of transient packets */
+   odp_pkt_count_e,
+   /** Total size of all transient packets in bytes */
+   odp_pkt_size_e
+} odp_threshold_type_e;
+
+/**
+ * ODP Threshold
+ *
+ * Threshold configuration
+ */
+typedef struct odp_threshold_t {
+   /** Type of threshold */
+   odp_threshold_type_e type;
+   union {
+   struct {
+   /** Max percentage value */
+   odp_percent_t max;
+   /** Min percentage value */
+   odp_percent_t min;
+   } percent;
+   struct {
+   /** Max packet count */
+   uint64_t max;
+   /** Min packet count */
+   uint64_t min;
+   } pkt_count;
+   struct {
+   /** Max size of all packets */
+   uint64_t max;
+   /** Min size of all packets */
+   uint64_t min;
+   } pkt_size;
+   };
+} odp_threshold_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#include 
+#endif
diff --git a/platform/linux-generic/include/odp/api/threshold.h 
b/platform/linux-generic/include/odp/api/threshold.h
new file mode 100644
index 0..f4f362852
--- /dev/null
+++ b/platform/linux-generic/include/odp/api/threshold.h
@@ -0,0 +1,34 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP threshold API - platform specific header
+ */
+
+#ifndef ODP_PLAT_THRESHOLD_H_
+#define ODP_PLAT_THRESHOLD_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @ingroup odp_threshold
+ *  @{
+ */
+
+/**
+ * @}
+ */
+
+#include 
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif



[lng-odp] [PATCH API-NEXT v1 0/7] api: random early detection and back pressure

2017-11-06 Thread Github ODP bot
adds RED and BP configuration to both pool and queue parameters

github
/** Email created from pull request 277 (bala-manoharan:RED)
 ** https://github.com/Linaro/odp/pull/277
 ** Patch: https://github.com/Linaro/odp/pull/277.patch
 ** Base sha: d22c949cc466bf28de559855a1cb525740578137
 ** Merge commit sha: f8726f45026a85ce1dde794190c1eb35945dca3f
 **/
/github

checkpatch.pl
total: 0 errors, 0 warnings, 0 checks, 21 lines checked


to_send-p-000.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 123 lines checked


to_send-p-001.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 109 lines checked


to_send-p-002.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 39 lines checked


to_send-p-003.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 37 lines checked


to_send-p-004.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 8 lines checked


to_send-p-005.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 9 lines checked


to_send-p-006.patch has no obvious style problems and is ready for submission.
/checkpatch.pl


[lng-odp] [PATCH API-NEXT v1 1/7] api: std_types: add odp_percent_t data type

2017-11-06 Thread Github ODP bot
From: Balasubramanian Manoharan 

odp_percent_t is used to express values which are percentages

Signed-off-by: Balasubramanian Manoharan 
---
/** Email created from pull request 277 (bala-manoharan:RED)
 ** https://github.com/Linaro/odp/pull/277
 ** Patch: https://github.com/Linaro/odp/pull/277.patch
 ** Base sha: d22c949cc466bf28de559855a1cb525740578137
 ** Merge commit sha: f8726f45026a85ce1dde794190c1eb35945dca3f
 **/
 include/odp/api/spec/std_types.h   | 7 +++
 platform/linux-generic/include/odp/api/std_types.h | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/include/odp/api/spec/std_types.h b/include/odp/api/spec/std_types.h
index ec6a6df6d..97f5ad994 100644
--- a/include/odp/api/spec/std_types.h
+++ b/include/odp/api/spec/std_types.h
@@ -32,6 +32,13 @@ extern "C" {
  */
 
 /**
+ * @typedef odp_percent_t
+ * Use odp_percent_t for specifying fields that are percentages. It is a fixed
+ * point integer whose units are expressed as one-hundredth of a percent.
+ * Hence 100% is represented as integer value 1.
+ */
+
+/**
  * @}
  */
 
diff --git a/platform/linux-generic/include/odp/api/std_types.h 
b/platform/linux-generic/include/odp/api/std_types.h
index b61f33f4c..2104db03d 100644
--- a/platform/linux-generic/include/odp/api/std_types.h
+++ b/platform/linux-generic/include/odp/api/std_types.h
@@ -29,6 +29,8 @@ extern "C" {
 
 typedef int odp_bool_t;
 
+typedef uint16_t odp_percent_t;
+
 /**
  * @}
  */



[lng-odp] [PATCH v3 4/4] validation: init: use odp_init_param_init() in init tests

2017-11-06 Thread Github ODP bot
From: Bill Fischofer 

Provide test coverage for odp_init_param_init() API.

Signed-off-by: Bill Fischofer 
Reviewed-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 276 (muvarov:next)
 ** https://github.com/Linaro/odp/pull/276
 ** Patch: https://github.com/Linaro/odp/pull/276.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: bb644389b2bb70dd349aed079e00a2fea7c90eea
 **/
 test/validation/api/init/init.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/validation/api/init/init.c b/test/validation/api/init/init.c
index d44ff2347..3dc40ea5f 100644
--- a/test/validation/api/init/init.c
+++ b/test/validation/api/init/init.c
@@ -26,10 +26,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);
@@ -79,10 +79,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;



[lng-odp] [PATCH v3 3/4] linux-generic: init: implement odp_init_param_init()

2017-11-06 Thread Github ODP bot
From: Bill Fischofer 

Signed-off-by: Bill Fischofer 
Reviewed-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 276 (muvarov:next)
 ** https://github.com/Linaro/odp/pull/276
 ** Patch: https://github.com/Linaro/odp/pull/276.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: bb644389b2bb70dd349aed079e00a2fea7c90eea
 **/
 platform/linux-generic/odp_init.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/platform/linux-generic/odp_init.c 
b/platform/linux-generic/odp_init.c
index 92a583702..6a45f3986 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -25,6 +25,11 @@
 
 struct odp_global_data_s odp_global_data;
 
+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)



[lng-odp] [PATCH v3 1/4] api: feature: add odp feature bits

2017-11-06 Thread Github ODP bot
From: Bill Fischofer 

Add new odp_feature_t bits that permit other APIs/components to
refer to various ODP features.

Signed-off-by: Bill Fischofer 
Reviewed-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 276 (muvarov:next)
 ** https://github.com/Linaro/odp/pull/276
 ** Patch: https://github.com/Linaro/odp/pull/276.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: bb644389b2bb70dd349aed079e00a2fea7c90eea
 **/
 include/Makefile.am  |  1 +
 include/odp/api/spec/feature.h   | 69 
 include/odp_api.h|  1 +
 platform/linux-generic/Makefile.am   |  1 +
 platform/linux-generic/include/odp/api/feature.h | 34 
 5 files changed, 106 insertions(+)
 create mode 100644 include/odp/api/spec/feature.h
 create mode 100644 platform/linux-generic/include/odp/api/feature.h

diff --git a/include/Makefile.am b/include/Makefile.am
index a3a7e1658..746b5975f 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -17,6 +17,7 @@ odpapispecinclude_HEADERS = \
  odp/api/spec/debug.h \
  odp/api/spec/errno.h \
  odp/api/spec/event.h \
+ odp/api/spec/feature.h \
  odp/api/spec/hash.h \
  odp/api/spec/hints.h \
  odp/api/spec/init.h \
diff --git a/include/odp/api/spec/feature.h b/include/odp/api/spec/feature.h
new file mode 100644
index 0..0cfc141db
--- /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 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+
+/** @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 
+#endif
diff --git a/include/odp_api.h b/include/odp_api.h
index 060ec888b..3a03a05b8 100644
--- a/include/odp_api.h
+++ b/include/odp_api.h
@@ -32,6 +32,7 @@ extern "C" {
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 0b29e613c..356f229bb 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -35,6 +35,7 @@ odpapiinclude_HEADERS = \
  include/odp/api/deprecated.h \
  include/odp/api/errno.h \
  include/odp/api/event.h \
+ include/odp/api/feature.h \
  include/odp/api/hash.h \
  include/odp/api/hints.h \
  include/odp/api/init.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 0..55a86a831
--- /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 
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif



[lng-odp] [PATCH v3 0/4] port features commits from api-next to next

2017-11-06 Thread Github ODP bot


github
/** Email created from pull request 276 (muvarov:next)
 ** https://github.com/Linaro/odp/pull/276
 ** Patch: https://github.com/Linaro/odp/pull/276.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: bb644389b2bb70dd349aed079e00a2fea7c90eea
 **/
/github

checkpatch.pl
total: 0 errors, 0 warnings, 0 checks, 124 lines checked


to_send-p-000.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 30 lines checked


to_send-p-001.patch has no obvious style problems and is ready for submission.
WARNING: please, no spaces at the start of a line
#30: FILE: platform/linux-generic/odp_init.c:30:
+   memset(param, 0, sizeof(odp_init_t));$

total: 0 errors, 1 warnings, 0 checks, 11 lines checked


to_send-p-002.patch has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 0 warnings, 0 checks, 24 lines checked


to_send-p-003.patch has no obvious style problems and is ready for submission.
/checkpatch.pl


[lng-odp] [PATCH v3 2/4] api: init: add support for unused features

2017-11-06 Thread Github ODP bot
From: Bill Fischofer 

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 
Reviewed-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 276 (muvarov:next)
 ** https://github.com/Linaro/odp/pull/276
 ** Patch: https://github.com/Linaro/odp/pull/276.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: bb644389b2bb70dd349aed079e00a2fea7c90eea
 **/
 include/odp/api/spec/init.h | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h
index 154cdf8f3..e8ec41136 100644
--- a/include/odp/api/spec/init.h
+++ b/include/odp/api/spec/init.h
@@ -29,6 +29,7 @@ extern "C" {
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -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
  *



[lng-odp] [PATCH v2 0/4] port features commits from api-next to next

2017-11-06 Thread Github ODP bot


github
/** Email created from pull request 276 (muvarov:next)
 ** https://github.com/Linaro/odp/pull/276
 ** Patch: https://github.com/Linaro/odp/pull/276.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: 40eee55053ce892b452dc5e7033bbbdb030792f4
 **/
/github

checkpatch.pl
total: 0 errors, 0 warnings, 0 checks, 117 lines checked


to_send-p-000.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 30 lines checked


to_send-p-001.patch has no obvious style problems and is ready for submission.
WARNING: please, no spaces at the start of a line
#30: FILE: platform/linux-generic/odp_init.c:30:
+   memset(param, 0, sizeof(odp_init_t));$

total: 0 errors, 1 warnings, 0 checks, 11 lines checked


to_send-p-002.patch has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 0 warnings, 0 checks, 24 lines checked


to_send-p-003.patch has no obvious style problems and is ready for submission.
/checkpatch.pl


[lng-odp] [PATCH v2 4/4] validation: init: use odp_init_param_init() in init tests

2017-11-06 Thread Github ODP bot
From: Bill Fischofer 

Provide test coverage for odp_init_param_init() API.

Signed-off-by: Bill Fischofer 
Reviewed-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 276 (muvarov:next)
 ** https://github.com/Linaro/odp/pull/276
 ** Patch: https://github.com/Linaro/odp/pull/276.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: 40eee55053ce892b452dc5e7033bbbdb030792f4
 **/
 test/validation/api/init/init.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/validation/api/init/init.c b/test/validation/api/init/init.c
index d44ff2347..3dc40ea5f 100644
--- a/test/validation/api/init/init.c
+++ b/test/validation/api/init/init.c
@@ -26,10 +26,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);
@@ -79,10 +79,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;



[lng-odp] [PATCH v2 2/4] api: init: add support for unused features

2017-11-06 Thread Github ODP bot
From: Bill Fischofer 

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 
Reviewed-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 276 (muvarov:next)
 ** https://github.com/Linaro/odp/pull/276
 ** Patch: https://github.com/Linaro/odp/pull/276.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: 40eee55053ce892b452dc5e7033bbbdb030792f4
 **/
 include/odp/api/spec/init.h | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h
index 154cdf8f3..e8ec41136 100644
--- a/include/odp/api/spec/init.h
+++ b/include/odp/api/spec/init.h
@@ -29,6 +29,7 @@ extern "C" {
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -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
  *



[lng-odp] [PATCH v2 3/4] linux-generic: init: implement odp_init_param_init()

2017-11-06 Thread Github ODP bot
From: Bill Fischofer 

Signed-off-by: Bill Fischofer 
Reviewed-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 276 (muvarov:next)
 ** https://github.com/Linaro/odp/pull/276
 ** Patch: https://github.com/Linaro/odp/pull/276.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: 40eee55053ce892b452dc5e7033bbbdb030792f4
 **/
 platform/linux-generic/odp_init.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/platform/linux-generic/odp_init.c 
b/platform/linux-generic/odp_init.c
index 92a583702..6a45f3986 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -25,6 +25,11 @@
 
 struct odp_global_data_s odp_global_data;
 
+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)



[lng-odp] [PATCH v2 1/4] api: feature: add odp feature bits

2017-11-06 Thread Github ODP bot
From: Bill Fischofer 

Add new odp_feature_t bits that permit other APIs/components to
refer to various ODP features.

Signed-off-by: Bill Fischofer 
Reviewed-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 276 (muvarov:next)
 ** https://github.com/Linaro/odp/pull/276
 ** Patch: https://github.com/Linaro/odp/pull/276.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: 40eee55053ce892b452dc5e7033bbbdb030792f4
 **/
 include/odp/api/spec/feature.h   | 69 
 include/odp_api.h|  1 +
 platform/linux-generic/Makefile.am   |  1 +
 platform/linux-generic/include/odp/api/feature.h | 34 
 4 files changed, 105 insertions(+)
 create mode 100644 include/odp/api/spec/feature.h
 create mode 100644 platform/linux-generic/include/odp/api/feature.h

diff --git a/include/odp/api/spec/feature.h b/include/odp/api/spec/feature.h
new file mode 100644
index 0..0cfc141db
--- /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 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+
+/** @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 
+#endif
diff --git a/include/odp_api.h b/include/odp_api.h
index 060ec888b..3a03a05b8 100644
--- a/include/odp_api.h
+++ b/include/odp_api.h
@@ -32,6 +32,7 @@ extern "C" {
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 0b29e613c..356f229bb 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -35,6 +35,7 @@ odpapiinclude_HEADERS = \
  include/odp/api/deprecated.h \
  include/odp/api/errno.h \
  include/odp/api/event.h \
+ include/odp/api/feature.h \
  include/odp/api/hash.h \
  include/odp/api/hints.h \
  include/odp/api/init.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 0..55a86a831
--- /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 
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif



Re: [lng-odp] [PATCH API-NEXT v1] api: packet parse functions

2017-11-06 Thread Github ODP bot
Petri Savolainen(psavol) replied on github web page:

include/odp/api/spec/packet.h
line 96
@@ -1140,6 +1185,48 @@ int odp_packet_move_data(odp_packet_t pkt, uint32_t 
dst_offset,
  */
 
 /**
+ * Parse packet
+ *
+ * Parse protocol headers in packet data. Parsing starts at 'offset', which
+ * is the first header byte of protocol 'proto'. Parameter 'layer' defines the
+ * last layer application is interested about. Use ODP_PROTO_LAYER_ALL for all
+ * layers. The operation sets or resets packet metadata for all layers from
+ * the layer of 'proto' to the application defined last layer. Metadata of
+ * other layers have undefined values.
+ *
+ * @param pkt Packet handle
+ * @param offset  Byte offset into the packet
+ * @param proto   Protocol of the header starting at 'offset'
+ * @param layer   Continue parsing until this layer. Must be the same or higher
+ *layer than the layer of 'proto'.
+ *
+ * @retval 0 on success
+ * @retval <0 on failure
+ */
+int odp_packet_parse(odp_packet_t pkt, uint32_t offset, odp_proto_t proto,
+odp_proto_layer_t layer);
+
+/**
+ * Parse multiple packets
+ *
+ * Otherwise like odp_packet_parse(), but parses multiple packets. Packets may
+ * have unique offsets, but must start with the same protocol. Also, packets 
are
+ * parsed up to the same protocol layer.
+ *
+ * @param pkt Packet handle array
+ * @param offset  Byte offsets into the packets
+ * @param num Number of packets and offsets
+ * @param proto   Protocol of the header starting at 'offset'
+ * @param layer   Continue parsing until this layer. Must be the same or higher
+ *layer than the layer of 'proto'.
+ *
+ * @retval 0 on success
+ * @retval <0 on failure
+ */
+int odp_packet_parse_multi(const odp_packet_t pkt[], const uint32_t offset[],
+  int num, odp_proto_t proto, odp_proto_layer_t layer);
+


Comment:
A vector of packets is CPU vector instructions friendly.

> Petri Savolainen(psavol) wrote:
> The use case is mentioned in log message: parse after decrypt/IP reassembly. 
> Application has recreated an inner packet and needs to parse it before 
> continue. This is inherently SW parse which may be accelerated with CPU 
> vector instructions, etc.


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> What's the use case for a multi() form of this API? Might VPP use it? 
>> Perhaps Sachin can comment?


>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>>> We had considered an `odp_packet_parse()` function some time back but it 
>>> was rejected as something that would not fit well with hardware parsers. 
>>> What's changed?


https://github.com/Linaro/odp/pull/273#discussion_r149016354
updated_at 2017-11-06 08:26:17


Re: [lng-odp] [PATCH API-NEXT v4] api: pool subparameters

2017-11-06 Thread Github ODP bot
Petri Savolainen(psavol) replied on github web page:

include/odp/api/spec/pool.h
line 48
@@ -163,79 +172,133 @@ typedef struct odp_pool_capability_t {
 int odp_pool_capability(odp_pool_capability_t *capa);
 
 /**
+ * Packet pool subparameters
+ */
+typedef struct odp_pool_pkt_subparam_t {
+   /** Number of 'len' byte packets. */
+   uint32_t num;
+
+   /** Packet length in bytes */
+   uint32_t len;
+
+} odp_pool_pkt_subparam_t;
+
+/**
  * Pool parameters
- * Used to communicate pool creation options.
- * @note A single thread may not be able to allocate all 'num' elements
- * from the pool at any particular time, as other threads or hardware
- * blocks are allowed to keep some for caching purposes.
+ *
+ * A note for all pool types: a single thread may not be able to allocate all
+ * 'num' elements from the pool at any particular time, as implementations are
+ * allowed to store some elements (per thread and HW engine) for caching
+ * purposes.


Comment:
This text didn't change other than I removed "@note" doxygen tag.

It says that application cannot assume that all free packets are allways 
available to all threads == per thread caching is allowed. 

> NikhilA-Linaro wrote
> This limitation is implementation specific. Why API wants to impose a generic 
> limitation of APIs


>> NikhilA-Linaro wrote
>> 1. Traditionally a  pool means - a fixed size memory chunks. In case of 
>> packet buffer pool,  the buffers units are of single size. If you need 
>> packet buffer pools of different size,  different packet buffers pools shall 
>> be attached to packet io or other entity.
>> 2. These sub parameters will create ambiguity when application allocates 
>> different packets of different sizes. API needs to define the clear 
>> requirement in that case.
>> 3.  Providing info for SG allocations from application is implementation 
>> specific. I don't think this suits for a common data plane API. 


https://github.com/Linaro/odp/pull/234#discussion_r149019279
updated_at 2017-11-06 08:44:32


Re: [lng-odp] [PATCH API-NEXT v1] api: packet parse functions

2017-11-06 Thread Github ODP bot
Petri Savolainen(psavol) replied on github web page:

include/odp/api/spec/packet.h
line 76
@@ -1140,6 +1185,48 @@ int odp_packet_move_data(odp_packet_t pkt, uint32_t 
dst_offset,
  */
 
 /**
+ * Parse packet
+ *
+ * Parse protocol headers in packet data. Parsing starts at 'offset', which
+ * is the first header byte of protocol 'proto'. Parameter 'layer' defines the
+ * last layer application is interested about. Use ODP_PROTO_LAYER_ALL for all
+ * layers. The operation sets or resets packet metadata for all layers from
+ * the layer of 'proto' to the application defined last layer. Metadata of
+ * other layers have undefined values.
+ *
+ * @param pkt Packet handle
+ * @param offset  Byte offset into the packet
+ * @param proto   Protocol of the header starting at 'offset'
+ * @param layer   Continue parsing until this layer. Must be the same or higher
+ *layer than the layer of 'proto'.
+ *
+ * @retval 0 on success
+ * @retval <0 on failure
+ */
+int odp_packet_parse(odp_packet_t pkt, uint32_t offset, odp_proto_t proto,
+odp_proto_layer_t layer);
+


Comment:
The use case is mentioned in log message: parse after decrypt/IP reassembly. 
Application has recreated an inner packet and needs to parse it before 
continue. This is inherently SW parse which may be accelerated with CPU vector 
instructions, etc.

> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> What's the use case for a multi() form of this API? Might VPP use it? Perhaps 
> Sachin can comment?


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> We had considered an `odp_packet_parse()` function some time back but it was 
>> rejected as something that would not fit well with hardware parsers. What's 
>> changed?


https://github.com/Linaro/odp/pull/273#discussion_r149016178
updated_at 2017-11-06 08:25:25


Re: [lng-odp] [PATCH API-NEXT v2] AES-CTR support

2017-11-06 Thread Github ODP bot
Petri Savolainen(psavol) replied on github web page:

include/odp/api/spec/crypto.h
line 8
@@ -90,7 +90,10 @@ typedef enum {
ODP_DEPRECATE(ODP_CIPHER_ALG_AES128_CBC),
 
/** @deprecated  Use ODP_CIPHER_ALG_AES_GCM instead */
-   ODP_DEPRECATE(ODP_CIPHER_ALG_AES128_GCM)
+   ODP_DEPRECATE(ODP_CIPHER_ALG_AES128_GCM),
+
+   /** AES with counter mode */
+   ODP_CIPHER_ALG_AES_CTR,


Comment:
Yes, since ABI compatibility is promised to be maintained within an API 
version, but not between API versions.

> Dmitry Eremin-Solenikov(lumag) wrote:
> Doing so would break binary compatibility. Is it ok?


>> Petri Savolainen(psavol) wrote:
>> Same here, move upwards. On top of deprecated.


>>> Petri Savolainen(psavol) wrote:
>>> I'd move this after AES_CBC or AES_GCM. It's easier to see what's 
>>> deprecated when those are on the bottom.


https://github.com/Linaro/odp/pull/271#discussion_r149018353
updated_at 2017-11-06 08:38:59


[lng-odp] [Bug 3411] New: wrong openssl_lock pointer type

2017-11-06 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=3411

Bug ID: 3411
   Summary: wrong openssl_lock pointer type
   Product: OpenDataPlane - linux- generic reference
   Version: master
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: Crypto
  Assignee: nikhil.agar...@linaro.org
  Reporter: petri.savolai...@linaro.org
CC: lng-odp@lists.linaro.org
  Target Milestone: ---

Wrong pointer type (pointer to pointer) to openssl_lock array
caused data overlapping when running on other than 64-bit
machines.

PR 274 fixes this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[lng-odp] [PATCH 2.0 v5 1/1] linux-gen: buffer: remove burst metadata from odp_buffer_hdr_t

2017-11-06 Thread Github ODP bot
From: Kevin Wang 

The total packet meta data size was 7 cache lines for Linux-generic.
For scalable scheduler, the burst metadata is not required. So just
remove it for scalable scheduler. After the changes, the size of
the meta data is 4 cache lines for Linux-generic.

Signed-off-by: Kevin Wang 
Reviewed-by: Honnappa Nagarahalli 
Reviewed-by: Brian Brooks 
Reviewed-by: Yi He 
---
/** Email created from pull request 266 (kevinwangsk:2.0-buffer-meta)
 ** https://github.com/Linaro/odp/pull/266
 ** Patch: https://github.com/Linaro/odp/pull/266.patch
 ** Base sha: c0f99c441feadd1566b7e92789b11c30c6ee3f64
 ** Merge commit sha: c6900099bfc6a9e6ce0217a39a75ae3e071f2c6d
 **/
 platform/linux-generic/Makefile.am | 24 +-
 .../linux-generic/include/odp_buffer_internal.h|  3 ++-
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 277418142..ea0154941 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -257,16 +257,9 @@ __LIB__libodp_linux_la_SOURCES = \
   odp_pkt_queue.c \
   odp_queue_if.c \
   queue/subsystem.c \
-  queue/generic.c \
-  queue/scalable.c \
   odp_rwlock.c \
   odp_rwlock_recursive.c \
   odp_schedule_if.c \
-  schedule/generic.c \
-  schedule/iquery.c \
-  schedule/scalable.c \
-  schedule/scalable_ordered.c \
-  schedule/sp.c \
   schedule/subsystem.c \
   odp_shared_memory.c \
   odp_sorted_list.c \
@@ -354,20 +347,31 @@ endif
 
 pool/generic.lo: AM_CFLAGS += -DIM_ACTIVE_MODULE
 buffer/generic.lo: AM_CFLAGS += -DIM_ACTIVE_MODULE
+
 if ODP_SCHEDULE_SCALABLE
+__LIB__libodp_linux_la_SOURCES += schedule/scalable.c \
+ schedule/scalable_ordered.c
 schedule/scalable.lo: AM_CFLAGS += -DIM_ACTIVE_MODULE
 else
-schedule/generic.lo: AM_CFLAGS += -DIM_ACTIVE_MODULE
-endif
 if ODP_SCHEDULE_SP
+__LIB__libodp_linux_la_SOURCES += schedule/sp.c
 schedule/sp.lo: AM_CFLAGS += -DIM_ACTIVE_MODULE
-endif
+else
 if ODP_SCHEDULE_IQUERY
+__LIB__libodp_linux_la_SOURCES += schedule/iquery.c
 schedule/iquery.lo: AM_CFLAGS += -DIM_ACTIVE_MODULE
+else
+__LIB__libodp_linux_la_SOURCES += schedule/generic.c
+schedule/generic.lo: AM_CFLAGS += -DIM_ACTIVE_MODULE
+endif
 endif
+endif
+
 if ODP_SCHEDULE_SCALABLE
+__LIB__libodp_linux_la_SOURCES += queue/scalable.c
 queue/scalable.lo: AM_CFLAGS += -DIM_ACTIVE_MODULE
 else
+__LIB__libodp_linux_la_SOURCES += queue/generic.c
 queue/generic.lo: AM_CFLAGS += -DIM_ACTIVE_MODULE
 endif
 
diff --git a/platform/linux-generic/include/odp_buffer_internal.h 
b/platform/linux-generic/include/odp_buffer_internal.h
index 358c0e441..082c21577 100644
--- a/platform/linux-generic/include/odp_buffer_internal.h
+++ b/platform/linux-generic/include/odp_buffer_internal.h
@@ -73,6 +73,7 @@ struct odp_buffer_hdr_t {
/* Segments */
seg_entry_t seg[CONFIG_PACKET_MAX_SEGS];
 
+#ifndef ODP_SCHEDULE_SCALABLE
/* Burst counts */
uint8_t   burst_num;
uint8_t   burst_first;
@@ -82,7 +83,7 @@ struct odp_buffer_hdr_t {
 
/* Burst table */
struct odp_buffer_hdr_t *burst[BUFFER_BURST_SIZE];
-
+#endif
/* --- Mostly read only data --- */
 
/* User context pointer or u64 */



[lng-odp] [PATCH 2.0 v5 0/1] linux-gen: buffer: remove burst metadata from odp_buffer_hdr_t

2017-11-06 Thread Github ODP bot
The total packet meta data size was 7 cache lines for Linux-generic.
With this change the size of the meta data is 4 cache lines for
Linux-generic.
Make scalable scheduler as the default scheduler.

github
/** Email created from pull request 266 (kevinwangsk:2.0-buffer-meta)
 ** https://github.com/Linaro/odp/pull/266
 ** Patch: https://github.com/Linaro/odp/pull/266.patch
 ** Base sha: c0f99c441feadd1566b7e92789b11c30c6ee3f64
 ** Merge commit sha: c6900099bfc6a9e6ce0217a39a75ae3e071f2c6d
 **/
/github

checkpatch.pl
total: 0 errors, 0 warnings, 0 checks, 65 lines checked


to_send-p-000.patch has no obvious style problems and is ready for submission.
/checkpatch.pl