26 #ifndef _PSP_GW_FLOWS_H_
27 #define _PSP_GW_FLOWS_H_
29 #include <netinet/in.h>
31 #include <unordered_map>
33 #include <rte_ether.h>
195 doca_error_t start_port(uint16_t port_id, doca_dev *port_dev, doca_flow_port **port);
241 doca_flow_pipe *pipe,
242 doca_flow_port *port,
247 doca_flow_pipe_entry **
entry);
255 void format_encap_tunnel_data_ipv6(
const psp_session_t *session, uint8_t *encap_data);
263 void format_encap_tunnel_data_ipv4(
const psp_session_t *session, uint8_t *encap_data);
271 void format_encap_transport_data(
const psp_session_t *session, uint8_t *encap_data);
380 doca_error_t ingress_inner_classifier_pipe_create(
void);
427 std::pair<uint64_t, uint64_t> perform_pipe_query(pipe_query *query,
bool suppress_output);
435 uint16_t vf_port_id{UINT16_MAX};
437 doca_flow_port *vf_port{};
439 bool sampling_enabled{
false};
447 doca_flow_pipe *rss_pipe{};
448 doca_flow_pipe *ingress_root_pipe{};
451 doca_flow_pipe *ingress_decrypt_pipe{};
452 doca_flow_pipe *ingress_sampling_pipe{};
453 doca_flow_pipe *ingress_inner_ip_classifier_pipe{};
454 doca_flow_pipe *ingress_acl_ipv4_pipe{};
455 doca_flow_pipe *ingress_acl_ipv6_pipe{};
458 doca_flow_pipe *egress_acl_ipv4_pipe{};
459 doca_flow_pipe *egress_acl_ipv6_pipe{};
460 doca_flow_pipe *egress_sampling_pipe{};
461 doca_flow_pipe *egress_encrypt_pipe{};
462 doca_flow_pipe *syndrome_stats_pipe{};
463 doca_flow_pipe *empty_pipe{};
464 doca_flow_pipe *empty_pipe_not_sampled{};
465 doca_flow_pipe *fwd_to_wire_pipe{};
466 doca_flow_pipe *fwd_to_rss_pipe{};
467 doca_flow_pipe *set_sample_bit_pipe{};
468 doca_flow_pipe *egress_dst_ip6_pipe{};
469 doca_flow_pipe *ingress_src_ip6_pipe{};
472 doca_flow_pipe_entry *default_rss_entry{};
473 doca_flow_pipe_entry *default_decrypt_entry{};
474 doca_flow_pipe_entry *default_ingr_sampling_entry{};
475 doca_flow_pipe_entry *egr_sampling_rss{};
476 doca_flow_pipe_entry *egr_sampling_drop{};
477 doca_flow_pipe_entry *default_ingr_acl_ipv4_entry{};
478 doca_flow_pipe_entry *default_ingr_acl_ipv6_entry{};
479 doca_flow_pipe_entry *ingress_ipv4_clasify_entry{};
480 doca_flow_pipe_entry *ingress_ipv6_clasify_entry{};
481 doca_flow_pipe_entry *root_jump_to_ingress_ipv6_entry{};
482 doca_flow_pipe_entry *root_jump_to_ingress_ipv4_entry{};
483 doca_flow_pipe_entry *root_jump_to_egress_ipv6_entry{};
484 doca_flow_pipe_entry *root_jump_to_egress_ipv4_entry{};
485 doca_flow_pipe_entry *vf_arp_to_rss{};
486 doca_flow_pipe_entry *vf_ns_to_rss{};
487 doca_flow_pipe_entry *vf_arp_to_wire{};
488 doca_flow_pipe_entry *uplink_arp_to_vf{};
489 doca_flow_pipe_entry *vf_ns_to_wire{};
490 doca_flow_pipe_entry *uplink_ns_to_vf{};
492 doca_flow_pipe_entry *empty_pipe_entry{};
493 doca_flow_pipe_entry *arp_empty_pipe_entry{};
494 doca_flow_pipe_entry *ns_empty_pipe_entry{};
495 doca_flow_pipe_entry *ipv4_empty_pipe_entry{};
496 doca_flow_pipe_entry *ipv6_empty_pipe_entry{};
497 doca_flow_pipe_entry *root_default_drop{};
498 doca_flow_pipe_entry *fwd_to_wire_entry{};
499 doca_flow_pipe_entry *fwd_to_rss_entry{};
500 doca_flow_pipe_entry *set_sample_bit_entry{};
506 uint32_t mirror_res_id_ingress{1};
507 uint32_t mirror_res_id_rss{2};
508 uint32_t mirror_res_id_drop{3};
509 uint32_t mirror_res_id_count{4};
513 uint64_t prev_static_flow_count{UINT64_MAX};
struct doca_flow_port * init_doca_flow(uint16_t port_id, uint8_t rxq_num)
static void check_for_valid_entry(struct doca_flow_pipe_entry *entry, uint16_t pipe_queue, enum doca_flow_entry_status status, enum doca_flow_entry_op op, void *user_ctx)
The entity which owns all the doca flow shared resources and flow pipes (but not sessions).
void show_session_flow_count(const session_key session_vips_pair, psp_session_t &session)
Shows flow counters for the given tunnel, if they have changed since the last invocation.
void show_static_flow_counts(void)
Shows flow counters for pipes which have a fixed number of entries, if any counter values have change...
doca_error_t add_ingress_acl_entry(psp_session_t *session)
Adds an ingress ACL entry for the given session to accept the combination of src_vip and SPI.
doca_error_t remove_encrypt_entry(psp_session_t *session)
Removes the indicated flow entry.
PSP_GatewayFlows(psp_pf_dev *pf, uint16_t vf_port_id, psp_gw_app_config *app_config)
Constructs the object. This operation cannot fail.
doca_error_t init(void)
Initialized the DOCA resources.
virtual ~PSP_GatewayFlows(void)
doca_error_t add_encrypt_entry(psp_session_t *session, const void *encrypt_key)
Adds a flow pipe entry to perform encryption on a new flow to the indicated peer. The caller is respo...
static uint16_t * rss_queues
static struct doca_flow_actions actions
static struct doca_flow_fwd fwd
static struct doca_flow_pipe_entry * entry[MAX_ENTRIES]
static struct app_gpu_cfg app_cfg
enum doca_error doca_error_t
DOCA API return codes.
doca_flow_entry_op
doca flow entry operation
doca_flow_entry_status
doca flow entry status
std::pair< std::string, std::string > session_key
static const int NUM_OF_PSP_SYNDROMES
doca flow actions information
doca flow matcher information
doca monitor action configuration
describes the configuration of the PSP networking service on the local host.
Maintains the state of the host PF.
struct doca_flow_ip_addr src_pip
doca_flow_port * port_obj
describes a PSP tunnel connection to a single address on a peer.
uint64_t pkt_count_egress
doca_flow_pipe_entry * encap_encrypt_entry
doca_flow_pipe_entry * acl_entry
uint64_t pkt_count_ingress
struct doca_flow_ip_addr src_vip
struct doca_flow_ip_addr dst_pip
struct doca_flow_ip_addr dst_vip