26 #ifndef FLOW_COMMON_H_
27 #define FLOW_COMMON_H_
29 #include <arpa/inet.h>
39 #define QUEUE_DEPTH (512)
40 #define SECURED_IDX (0)
41 #define UNSECURED_IDX (1)
42 #define DEFAULT_TIMEOUT_US (10000)
43 #define DEF_EXPECTED_ENTRIES (1024)
44 #define SET_L4_PORT(layer, port, value) \
46 if (match.layer.l4_type_ext == DOCA_FLOW_L4_TYPE_EXT_TCP) \
47 match.layer.tcp.l4_port.port = (value); \
48 else if (match.layer.l4_type_ext == DOCA_FLOW_L4_TYPE_EXT_UDP) \
49 match.layer.udp.l4_port.port = (value); \
52 #define BE_IPV4_ADDR(a, b, c, d) (RTE_BE32((a << 24) + (b << 16) + (c << 8) + d))
53 #define SET_IP6_ADDR(addr, a, b, c, d) \
60 #define SET_MAC_ADDR(addr, a, b, c, d, e, f) \
72 struct doca_flow_port *
port;
161 uint16_t pipe_queue);
192 struct doca_flow_port *port,
194 struct doca_flow_pipe **rss_pipe);
void doca_flow_cleanup(int nb_ports, struct ipsec_security_gw_ports_map *ports[])
doca_error_t create_rss_pipe(struct ipsec_security_gw_config *app_cfg, struct doca_flow_port *port, uint16_t nb_queues, struct doca_flow_pipe **rss_pipe)
void remove_ethernet_padding(struct rte_mbuf **m)
doca_error_t process_entries(struct doca_flow_port *port, struct entries_status *status, int timeout, uint16_t pipe_queue)
doca_error_t ipsec_security_gw_init_status(struct ipsec_security_gw_config *app_cfg, int nb_queues)
doca_error_t create_switch_ingress_root_pipes(struct ipsec_security_gw_ports_map *ports[], struct ipsec_security_gw_config *app_cfg)
void security_gateway_free_status_entries(struct ipsec_security_gw_config *app_cfg)
doca_error_t ipsec_security_gw_bind(struct ipsec_security_gw_ports_map *ports[], struct ipsec_security_gw_config *app_cfg)
void security_gateway_free_resources(struct ipsec_security_gw_config *app_cfg)
doca_error_t ipsec_security_gw_init_doca_flow(const struct ipsec_security_gw_config *app_cfg, int nb_queues, struct ipsec_security_gw_ports_map *ports[])
void create_hairpin_pipe_fwd(struct ipsec_security_gw_config *app_cfg, int port_id, bool encrypt, uint16_t *rss_queues, uint32_t rss_flags, struct doca_flow_fwd *fwd)
doca_error_t create_switch_egress_root_pipes(struct ipsec_security_gw_ports_map *ports[], struct ipsec_security_gw_config *app_cfg)
uint32_t get_icv_len_int(enum doca_flow_crypto_icv_len icv_len)
static uint16_t * rss_queues
static struct doca_flow_fwd fwd
static struct app_gpu_cfg app_cfg
enum doca_error doca_error_t
DOCA API return codes.
doca_flow_crypto_icv_len
doca flow crypto ICV length
union security_gateway_pkt_meta __attribute__((__packed__))
user context struct that will be used in entries process callback
struct ipsec_security_gw_ports_map ** ports
struct ipsec_security_gw_config * config
struct decrypt_rule * decrypt_rules
struct encrypt_rule * encrypt_rules
struct doca_flow_port * port
struct doca_flow_header_eth eth_header
static struct doca_flow_port * ports[FLOW_SWITCH_PORTS_MAX]