diff mbox series

[API-NEXT,v1,1/1] api: pktio: clarify odp_pktio_config() restrictions

Message ID 1508508006-21197-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v1,1/1] api: pktio: clarify odp_pktio_config() restrictions | expand

Commit Message

Github ODP bot Oct. 20, 2017, 2 p.m. UTC
From: Bill Fischofer <bill.fischofer@linaro.org>


Add clarification that odp_pktio_config() cannot be used to
configure options that are not supported, as indicated by
odp_pktio_capability().

Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

---
/** Email created from pull request 247 (Bill-Fischofer-Linaro:pktio-config-doc)
 ** https://github.com/Linaro/odp/pull/247
 ** Patch: https://github.com/Linaro/odp/pull/247.patch
 ** Base sha: e3108af2f0b58c2ceca422b418439bba5de04b11
 ** Merge commit sha: fc118350c5aa950e860cd53a6104b0571aa2e59b
 **/
 include/odp/api/spec/packet_io.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Savolainen, Petri (Nokia - FI/Espoo) Oct. 23, 2017, 11:46 a.m. UTC | #1
> -----Original Message-----

> From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of

> Github ODP bot

> Sent: Friday, October 20, 2017 5:00 PM

> To: lng-odp@lists.linaro.org

> Subject: [lng-odp] [PATCH API-NEXT v1 1/1] api: pktio: clarify

> odp_pktio_config() restrictions

> 

> From: Bill Fischofer <bill.fischofer@linaro.org>

> 

> Add clarification that odp_pktio_config() cannot be used to

> configure options that are not supported, as indicated by

> odp_pktio_capability().

> 

> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

> ---

> /** Email created from pull request 247 (Bill-Fischofer-Linaro:pktio-

> config-doc)

>  ** https://github.com/Linaro/odp/pull/247

>  ** Patch: https://github.com/Linaro/odp/pull/247.patch

>  ** Base sha: e3108af2f0b58c2ceca422b418439bba5de04b11

>  ** Merge commit sha: fc118350c5aa950e860cd53a6104b0571aa2e59b

>  **/

>  include/odp/api/spec/packet_io.h | 3 ++-

>  1 file changed, 2 insertions(+), 1 deletion(-)

> 

> diff --git a/include/odp/api/spec/packet_io.h

> b/include/odp/api/spec/packet_io.h

> index 52af646a6..48dd76f28 100644

> --- a/include/odp/api/spec/packet_io.h

> +++ b/include/odp/api/spec/packet_io.h

> @@ -605,7 +605,8 @@ unsigned odp_pktio_max_index(void);

>   * interface setup sequence. Use odp_pktio_capability() to query

> configuration

>   * capabilities. Use odp_pktio_config_init() to initialize

>   * configuration options into their default values. Default values are

> used

> - * when 'config' pointer is NULL.

> + * when 'config' pointer is NULL. Attempting to configure options that

> are

> + * not supported, as indicated by odp_pktio_capability(), will be

> rejected.


Why not leave this as undefined behavior (as is usual for spec violations)? This addition would say that it's OK to violate the capability spec, since params are checked anyway (e.g. not use capability but iterate through param values until success).

-Petri
diff mbox series

Patch

diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h
index 52af646a6..48dd76f28 100644
--- a/include/odp/api/spec/packet_io.h
+++ b/include/odp/api/spec/packet_io.h
@@ -605,7 +605,8 @@  unsigned odp_pktio_max_index(void);
  * interface setup sequence. Use odp_pktio_capability() to query configuration
  * capabilities. Use odp_pktio_config_init() to initialize
  * configuration options into their default values. Default values are used
- * when 'config' pointer is NULL.
+ * when 'config' pointer is NULL. Attempting to configure options that are
+ * not supported, as indicated by odp_pktio_capability(), will be rejected.
  *
  * @param pktio    Packet IO handle
  * @param config   Packet IO interface configuration. Uses defaults