diff mbox series

[API-NEXT,v2,2/5] linux-gen: adapt to odp_pktio_parser_layer_t removal

Message ID 1513177217-8215-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v2,1/5] api: pktio: start switching to using odp_proto_layer_t | expand

Commit Message

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


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

---
/** Email created from pull request 338 (lumag:pktio_parse_layer)
 ** https://github.com/Linaro/odp/pull/338
 ** Patch: https://github.com/Linaro/odp/pull/338.patch
 ** Base sha: d96a8207591fbcaac25b79286d7d72a537354c1f
 ** Merge commit sha: 7427c77cd44f5de84a2788e6d7d0cefaf146f479
 **/
 platform/linux-generic/include/odp_packet_internal.h |  4 ++--
 platform/linux-generic/odp_classification.c          |  2 +-
 platform/linux-generic/odp_ipsec.c                   | 14 +++++++-------
 platform/linux-generic/odp_packet.c                  | 10 +++++-----
 platform/linux-generic/odp_packet_io.c               |  4 ++--
 5 files changed, 17 insertions(+), 17 deletions(-)
diff mbox series

Patch

diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h
index a16ec3161..40f3edc1e 100644
--- a/platform/linux-generic/include/odp_packet_internal.h
+++ b/platform/linux-generic/include/odp_packet_internal.h
@@ -296,11 +296,11 @@  int packet_alloc_multi(odp_pool_t pool_hdl, uint32_t len,
 
 /* Perform packet parse up to a given protocol layer */
 int packet_parse_layer(odp_packet_hdr_t *pkt_hdr,
-		       odp_pktio_parser_layer_t layer);
+		       odp_proto_layer_t layer);
 
 /* Perform L3 and L4 parsing up to a given protocol layer */
 int packet_parse_l3_l4(odp_packet_hdr_t *pkt_hdr,
-		       odp_pktio_parser_layer_t layer,
+		       odp_proto_layer_t layer,
 		       uint32_t l3_offset,
 		       uint16_t ethtype);
 
diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c
index 025f12593..276430923 100644
--- a/platform/linux-generic/odp_classification.c
+++ b/platform/linux-generic/odp_classification.c
@@ -973,7 +973,7 @@  int cls_classify_packet(pktio_entry_t *entry, const uint8_t *base,
 	packet_set_len(pkt_hdr, pkt_len);
 
 	packet_parse_common(&pkt_hdr->p, base, pkt_len, seg_len,
-			    ODP_PKTIO_PARSER_LAYER_ALL);
+			    ODP_PROTO_LAYER_ALL);
 	cos = cls_select_cos(entry, base, pkt_hdr);
 
 	if (cos == NULL)
diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c
index 8735e6052..61ce48758 100644
--- a/platform/linux-generic/odp_ipsec.c
+++ b/platform/linux-generic/odp_ipsec.c
@@ -200,22 +200,22 @@  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_proto_layer_t parse_layer(odp_ipsec_proto_layer_t l)
 {
 	switch (l) {
 	case ODP_IPSEC_LAYER_NONE:
-		return ODP_PKTIO_PARSER_LAYER_NONE;
+		return ODP_PROTO_LAYER_NONE;
 	case ODP_IPSEC_LAYER_L2:
-		return ODP_PKTIO_PARSER_LAYER_L2;
+		return ODP_PROTO_LAYER_L2;
 	case ODP_IPSEC_LAYER_L3:
-		return ODP_PKTIO_PARSER_LAYER_L3;
+		return ODP_PROTO_LAYER_L3;
 	case ODP_IPSEC_LAYER_L4:
-		return ODP_PKTIO_PARSER_LAYER_L4;
+		return ODP_PROTO_LAYER_L4;
 	case ODP_IPSEC_LAYER_ALL:
-		return ODP_PKTIO_PARSER_LAYER_ALL;
+		return ODP_PROTO_LAYER_ALL;
 	}
 
-	return ODP_PKTIO_PARSER_LAYER_NONE;
+	return ODP_PROTO_LAYER_NONE;
 }
 
 static ipsec_sa_t *ipsec_in_single(odp_packet_t pkt,
diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c
index 5b5a9827c..50e8aa068 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -2200,7 +2200,7 @@  int packet_parse_common_l3_l4(packet_parser_t *prs, const uint8_t *parseptr,
 
 	prs->l3_offset = offset;
 
-	if (layer <= ODP_PKTIO_PARSER_LAYER_L2)
+	if (layer <= ODP_PROTO_LAYER_L2)
 		return prs->error_flags.all != 0;
 
 	/* Set l3 flag only for known ethtypes */
@@ -2231,7 +2231,7 @@  int packet_parse_common_l3_l4(packet_parser_t *prs, const uint8_t *parseptr,
 		ip_proto = 255;  /* Reserved invalid by IANA */
 	}
 
-	if (layer == ODP_PKTIO_PARSER_LAYER_L3)
+	if (layer == ODP_PROTO_LAYER_L3)
 		return prs->error_flags.all != 0;
 
 	/* Set l4 flag only for known ip_proto */
@@ -2303,7 +2303,7 @@  int packet_parse_common(packet_parser_t *prs, const uint8_t *ptr,
 	parseptr = ptr;
 	offset = 0;
 
-	if (layer == ODP_PKTIO_PARSER_LAYER_NONE)
+	if (layer == ODP_PROTO_LAYER_NONE)
 		return 0;
 
 	/* Assume valid L2 header, no CRC/FCS check in SW */
@@ -2322,7 +2322,7 @@  int packet_parse_common(packet_parser_t *prs, const uint8_t *ptr,
  * Simple packet parser
  */
 int packet_parse_layer(odp_packet_hdr_t *pkt_hdr,
-		       odp_pktio_parser_layer_t layer)
+		       odp_proto_layer_t layer)
 {
 	uint32_t seg_len = packet_first_seg_len(pkt_hdr);
 	void *base = packet_data(pkt_hdr);
@@ -2332,7 +2332,7 @@  int packet_parse_layer(odp_packet_hdr_t *pkt_hdr,
 }
 
 int packet_parse_l3_l4(odp_packet_hdr_t *pkt_hdr,
-		       odp_pktio_parser_layer_t layer,
+		       odp_proto_layer_t layer,
 		       uint32_t l3_offset,
 		       uint16_t ethtype)
 {
diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c
index aa6cdb068..ffbc73b26 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -998,7 +998,7 @@  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;
+	config->parser.layer = ODP_PROTO_LAYER_ALL;
 }
 
 int odp_pktio_info(odp_pktio_t hdl, odp_pktio_info_t *info)
@@ -1203,7 +1203,7 @@  int odp_pktio_capability(odp_pktio_t pktio, odp_pktio_capability_t *capa)
 
 	/* The same parser is used for all pktios */
 	if (ret == 0)
-		capa->config.parser.layer = ODP_PKTIO_PARSER_LAYER_ALL;
+		capa->config.parser.layer = ODP_PROTO_LAYER_ALL;
 
 	return ret;
 }