diff mbox series

[API-NEXT,v5,1/2] api: ipsec: use odp_proto_layer_t for parse layer spec

Message ID 1513173611-3364-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v5,1/2] api: ipsec: use odp_proto_layer_t for parse layer spec | expand

Commit Message

Github ODP bot Dec. 13, 2017, 2 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Usign odp_proto_layer_t for parse layer spec is more logical, as it is
the same enum that is used for the rest of packet parsing API.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 336 (lumag:ipsec-proto-layer)
 ** https://github.com/Linaro/odp/pull/336
 ** Patch: https://github.com/Linaro/odp/pull/336.patch
 ** Base sha: d96a8207591fbcaac25b79286d7d72a537354c1f
 ** Merge commit sha: 2acab8f3366dfdeb263aea1001fa070b92f81a10
 **/
 include/odp/api/spec/ipsec.h       |  4 ++--
 platform/linux-generic/odp_ipsec.c | 15 ++++++++-------
 test/validation/api/ipsec/ipsec.c  |  2 +-
 3 files changed, 11 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h
index 538472a5e..c67954689 100644
--- a/include/odp/api/spec/ipsec.h
+++ b/include/odp/api/spec/ipsec.h
@@ -156,9 +156,9 @@  typedef struct odp_ipsec_inbound_config_t {
 	 *
 	 *  Each successfully transformed packet has a valid value for L3 offset
 	 *  regardless of the parse configuration. Default value is
-	 *  ODP_IPSEC_LAYER_NONE. ODP_IPSEC_LAYER_L2 is not a valid value.
+	 *  ODP_PROTO_LAYER_NONE. ODP_PROTO_LAYER_L2 is not a valid value.
 	 */
-	odp_ipsec_proto_layer_t parse;
+	odp_proto_layer_t parse_level;
 
 	/** Flags to control IPSEC payload data checks up to the selected parse
 	 *  level. Checksum checking status can be queried for each packet with
diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c
index 8735e6052..24519442a 100644
--- a/platform/linux-generic/odp_ipsec.c
+++ b/platform/linux-generic/odp_ipsec.c
@@ -200,18 +200,18 @@  static const uint8_t ipsec_padding[255] = {
 	0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
 };
 
-static inline odp_pktio_parser_layer_t parse_layer(odp_ipsec_proto_layer_t l)
+static inline odp_pktio_parser_layer_t parse_layer(odp_proto_layer_t l)
 {
 	switch (l) {
-	case ODP_IPSEC_LAYER_NONE:
+	case ODP_PROTO_LAYER_NONE:
 		return ODP_PKTIO_PARSER_LAYER_NONE;
-	case ODP_IPSEC_LAYER_L2:
+	case ODP_PROTO_LAYER_L2:
 		return ODP_PKTIO_PARSER_LAYER_L2;
-	case ODP_IPSEC_LAYER_L3:
+	case ODP_PROTO_LAYER_L3:
 		return ODP_PKTIO_PARSER_LAYER_L3;
-	case ODP_IPSEC_LAYER_L4:
+	case ODP_PROTO_LAYER_L4:
 		return ODP_PKTIO_PARSER_LAYER_L4;
-	case ODP_IPSEC_LAYER_ALL:
+	case ODP_PROTO_LAYER_ALL:
 		return ODP_PKTIO_PARSER_LAYER_ALL;
 	}
 
@@ -553,7 +553,8 @@  static ipsec_sa_t *ipsec_in_single(odp_packet_t pkt,
 
 	packet_parse_reset(pkt_hdr);
 
-	packet_parse_l3_l4(pkt_hdr, parse_layer(ipsec_config.inbound.parse),
+	packet_parse_l3_l4(pkt_hdr,
+			   parse_layer(ipsec_config.inbound.parse_level),
 			   ip_offset, _ODP_ETHTYPE_IPV4);
 
 	*pkt_out = pkt;
diff --git a/test/validation/api/ipsec/ipsec.c b/test/validation/api/ipsec/ipsec.c
index 7b39c2c5a..1e28b384b 100644
--- a/test/validation/api/ipsec/ipsec.c
+++ b/test/validation/api/ipsec/ipsec.c
@@ -896,7 +896,7 @@  int ipsec_config(odp_instance_t ODP_UNUSED inst)
 	ipsec_config.inbound_mode = suite_context.inbound_op_mode;
 	ipsec_config.outbound_mode = suite_context.outbound_op_mode;
 	ipsec_config.inbound.default_queue = suite_context.queue;
-	ipsec_config.inbound.parse = ODP_IPSEC_LAYER_ALL;
+	ipsec_config.inbound.parse_level = ODP_PROTO_LAYER_ALL;
 
 	if (ODP_IPSEC_OK != odp_ipsec_config(&ipsec_config))
 		return -1;