diff mbox series

[API-NEXT,v20,10/10] linux-gen: pktio: loop: support IPsec inbound inline

Message ID 1508335223-15608-11-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v20,1/10] test: validation: add IPsec API testsuite | expand

Commit Message

Github ODP bot Oct. 18, 2017, 2 p.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: edca8cd1e55898826f79383b689c2c4bd2c28b3a
 ** Merge commit sha: 750318196a0c07a634c4755e4da9131a9f11f6f1
 **/
 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 f36dcee48..8bb4b4f14 100644
--- a/platform/linux-generic/pktio/loop.c
+++ b/platform/linux-generic/pktio/loop.c
@@ -135,6 +135,12 @@  static int loopback_recv(pktio_entry_t *pktio_entry, int index ODP_UNUSED,
 
 		packet_set_ts(pkt_hdr, ts);
 		pkt_hdr->input = pktio_entry->s.handle;
+
+		/* Try IPsec inline processing */
+		if (pktio_entry->s.config.inbound_ipsec &&
+		    odp_packet_has_ipsec(pkt))
+			_odp_ipsec_try_inline(pkt);
+
 		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;