diff mbox series

[API-NEXT,v11,16/16] linux-gen: ipsec: pass checksum flags to packet parsing code

Message ID 1513094423-671-17-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v11,1/16] validation: ipsec: add ipv4 name parts | expand

Commit Message

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


Pass checksum and protocol parsing flags to packet parsing code.
Checksum checks are not yet implemented by odp_packet_parse, it will be
done later.

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

---
/** Email created from pull request 304 (lumag:ipsec-ipv6-2)
 ** https://github.com/Linaro/odp/pull/304
 ** Patch: https://github.com/Linaro/odp/pull/304.patch
 ** Base sha: 65d690fbcf03c6a4d5eb3f01bde36807833feaaa
 ** Merge commit sha: 2212038b2ceac423819d283ce07106fabe438631
 **/
 platform/linux-generic/odp_ipsec.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c
index 6568924a3..c27de1d51 100644
--- a/platform/linux-generic/odp_ipsec.c
+++ b/platform/linux-generic/odp_ipsec.c
@@ -605,6 +605,7 @@  static ipsec_sa_t *ipsec_in_single(odp_packet_t pkt,
 	odp_crypto_packet_op_param_t param;
 	int rc;
 	odp_crypto_packet_result_t crypto; /**< Crypto operation result */
+	odp_packet_parse_param_t parse_param;
 	odp_packet_hdr_t *pkt_hdr;
 
 	state.ip_offset = odp_packet_l3_offset(pkt);
@@ -770,15 +771,15 @@  static ipsec_sa_t *ipsec_in_single(odp_packet_t pkt,
 		goto err;
 	}
 
-	pkt_hdr = odp_packet_hdr(pkt);
-
-	packet_parse_reset(pkt_hdr);
+	parse_param.proto = state.is_ipv4 ?
+				ODP_PROTO_IPV4:
+				ODP_PROTO_IPV6;
+	parse_param.layer = ipsec_config.inbound.parse;
+	parse_param.chksums = ipsec_config.inbound.chksums;
 
-	packet_parse_l3_l4(pkt_hdr, parse_layer(ipsec_config.inbound.parse),
-			   state.ip_offset,
-			   state.is_ipv4 ?
-			   _ODP_ETHTYPE_IPV4 :
-			   _ODP_ETHTYPE_IPV6);
+	/* We do not care about return code here.
+	 * Parsing error should not result in IPsec error. */
+	odp_packet_parse(pkt, state.ip_offset, &parse_param);
 
 	*pkt_out = pkt;