numam-dpdk/examples/ipsec-secgw/ipsec_worker.h
Lukasz Bartosik 9ad50c29d0 examples/ipsec-secgw: add app mode worker
Add application inbound/outbound worker thread and
IPsec application processing code for event mode.

Example ipsec-secgw command in app mode:
ipsec-secgw -w 0002:02:00.0,ipsec_in_max_spi=128
-w 0002:03:00.0,ipsec_in_max_spi=128 -w 0002:0e:00.0 -w 0002:10:00.1
--log-level=8 -c 0x1 -- -P -p 0x3 -u 0x1 -f aes-gcm.cfg
--transfer-mode event --event-schedule-type parallel

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 18:26:04 +02:00

42 lines
769 B
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright (C) 2020 Marvell International Ltd.
*/
#ifndef _IPSEC_WORKER_H_
#define _IPSEC_WORKER_H_
#include "ipsec.h"
enum pkt_type {
PKT_TYPE_PLAIN_IPV4 = 1,
PKT_TYPE_IPSEC_IPV4,
PKT_TYPE_PLAIN_IPV6,
PKT_TYPE_IPSEC_IPV6,
PKT_TYPE_INVALID
};
enum {
PKT_DROPPED = 0,
PKT_FORWARDED,
PKT_POSTED /* for lookaside case */
};
struct route_table {
struct rt_ctx *rt4_ctx;
struct rt_ctx *rt6_ctx;
};
/*
* Conf required by event mode worker with tx internal port
*/
struct lcore_conf_ev_tx_int_port_wrkr {
struct ipsec_ctx inbound;
struct ipsec_ctx outbound;
struct route_table rt;
} __rte_cache_aligned;
void ipsec_poll_mode_worker(void);
int ipsec_launch_one_lcore(void *args);
#endif /* _IPSEC_WORKER_H_ */