[API-NEXT,v1,2/6] linux-gen: pktio: loop: support IPsec outbound inline

Message ID 1500462011-17433-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • [API-NEXT,v1,1/6] linux-gen: pktio: loop: reset packet subtype on loopback
Related show

Commit Message

Github ODP bot July 19, 2017, 11 a.m.
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Add support for outbound 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: db7cc41aeb559dd296f3a6d8570aa10326a31d5e
 ** Merge commit sha: 2ea07e66ca00decd7d3013275277a30a03d29c22
 **/
 platform/linux-generic/pktio/loop.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Patch hide | download patch | download mbox

diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c
index 27c9566d..e5803b39 100644
--- a/platform/linux-generic/pktio/loop.c
+++ b/platform/linux-generic/pktio/loop.c
@@ -85,6 +85,14 @@  static int loopback_recv(pktio_entry_t *pktio_entry, int index ODP_UNUSED,
 		pkt = packet_from_buf_hdr(hdr_tbl[i]);
 		pkt_len = odp_packet_len(pkt);
 
+		if (_odp_buffer_event_subtype(hdr_tbl[i]->handle.handle) ==
+		    ODP_EVENT_PACKET_IPSEC) {
+			odp_ipsec_packet_result_t result;
+
+			/* Possibly postprocessing packet */
+			odp_ipsec_result(&result, pkt);
+		}
+
 		/* Application can send arbitrary packets, but expects to
 		 * receive basic packets from PKTIO */
 		_odp_buffer_event_subtype_set(hdr_tbl[i]->handle.handle,
@@ -221,6 +229,8 @@  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.outbound_ipsec = 1;
+
 	return 0;
 }