NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
flow_common.h File Reference
#include <arpa/inet.h>
#include <doca_flow.h>
#include "ipsec_ctx.h"
Include dependency graph for flow_common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ipsec_security_gw_ports_map
 
struct  entries_status
 user context struct that will be used in entries process callback More...
 
struct  ipsec_security_gw_core_ctx
 
union  security_gateway_pkt_meta
 

Macros

#define QUEUE_DEPTH   (512) /* DOCA Flow queue depth */
 
#define SECURED_IDX   (0) /* Index for secured network port in ports array */
 
#define UNSECURED_IDX   (1) /* Index for unsecured network port in ports array */
 
#define DEFAULT_TIMEOUT_US   (10000) /* default timeout for processing entries */
 
#define DEF_EXPECTED_ENTRIES   (1024) /* default expected entries in the pipe */
 
#define SET_L4_PORT(layer, port, value)
 
#define BE_IPV4_ADDR(a, b, c, d)   (RTE_BE32((a << 24) + (b << 16) + (c << 8) + d)) /* Big endian conversion */
 
#define SET_IP6_ADDR(addr, a, b, c, d)
 
#define SET_MAC_ADDR(addr, a, b, c, d, e, f)
 

Functions

union security_gateway_pkt_meta __attribute__ ((__packed__))
 
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[])
 
doca_error_t ipsec_security_gw_init_status (struct ipsec_security_gw_config *app_cfg, int nb_queues)
 
doca_error_t ipsec_security_gw_bind (struct ipsec_security_gw_ports_map *ports[], struct ipsec_security_gw_config *app_cfg)
 
void doca_flow_cleanup (int nb_ports, struct ipsec_security_gw_ports_map *ports[])
 
doca_error_t process_entries (struct doca_flow_port *port, struct entries_status *status, int timeout, uint16_t pipe_queue)
 
doca_error_t create_switch_ingress_root_pipes (struct ipsec_security_gw_ports_map *ports[], struct ipsec_security_gw_config *app_cfg)
 
doca_error_t create_switch_egress_root_pipes (struct ipsec_security_gw_ports_map *ports[], struct ipsec_security_gw_config *app_cfg)
 
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 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)
 
void remove_ethernet_padding (struct rte_mbuf **m)
 
uint32_t get_icv_len_int (enum doca_flow_crypto_icv_len icv_len)
 
void security_gateway_free_status_entries (struct ipsec_security_gw_config *app_cfg)
 
void security_gateway_free_resources (struct ipsec_security_gw_config *app_cfg)
 

Variables

uint32_t u32
 
struct {
   uint32_t   encrypt: 1
 
   uint32_t   decrypt: 1
 
   uint32_t   inner_ipv6: 1
 
   uint32_t   decrypt_syndrome: 2
 
   uint32_t   antireplay_syndrome: 2
 
   uint32_t   rsvd0: 5
 
   uint32_t   rule_id: 20
 
}; 
 

Macro Definition Documentation

◆ BE_IPV4_ADDR

#define BE_IPV4_ADDR (   a,
  b,
  c,
 
)    (RTE_BE32((a << 24) + (b << 16) + (c << 8) + d)) /* Big endian conversion */

Definition at line 52 of file flow_common.h.

◆ DEF_EXPECTED_ENTRIES

#define DEF_EXPECTED_ENTRIES   (1024) /* default expected entries in the pipe */

Definition at line 43 of file flow_common.h.

◆ DEFAULT_TIMEOUT_US

#define DEFAULT_TIMEOUT_US   (10000) /* default timeout for processing entries */

Definition at line 42 of file flow_common.h.

◆ QUEUE_DEPTH

#define QUEUE_DEPTH   (512) /* DOCA Flow queue depth */

Definition at line 39 of file flow_common.h.

◆ SECURED_IDX

#define SECURED_IDX   (0) /* Index for secured network port in ports array */

Definition at line 40 of file flow_common.h.

◆ SET_IP6_ADDR

#define SET_IP6_ADDR (   addr,
  a,
  b,
  c,
 
)
Value:
do { \
addr[0] = a; \
addr[1] = b; \
addr[2] = c; \
addr[3] = d; \
} while (0)

Definition at line 53 of file flow_common.h.

◆ SET_L4_PORT

#define SET_L4_PORT (   layer,
  port,
  value 
)
Value:
do { \
if (match.layer.l4_type_ext == DOCA_FLOW_L4_TYPE_EXT_TCP) \
match.layer.tcp.l4_port.port = (value); \
else if (match.layer.l4_type_ext == DOCA_FLOW_L4_TYPE_EXT_UDP) \
match.layer.udp.l4_port.port = (value); \
} while (0) /* Set match l4 port */
@ DOCA_FLOW_L4_TYPE_EXT_TCP
@ DOCA_FLOW_L4_TYPE_EXT_UDP
type value

Definition at line 44 of file flow_common.h.

◆ SET_MAC_ADDR

#define SET_MAC_ADDR (   addr,
  a,
  b,
  c,
  d,
  e,
 
)
Value:
do { \
addr[0] = a & 0xff; \
addr[1] = b & 0xff; \
addr[2] = c & 0xff; \
addr[3] = d & 0xff; \
addr[4] = e & 0xff; \
addr[5] = f & 0xff; \
} while (0) /* create source mac address */

Definition at line 60 of file flow_common.h.

◆ UNSECURED_IDX

#define UNSECURED_IDX   (1) /* Index for unsecured network port in ports array */

Definition at line 41 of file flow_common.h.

Function Documentation

◆ create_hairpin_pipe_fwd()

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 
)

Definition at line 512 of file flow_common.c.

◆ create_rss_pipe()

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 
)

Definition at line 384 of file flow_common.c.

◆ create_switch_egress_root_pipes()

doca_error_t create_switch_egress_root_pipes ( struct ipsec_security_gw_ports_map ports[],
struct ipsec_security_gw_config app_cfg 
)

Definition at line 840 of file flow_common.c.

◆ create_switch_ingress_root_pipes()

doca_error_t create_switch_ingress_root_pipes ( struct ipsec_security_gw_ports_map ports[],
struct ipsec_security_gw_config app_cfg 
)

Definition at line 815 of file flow_common.c.

◆ doca_flow_cleanup()

void doca_flow_cleanup ( int  nb_ports,
struct ipsec_security_gw_ports_map ports[] 
)

Definition at line 360 of file flow_common.c.

◆ get_icv_len_int()

uint32_t get_icv_len_int ( enum doca_flow_crypto_icv_len  icv_len)

Definition at line 374 of file flow_common.c.

◆ ipsec_security_gw_bind()

doca_error_t ipsec_security_gw_bind ( struct ipsec_security_gw_ports_map ports[],
struct ipsec_security_gw_config app_cfg 
)

Definition at line 333 of file flow_common.c.

◆ ipsec_security_gw_init_doca_flow()

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[] 
)

Definition at line 163 of file flow_common.c.

◆ ipsec_security_gw_init_status()

doca_error_t ipsec_security_gw_init_status ( struct ipsec_security_gw_config app_cfg,
int  nb_queues 
)

Definition at line 315 of file flow_common.c.

◆ process_entries()

doca_error_t process_entries ( struct doca_flow_port *  port,
struct entries_status status,
int  timeout,
uint16_t  pipe_queue 
)

Definition at line 78 of file flow_common.c.

◆ remove_ethernet_padding()

void remove_ethernet_padding ( struct rte_mbuf **  m)

Definition at line 870 of file flow_common.c.

◆ security_gateway_free_resources()

void security_gateway_free_resources ( struct ipsec_security_gw_config app_cfg)

Definition at line 960 of file flow_common.c.

◆ security_gateway_free_status_entries()

void security_gateway_free_status_entries ( struct ipsec_security_gw_config app_cfg)

Definition at line 954 of file flow_common.c.

Variable Documentation

◆ 

struct { ... }

◆ antireplay_syndrome

uint32_t antireplay_syndrome

Definition at line 6 of file flow_common.h.

◆ decrypt

uint32_t decrypt

Definition at line 3 of file flow_common.h.

◆ decrypt_syndrome

uint32_t decrypt_syndrome

Definition at line 5 of file flow_common.h.

◆ encrypt

uint32_t encrypt

Definition at line 2 of file flow_common.h.

◆ inner_ipv6

uint32_t inner_ipv6

Definition at line 4 of file flow_common.h.

◆ rsvd0

uint32_t rsvd0

Definition at line 7 of file flow_common.h.

◆ rule_id

uint32_t rule_id

Definition at line 8 of file flow_common.h.

◆ u32

uint32_t u32

Definition at line 0 of file flow_common.h.