diff mbox series

[API-NEXT,v10,2/8] linux-gen: pktio: loop: support IPsec inbound inline

Message ID 1501556421-14133-3-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [API-NEXT,v10,1/8] linux-gen: pktio: loop: support IPsec outbound inline | expand

Commit Message

Github ODP bot Aug. 1, 2017, 3 a.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Add support for inbound inline IPsec packet processing on loop
interface.

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

---
/** Email created from pull request 81 (lumag:ipsec-packet-impl-2)
 ** https://github.com/Linaro/odp/pull/81
 ** Patch: https://github.com/Linaro/odp/pull/81.patch
 ** Base sha: c16f1363303cd5fc11324acbc4dfebe0a9680a41
 ** Merge commit sha: 3b68f39ef3adaf4551e78d31bde736a535ae7ba6
 **/
 platform/linux-generic/pktio/loop.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c
index cee438ab..0229f0a9 100644
--- a/platform/linux-generic/pktio/loop.c
+++ b/platform/linux-generic/pktio/loop.c
@@ -138,6 +138,12 @@  static int loopback_recv(pktio_entry_t *pktio_entry, int index ODP_UNUSED,
 
 		packet_set_ts(pkt_hdr, ts);
 
+		/* Try IPsec inline processing */
+		if (pktio_entry->s.config.inbound_ipsec &&
+		    odp_packet_has_ipsec(pkt) &&
+		    _odp_ipsec_try_inline(pkt) == 0)
+			continue;
+
 		pktio_entry->s.stats.in_octets += pkt_len;
 
 		pkts[num_rx++] = pkt;
@@ -229,6 +235,7 @@  static int loopback_capability(pktio_entry_t *pktio_entry ODP_UNUSED,
 	odp_pktio_config_init(&capa->config);
 	capa->config.pktin.bit.ts_all = 1;
 	capa->config.pktin.bit.ts_ptp = 1;
+	capa->config.inbound_ipsec = 1;
 	capa->config.outbound_ipsec = 1;
 
 	return 0;