diff mbox series

[v4,2/3] linux-gen: ptkio: loop: inline odp_packet_has_ipsec

Message ID 1517972408-19360-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v4,1/3] linux-gen: use packet pointer in _odp_ipsec_try_inline | expand

Commit Message

Github ODP bot Feb. 7, 2018, 3 a.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 456 (lumag:ipsec-fix)
 ** https://github.com/Linaro/odp/pull/456
 ** Patch: https://github.com/Linaro/odp/pull/456.patch
 ** Base sha: 257b08b35ceea41bad5a7f1c626496cf111e657a
 ** Merge commit sha: eb3880eebfb94c83205c92a87e99dfd372a9c064
 **/
 .../linux-generic/include/odp/api/plat/packet_flag_inlines.h     | 9 +++++++++
 platform/linux-generic/pktio/loop.c                              | 3 ++-
 2 files changed, 11 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/platform/linux-generic/include/odp/api/plat/packet_flag_inlines.h b/platform/linux-generic/include/odp/api/plat/packet_flag_inlines.h
index 3212248f3..4e79ee25e 100644
--- a/platform/linux-generic/include/odp/api/plat/packet_flag_inlines.h
+++ b/platform/linux-generic/include/odp/api/plat/packet_flag_inlines.h
@@ -71,4 +71,13 @@  static inline int _odp_packet_has_ts(odp_packet_t pkt)
 	return flags.timestamp;
 }
 
+/** @internal Inline function @param pkt @return */
+static inline int _odp_packet_has_ipsec(odp_packet_t pkt)
+{
+	_odp_packet_input_flags_t flags;
+
+	flags.all = _odp_packet_input_flags(pkt);
+	return flags.ipsec;
+}
+
 #endif
diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c
index 79c21ee7a..a210c74ef 100644
--- a/platform/linux-generic/pktio/loop.c
+++ b/platform/linux-generic/pktio/loop.c
@@ -13,6 +13,7 @@ 
 #include <odp_classification_internal.h>
 #include <odp_ipsec_internal.h>
 #include <odp_debug_internal.h>
+#include <odp/api/plat/packet_flag_inlines.h>
 #include <odp/api/hints.h>
 #include <odp_queue_if.h>
 
@@ -155,7 +156,7 @@  static int loopback_recv(pktio_entry_t *pktio_entry, int index ODP_UNUSED,
 
 		/* Try IPsec inline processing */
 		if (pktio_entry->s.config.inbound_ipsec &&
-		    odp_packet_has_ipsec(pkt))
+		    _odp_packet_has_ipsec(pkt))
 			_odp_ipsec_try_inline(&pkt);
 
 		pktio_entry->s.stats.in_octets += pkt_len;