This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, api-next has been updated via 926505016132ba543251eb109d5c9c93f8520314 (commit) via 037e35f0f948a87e3daede33747177615aa3bab0 (commit) from 144a2cd89865b5565a6064c3b1db4987bd1b4e58 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 926505016132ba543251eb109d5c9c93f8520314 Author: Petri Savolainen petri.savolainen@linaro.org Date: Fri Feb 17 16:20:07 2017 +0200
linux-gen: pktio: parser default config
Fill default parser configuration and capability. All pktios use same parser code, so the capability is the same (all layers).
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-and-tested-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 98460a5..5e783d8 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -923,6 +923,8 @@ void odp_pktout_queue_param_init(odp_pktout_queue_param_t *param) void odp_pktio_config_init(odp_pktio_config_t *config) { memset(config, 0, sizeof(odp_pktio_config_t)); + + config->parser.layer = ODP_PKTIO_PARSER_LAYER_ALL; }
int odp_pktio_info(odp_pktio_t hdl, odp_pktio_info_t *info) @@ -1098,6 +1100,7 @@ int odp_pktio_term_global(void) int odp_pktio_capability(odp_pktio_t pktio, odp_pktio_capability_t *capa) { pktio_entry_t *entry; + int ret;
entry = get_pktio_entry(pktio); if (entry == NULL) { @@ -1106,9 +1109,15 @@ int odp_pktio_capability(odp_pktio_t pktio, odp_pktio_capability_t *capa) }
if (entry->s.ops->capability) - return entry->s.ops->capability(entry, capa); + ret = entry->s.ops->capability(entry, capa); + else + ret = single_capability(capa);
- return single_capability(capa); + /* The same parser is used for all pktios */ + if (ret == 0) + capa->config.parser.layer = ODP_PKTIO_PARSER_LAYER_ALL; + + return ret; }
unsigned odp_pktio_max_index(void) diff --git a/test/common_plat/validation/api/pktio/pktio.c b/test/common_plat/validation/api/pktio/pktio.c index 4f3c0c0..8d62bb1 100644 --- a/test/common_plat/validation/api/pktio/pktio.c +++ b/test/common_plat/validation/api/pktio/pktio.c @@ -1178,6 +1178,8 @@ void pktio_test_pktio_config(void)
odp_pktio_config_init(&config);
+ CU_ASSERT(config.parser.layer == ODP_PKTIO_PARSER_LAYER_ALL); + CU_ASSERT(odp_pktio_config(pktio, NULL) == 0);
CU_ASSERT(odp_pktio_config(pktio, &config) == 0);
commit 037e35f0f948a87e3daede33747177615aa3bab0 Author: Petri Savolainen petri.savolainen@linaro.org Date: Fri Feb 17 16:20:06 2017 +0200
api: pktio: add parser configuration
Packet input parsing level configuration is added. An application may express the maximum layer it is interested about. Implementations may optimize packet input performance as parsing can be stopped on the application required level. Implementations are free to parse more layers than application requests.
Lazy parsing (e.g. in current odp-linux) does not work in practice. The implementation cannot continue parsing after the application has got access to packet data, since application may overwrite some packet headers. Parse results must reflect the format of the received packet.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-and-tested-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index 85cd6d1..cec1f22 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -346,6 +346,39 @@ typedef union odp_pktout_config_opt_t { } odp_pktout_config_opt_t;
/** + * Parser layers + */ +typedef enum odp_pktio_parser_layer_t { + /** No layers */ + ODP_PKTIO_PARSER_LAYER_NONE = 0, + + /** Layer L2 protocols (Ethernet, VLAN, ARP, etc) */ + ODP_PKTIO_PARSER_LAYER_L2, + + /** Layer L3 protocols (IPv4, IPv6, ICMP, IPsec, etc) */ + ODP_PKTIO_PARSER_LAYER_L3, + + /** Layer L4 protocols (UDP, TCP, SCTP) */ + ODP_PKTIO_PARSER_LAYER_L4, + + /** All layers */ + ODP_PKTIO_PARSER_LAYER_ALL + +} odp_pktio_parser_layer_t; + +/** + * Parser configuration + */ +typedef struct odp_pktio_parser_config_t { + /** Protocol parsing level in packet input + * + * Parse protocol layers in minimum up to this level during packet + * input. The default value is ODP_PKTIO_PARSER_LAYER_ALL. */ + odp_pktio_parser_layer_t layer; + +} odp_pktio_parser_config_t; + +/** * Packet IO configuration options * * Packet IO interface level configuration options. Use odp_pktio_capability() @@ -363,6 +396,9 @@ typedef struct odp_pktio_config_t { * Default value for all bits is zero. */ odp_pktout_config_opt_t pktout;
+ /** Packet input parser configuration */ + odp_pktio_parser_config_t parser; + /** Interface loopback mode * * In this mode the packets sent out through the interface is
-----------------------------------------------------------------------
Summary of changes: include/odp/api/spec/packet_io.h | 36 +++++++++++++++++++++++++++ platform/linux-generic/odp_packet_io.c | 13 ++++++++-- test/common_plat/validation/api/pktio/pktio.c | 2 ++ 3 files changed, 49 insertions(+), 2 deletions(-)
hooks/post-receive