29 #include <rte_ether.h>
30 #include <rte_ethdev.h>
32 #include <netinet/icmp6.h>
44 #define IF_SUCCESS(result, expr) \
45 if (result == DOCA_SUCCESS) { \
47 if (likely(result == DOCA_SUCCESS)) { \
48 DOCA_LOG_DBG("Success: %s", #expr); \
50 DOCA_LOG_ERR("Error: %s: %s", #expr, doca_error_get_descr(result)); \
55 #define NEXT_HEADER_IPV4 0x4
56 #define NEXT_HEADER_IPV6 0x29
118 vf_port_id(vf_port_id),
119 sampling_enabled(
app_config->log2_sample_rate > 0)
123 for (uint16_t i = 0; i <
app_config->dpdk_config.port_config.nb_queues; i++) {
124 rss_queues.push_back(i);
155 if (sampling_enabled) {
166 if (sampling_enabled) {
181 mirr_tgt.
fwd.
next_pipe = ingress_inner_ip_classifier_pipe;
193 &mirror_res_id_ingress,
231 doca_error_t PSP_GatewayFlows::start_port(uint16_t port_id, doca_dev *port_dev, doca_flow_port **port)
233 doca_flow_port_cfg *port_cfg;
244 rte_ether_addr port_mac_addr;
245 rte_eth_macaddr_get(port_id, &port_mac_addr);
257 struct doca_flow_tune_server_cfg *server_cfg;
260 uint16_t nb_queues =
app_cfg->dpdk_config.port_config.nb_queues;
263 for (
int i = 0; i < nb_queues; i++)
270 doca_flow_cfg *flow_cfg;
295 DOCA_LOG_ERR(
"Failed to create flow tune server configuration");
301 DOCA_LOG_DBG(
"DOCA Flow Tune Server isn't supported in this runtime version");
304 DOCA_LOG_ERR(
"Failed to initialize the DOCA Flow Tune Server");
318 doca_error_t PSP_GatewayFlows::bind_shared_resources(
void)
322 std::vector<uint32_t> psp_ids(
app_config->max_tunnels);
323 for (uint32_t i = 0; i <
app_config->max_tunnels; i++) {
340 if (sampling_enabled) {
345 if (sampling_enabled) {
369 doca_flow_pipe_cfg *pipe_cfg;
379 add_single_entry(0, rss_pipe, pf_dev->
port_obj,
nullptr,
nullptr,
nullptr,
nullptr, &default_rss_entry));
388 doca_error_t PSP_GatewayFlows::ingress_decrypt_pipe_create(
void)
391 assert(sampling_enabled ? ingress_sampling_pipe : ingress_inner_ip_classifier_pipe);
410 fwd.
next_pipe = sampling_enabled ? ingress_sampling_pipe : ingress_inner_ip_classifier_pipe;
415 doca_flow_pipe_cfg *pipe_cfg;
436 ingress_decrypt_pipe,
442 &default_decrypt_entry));
447 doca_error_t PSP_GatewayFlows::ingress_inner_classifier_pipe_create(
void)
467 doca_flow_pipe_cfg *pipe_cfg;
491 ingress_inner_ip_classifier_pipe,
497 &ingress_ipv6_clasify_entry));
507 ingress_inner_ip_classifier_pipe,
513 &ingress_ipv4_clasify_entry));
518 doca_error_t PSP_GatewayFlows::ingress_sampling_pipe_create(
void)
521 assert(mirror_res_id_ingress);
523 assert(sampling_enabled);
552 doca_flow_pipe_cfg *pipe_cfg;
570 ingress_sampling_pipe,
576 &default_ingr_sampling_entry));
581 doca_error_t PSP_GatewayFlows::create_ingress_src_ip6_pipe(
void)
607 doca_flow_pipe_cfg *pipe_cfg;
624 doca_error_t PSP_GatewayFlows::ingress_acl_pipe_create(
bool ipv4)
629 struct doca_flow_pipe **pipe = ipv4 ? &ingress_acl_ipv4_pipe : &ingress_acl_ipv6_pipe;
630 struct doca_flow_pipe_entry **
entry = ipv4 ? &default_ingr_acl_ipv4_entry : &default_ingr_acl_ipv6_entry;
641 match.
meta.
u32[2] = UINT32_MAX;
660 eth_hdr->ether_type = ipv4 ? RTE_BE16(RTE_ETHER_TYPE_IPV4) : RTE_BE16(RTE_ETHER_TYPE_IPV6);
661 eth_hdr->src_addr = pf_dev->
src_mac;
677 doca_flow_pipe_cfg *pipe_cfg;
723 return add_single_entry(0, ingress_src_ip6_pipe, pf_dev->
port_obj, &match, &
actions,
nullptr,
nullptr,
nullptr);
728 struct doca_flow_pipe *pipe;
730 DOCA_LOG_ERR(
"Cannot insert ingress ACL flow; disabled");
738 pipe = ingress_acl_ipv4_pipe;
745 pipe = ingress_acl_ipv6_pipe;
753 if (dst_vip_id < 0) {
762 match.
meta.
u32[2] = dst_vip_id;
770 add_single_entry(0, pipe, pf_dev->
port_obj, &match,
nullptr,
nullptr,
nullptr, &session->
acl_entry));
775 doca_error_t PSP_GatewayFlows::syndrome_stats_pipe_create(
void)
788 doca_flow_pipe_cfg *pipe_cfg;
814 &syndrome_stats_entries[i]));
820 doca_error_t PSP_GatewayFlows::create_egress_dst_ip6_pipe(
void)
842 doca_flow_pipe_cfg *pipe_cfg;
860 doca_error_t PSP_GatewayFlows::egress_acl_pipe_create(
bool ipv4)
864 assert(!sampling_enabled || egress_sampling_pipe);
866 struct doca_flow_pipe **pipe = ipv4 ? &egress_acl_ipv4_pipe : &egress_acl_ipv6_pipe;
875 match.
meta.
u32[2] = UINT32_MAX;
915 fwd_to_sampling.
next_pipe = set_sample_bit_pipe;
921 auto p_fwd = sampling_enabled ? &fwd_to_sampling : &fwd_to_wire;
927 doca_flow_pipe_cfg *pipe_cfg;
958 return add_single_entry(0, egress_dst_ip6_pipe, pf_dev->
port_obj, &match, &
actions,
nullptr,
nullptr,
nullptr);
968 struct doca_flow_pipe *pipe;
970 DOCA_LOG_DBG(
"Creating encrypt flow entry: dst_pip %s, src_vip %s, dst_vip %s, SPI %d, crypto_id %d",
990 pipe = egress_acl_ipv4_pipe;
996 pipe = egress_acl_ipv6_pipe;
1006 if (dst_vip_id < 0) {
1015 encap_encrypt_match.
meta.
u32[2] = dst_vip_id;
1016 result = add_egress_dst_ip6_entry(session, dst_vip_id);
1039 result = add_single_entry(0,
1042 &encap_encrypt_match,
1060 void PSP_GatewayFlows::format_encap_tunnel_data_ipv6(
const psp_session_t *session, uint8_t *encap_data)
1062 static const doca_be32_t DEFAULT_VTC_FLOW = 0x6 << 28;
1065 encap_hdr->eth.ether_type = RTE_BE16(RTE_ETHER_TYPE_IPV6);
1066 encap_hdr->ip.vtc_flow = RTE_BE32(DEFAULT_VTC_FLOW);
1067 encap_hdr->ip.proto = IPPROTO_UDP;
1068 encap_hdr->ip.hop_limits = 50;
1069 encap_hdr->udp.src_port = 0x0;
1072 encap_hdr->psp.hdrextlen = (uint8_t)(
app_config->net_config.vc_enabled ? 2 : 1);
1073 encap_hdr->psp.res_cryptofst = (uint8_t)
app_config->net_config.crypt_offset;
1074 encap_hdr->psp.spi = RTE_BE32(session->
spi_egress);
1075 encap_hdr->psp_virt_cookie = RTE_BE64(session->
vc);
1078 memcpy(encap_hdr->eth.src_addr.addr_bytes, pf_dev->
src_mac.addr_bytes, RTE_ETHER_ADDR_LEN);
1079 memcpy(encap_hdr->eth.dst_addr.addr_bytes, dmac.addr_bytes, RTE_ETHER_ADDR_LEN);
1083 encap_hdr->psp.rsrv1 = 1;
1085 encap_hdr->psp.v = !!
app_config->net_config.vc_enabled;
1089 void PSP_GatewayFlows::format_encap_tunnel_data_ipv4(
const psp_session_t *session, uint8_t *encap_data)
1092 encap_hdr->eth.ether_type = RTE_BE16(RTE_ETHER_TYPE_IPV4);
1093 encap_hdr->udp.src_port = 0x0;
1096 encap_hdr->psp.hdrextlen = (uint8_t)(
app_config->net_config.vc_enabled ? 2 : 1);
1097 encap_hdr->psp.res_cryptofst = (uint8_t)
app_config->net_config.crypt_offset;
1098 encap_hdr->psp.spi = RTE_BE32(session->
spi_egress);
1099 encap_hdr->psp_virt_cookie = RTE_BE64(session->
vc);
1102 memcpy(encap_hdr->eth.src_addr.addr_bytes, pf_dev->
src_mac.addr_bytes, RTE_ETHER_ADDR_LEN);
1103 memcpy(encap_hdr->eth.dst_addr.addr_bytes, dmac.addr_bytes, RTE_ETHER_ADDR_LEN);
1106 encap_hdr->ip.version_ihl = 0x45;
1107 encap_hdr->ip.next_proto_id = IPPROTO_UDP;
1108 encap_hdr->ip.time_to_live = 64;
1110 encap_hdr->psp.rsrv1 = 1;
1112 encap_hdr->psp.v = !!
app_config->net_config.vc_enabled;
1116 void PSP_GatewayFlows::format_encap_transport_data(
const psp_session_t *session, uint8_t *encap_data)
1119 encap_hdr->udp.src_port = 0x0;
1121 encap_hdr->psp.nexthdr = 0;
1122 encap_hdr->psp.hdrextlen = (uint8_t)(
app_config->net_config.vc_enabled ? 2 : 1);
1123 encap_hdr->psp.res_cryptofst = (uint8_t)
app_config->net_config.crypt_offset;
1124 encap_hdr->psp.spi = RTE_BE32(session->
spi_egress);
1125 encap_hdr->psp_virt_cookie = RTE_BE64(session->
vc);
1127 encap_hdr->psp.rsrv1 = 1;
1129 encap_hdr->psp.v = !!
app_config->net_config.vc_enabled;
1137 uint16_t pipe_queue = 0;
1139 uint32_t num_of_entries = 1;
1155 doca_error_t PSP_GatewayFlows::egress_sampling_pipe_create(
void)
1158 assert(sampling_enabled);
1185 doca_flow_pipe_cfg *pipe_cfg;
1203 egress_sampling_pipe,
1209 &egr_sampling_rss));
1216 egress_sampling_pipe,
1222 &egr_sampling_drop));
1241 doca_flow_pipe_cfg *pipe_cfg;
1262 add_single_entry(0, empty_pipe, pf_dev->
port_obj, &match,
nullptr,
nullptr, &
fwd, &arp_empty_pipe_entry));
1271 add_single_entry(0, empty_pipe, pf_dev->
port_obj, &match,
nullptr,
nullptr, &
fwd, &ns_empty_pipe_entry));
1285 &ipv4_empty_pipe_entry));
1299 &ipv6_empty_pipe_entry));
1303 doca_error_t PSP_GatewayFlows::fwd_to_wire_pipe_create(
void)
1316 doca_flow_pipe_cfg *pipe_cfg;
1334 &fwd_to_wire_entry));
1343 doca_error_t PSP_GatewayFlows::fwd_to_rss_pipe_create(
void)
1357 doca_flow_pipe_cfg *pipe_cfg;
1375 &fwd_to_rss_entry));
1384 doca_error_t PSP_GatewayFlows::set_sample_bit_pipe_create(
void)
1388 uint16_t mask = (uint16_t)((1 <<
app_config->log2_sample_rate) - 1);
1389 DOCA_LOG_DBG(
"Sampling: matching (rand & 0x%x) == 1", mask);
1412 doca_flow_pipe_cfg *pipe_cfg;
1425 set_sample_bit_pipe,
1431 &set_sample_bit_entry));
1440 doca_error_t PSP_GatewayFlows::empty_pipe_create_not_sampled(
void)
1449 doca_flow_pipe_cfg *pipe_cfg;
1459 empty_pipe_not_sampled,
1465 &empty_pipe_entry));
1474 doca_error_t PSP_GatewayFlows::ingress_root_pipe_create(
void)
1477 assert(ingress_decrypt_pipe);
1480 doca_flow_pipe_cfg *pipe_cfg;
1505 ipv6_from_uplink.
outer.
eth.
type = RTE_BE16(RTE_ETHER_TYPE_IPV6);
1511 ipv4_from_uplink.
outer.
eth.
type = RTE_BE16(RTE_ETHER_TYPE_IPV4);
1517 ipv4_from_vf.
outer.
eth.
type = RTE_BE16(RTE_ETHER_TYPE_IPV4);
1523 ipv6_from_vf.
outer.
eth.
type = RTE_BE16(RTE_ETHER_TYPE_IPV6);
1548 ns_from_vf.
outer.
eth.
type = RTE_BE16(RTE_ETHER_TYPE_IPV6);
1557 ns_from_uplink.
outer.
eth.
type = RTE_BE16(RTE_ETHER_TYPE_IPV6);
1568 fwd_ingress.
next_pipe = ingress_decrypt_pipe;
1576 fwd_to_vf.
port_id = vf_port_id;
1585 uint16_t pipe_queue = 0;
1600 &root_jump_to_ingress_ipv6_entry));
1615 &root_jump_to_ingress_ipv4_entry));
1630 &root_jump_to_egress_ipv6_entry));
1645 &root_jump_to_egress_ipv4_entry));
1707 &uplink_arp_to_vf));
1752 &root_default_drop));
1766 void PSP_GatewayFlows::check_for_valid_entry(doca_flow_pipe_entry *
entry,
1767 uint16_t pipe_queue,
1782 entry_status->failure =
true;
1784 entry_status->nb_processed++;
1785 entry_status->entries_in_queue--;
1788 doca_error_t PSP_GatewayFlows::add_single_entry(uint16_t pipe_queue,
1789 doca_flow_pipe *pipe,
1790 doca_flow_port *port,
1795 doca_flow_pipe_entry **
entry)
1797 int num_of_entries = 1;
1801 app_config->status[pipe_queue].entries_in_queue = num_of_entries;
1824 if (
app_config->status[pipe_queue].nb_processed != num_of_entries ||
app_config->status[pipe_queue].failure) {
1825 DOCA_LOG_ERR(
"Failed to process entry; nb_processed = %d, failure = %d",
1840 std::pair<uint64_t, uint64_t> PSP_GatewayFlows::perform_pipe_query(pipe_query *query,
bool suppress_output)
1842 uint64_t new_hits = 0;
1843 uint64_t new_misses = 0;
1849 new_hits =
stats.counter.total_pkts;
1856 new_misses =
stats.counter.total_pkts;
1859 if (!suppress_output) {
1860 if (query->entry && query->pipe) {
1861 DOCA_LOG_INFO(
"%s: %ld hits %ld misses", query->name.c_str(), new_hits, new_misses);
1862 }
else if (query->entry) {
1863 DOCA_LOG_INFO(
"%s: %ld hits", query->name.c_str(), new_hits);
1864 }
else if (query->pipe) {
1865 DOCA_LOG_INFO(
"%s: %ld misses", query->name.c_str(), new_hits);
1869 return std::make_pair(new_hits, new_misses);
1874 std::vector<pipe_query> queries;
1875 queries.emplace_back(
pipe_query{
nullptr, default_rss_entry,
"rss_pipe"});
1876 queries.emplace_back(
pipe_query{
nullptr, root_jump_to_ingress_ipv6_entry,
"root_jump_to_ingress_ipv6_entry"});
1877 queries.emplace_back(
pipe_query{
nullptr, root_jump_to_ingress_ipv4_entry,
"root_jump_to_ingress_ipv4_entry"});
1878 queries.emplace_back(
pipe_query{
nullptr, root_jump_to_egress_ipv6_entry,
"root_jump_to_egress_ipv6_entry"});
1879 queries.emplace_back(
pipe_query{
nullptr, root_jump_to_egress_ipv4_entry,
"root_jump_to_egress_ipv4_entry"});
1880 queries.emplace_back(
pipe_query{
nullptr, vf_arp_to_rss,
"vf_arp_to_rss"});
1881 queries.emplace_back(
pipe_query{
nullptr, vf_ns_to_rss,
"vf_ns_to_rss"});
1882 queries.emplace_back(
pipe_query{
nullptr, vf_arp_to_wire,
"vf_arp_to_wire"});
1883 queries.emplace_back(
pipe_query{
nullptr, uplink_arp_to_vf,
"uplink_arp_to_vf"});
1884 queries.emplace_back(
pipe_query{
nullptr, vf_ns_to_wire,
"vf_ns_to_wire"});
1885 queries.emplace_back(
pipe_query{
nullptr, uplink_ns_to_vf,
"uplink_ns_to_vf"});
1886 queries.emplace_back(
pipe_query{
nullptr, root_default_drop,
"root_miss_drop"});
1887 queries.emplace_back(
pipe_query{ingress_decrypt_pipe, default_decrypt_entry,
"default_decrypt_entry"});
1888 queries.emplace_back(
1889 pipe_query{ingress_inner_ip_classifier_pipe, ingress_ipv4_clasify_entry,
"ingress_ipv4_clasify"});
1890 queries.emplace_back(
1891 pipe_query{ingress_inner_ip_classifier_pipe, ingress_ipv6_clasify_entry,
"ingress_ipv6_clasify"});
1892 queries.emplace_back(
pipe_query{ingress_sampling_pipe, default_ingr_sampling_entry,
"ingress_sampling_pipe"});
1893 queries.emplace_back(
pipe_query{ingress_acl_ipv4_pipe, default_ingr_acl_ipv4_entry,
"ingress_acl_ipv4_pipe"});
1894 queries.emplace_back(
pipe_query{ingress_acl_ipv6_pipe, default_ingr_acl_ipv6_entry,
"ingress_acl_ipv6_pipe"});
1898 queries.emplace_back(
pipe_query{
nullptr, syndrome_stats_entries[i],
"syndrome - ICV Fail"});
1901 queries.emplace_back(
pipe_query{
nullptr, syndrome_stats_entries[i],
"syndrome - Bad Trailer"});
1905 queries.emplace_back(
pipe_query{empty_pipe,
nullptr,
"egress_root"});
1906 queries.emplace_back(
pipe_query{egress_acl_ipv4_pipe,
nullptr,
"egress_acl_ipv4_pipe"});
1907 queries.emplace_back(
pipe_query{egress_acl_ipv6_pipe,
nullptr,
"egress_acl_ipv6_pipe"});
1908 queries.emplace_back(
pipe_query{egress_sampling_pipe, egr_sampling_rss,
"egress_sampling_rss"});
1909 queries.emplace_back(
pipe_query{egress_sampling_pipe, egr_sampling_drop,
"egress_sampling_drop"});
1910 queries.emplace_back(
pipe_query{
nullptr, empty_pipe_entry,
"arp_packets_intercepted"});
1911 queries.emplace_back(
pipe_query{fwd_to_wire_pipe, fwd_to_wire_entry,
"fwd_to_wire_entry"});
1912 queries.emplace_back(
pipe_query{
nullptr, fwd_to_rss_entry,
"fwd_to_rss_entry"});
1913 queries.emplace_back(
pipe_query{
nullptr, ipv4_empty_pipe_entry,
"fwd_egress_acl_ipv4"});
1914 queries.emplace_back(
pipe_query{
nullptr, ipv6_empty_pipe_entry,
"fwd_egress_acl_ipv6"});
1915 queries.emplace_back(
pipe_query{
nullptr, ns_empty_pipe_entry,
"ns_empty_pipe_entry"});
1917 uint64_t total_pkts = 0;
1918 for (
auto &query : queries) {
1919 auto hits_misses = perform_pipe_query(&query,
true);
1920 total_pkts += hits_misses.first + hits_misses.second;
1923 if (total_pkts != prev_static_flow_count) {
1926 for (
auto &query : queries) {
1927 auto hits_misses = perform_pipe_query(&query,
false);
1928 total_pkts += hits_misses.first + hits_misses.second;
1930 prev_static_flow_count = total_pkts;
1944 session_vips_pair.first.c_str(),
1945 session_vips_pair.second.c_str(),
1948 session_vips_pair.first.c_str(),
1949 session_vips_pair.second.c_str(),
1950 encap_encrypt_stats.
counter.total_pkts);
1954 DOCA_LOG_INFO(
"Session Egress (%s -> %s): query failed: %s",
1955 session_vips_pair.first.c_str(),
1956 session_vips_pair.second.c_str(),
1969 session_vips_pair.first.c_str(),
1970 session_vips_pair.second.c_str(),
1971 acl_stats.
counter.total_pkts);
1975 DOCA_LOG_INFO(
"Session Ingress (%s <- %s): query failed: %s",
1976 session_vips_pair.first.c_str(),
1977 session_vips_pair.second.c_str(),
#define SET_IP6_ADDR(addr, a, b, c, d)
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 struct eth_l2_fwd_stats stats
static struct doca_flow_fwd fwd_miss
static uint16_t * rss_queues
static struct doca_flow_actions actions
static struct doca_flow_fwd fwd
static struct doca_flow_match match_mask
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_STABLE const char * doca_error_get_descr(doca_error_t error)
Returns the description string of an error code.
@ DOCA_ERROR_NOT_SUPPORTED
@ DOCA_FLOW_CRYPTO_HEADER_PSP_OVER_IPV4
@ DOCA_FLOW_CRYPTO_HEADER_PSP_OVER_IPV6
@ DOCA_FLOW_CRYPTO_HEADER_PSP_TUNNEL
@ DOCA_FLOW_CRYPTO_RESOURCE_PSP
@ DOCA_FLOW_CRYPTO_KEY_128
@ DOCA_FLOW_CRYPTO_KEY_256
@ DOCA_FLOW_CRYPTO_REFORMAT_ENCAP
@ DOCA_FLOW_CRYPTO_REFORMAT_DECAP
@ DOCA_FLOW_CRYPTO_ACTION_DECRYPT
@ DOCA_FLOW_CRYPTO_ACTION_ENCRYPT
doca_flow_l4_type_ext
doca flow layer 4 packet extend type
#define DOCA_FLOW_ETHER_TYPE_ARP
#define DOCA_FLOW_ETHER_TYPE_IPV6
#define DOCA_FLOW_PSP_DEFAULT_PORT
#define DOCA_FLOW_ETHER_TYPE_IPV4
@ DOCA_FLOW_L4_TYPE_EXT_ICMP6
@ DOCA_FLOW_L4_TYPE_EXT_UDP
DOCA_EXPERIMENTAL doca_error_t doca_flow_tune_server_init(struct doca_flow_tune_server_cfg *cfg)
Initialize a DOCA Flow Tune Server.
DOCA_EXPERIMENTAL doca_error_t doca_flow_tune_server_cfg_destroy(struct doca_flow_tune_server_cfg *cfg)
Destroy DOCA Flow Tune Server configuration struct.
DOCA_EXPERIMENTAL doca_error_t doca_flow_tune_server_cfg_create(struct doca_flow_tune_server_cfg **cfg)
Create DOCA Flow Tune Server configuration struct.
DOCA_EXPERIMENTAL void doca_flow_tune_server_destroy(void)
Destroy the DOCA Flow Tune Server.
DOCA_STABLE doca_error_t doca_flow_pipe_cfg_destroy(struct doca_flow_pipe_cfg *cfg)
Destroy DOCA Flow pipe configuration struct.
DOCA_STABLE doca_error_t doca_flow_cfg_set_mode_args(struct doca_flow_cfg *cfg, const char *mode_args)
Set DOCA mode args.
DOCA_STABLE doca_error_t doca_flow_pipe_cfg_create(struct doca_flow_pipe_cfg **cfg, struct doca_flow_port *port)
Create DOCA Flow pipe configuration struct.
DOCA_STABLE doca_error_t doca_flow_entries_process(struct doca_flow_port *port, uint16_t pipe_queue, uint64_t timeout, uint32_t max_processed_entries)
Process entries in queue.
DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_name(struct doca_flow_pipe_cfg *cfg, const char *name)
Set pipe's name.
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_match(struct doca_flow_pipe_cfg *cfg, const struct doca_flow_match *match, const struct doca_flow_match *match_mask)
Set pipe's match and match mask.
DOCA_STABLE doca_error_t doca_flow_shared_resources_bind(enum doca_flow_shared_resource_type type, uint32_t *res_array, uint32_t res_array_len, void *bindable_obj)
Binds a bulk of shared resources to a bindable object.
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_control_add_entry(uint16_t pipe_queue, uint32_t priority, struct doca_flow_pipe *pipe, const struct doca_flow_match *match, const struct doca_flow_match *match_mask, const struct doca_flow_match_condition *condition, const struct doca_flow_actions *actions, const struct doca_flow_actions *actions_mask, const struct doca_flow_action_descs *action_descs, const struct doca_flow_monitor *monitor, const struct doca_flow_fwd *fwd, void *usr_ctx, struct doca_flow_pipe_entry **entry)
Add one new entry to a control pipe.
DOCA_EXPERIMENTAL doca_error_t doca_flow_port_start(const struct doca_flow_port_cfg *cfg, struct doca_flow_port **port)
Start a doca port.
doca_flow_entry_op
doca flow entry operation
DOCA_STABLE doca_error_t doca_flow_cfg_set_cb_entry_process(struct doca_flow_cfg *cfg, doca_flow_entry_process_cb cb)
Set callback for entry create/destroy.
DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_is_root(struct doca_flow_pipe_cfg *cfg, bool is_root)
Set if pipe is root or not.
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_create(const struct doca_flow_pipe_cfg *cfg, const struct doca_flow_fwd *fwd, const struct doca_flow_fwd *fwd_miss, struct doca_flow_pipe **pipe)
Create one new pipe.
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_miss_counter(struct doca_flow_pipe_cfg *cfg, bool miss_counter)
Set to enable pipe's miss counter.
DOCA_STABLE doca_error_t doca_flow_cfg_create(struct doca_flow_cfg **cfg)
Create DOCA Flow configuration struct.
doca_flow_l3_meta
doca flow l3 valid type for parser meta
DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_type(struct doca_flow_pipe_cfg *cfg, enum doca_flow_pipe_type type)
Set pipe's type.
#define DOCA_FLOW_PSP_DECRYPTION_ID
DOCA_EXPERIMENTAL doca_error_t doca_flow_init(struct doca_flow_cfg *cfg)
Initialize the doca flow.
DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_dev(struct doca_flow_port_cfg *cfg, struct doca_dev *dev)
Set port's device.
DOCA_EXPERIMENTAL doca_error_t doca_flow_shared_resource_set_cfg(enum doca_flow_shared_resource_type type, uint32_t id, struct doca_flow_shared_resource_cfg *cfg)
Configure a single shared resource.
DOCA_STABLE doca_error_t doca_flow_cfg_set_nr_counters(struct doca_flow_cfg *cfg, uint32_t nr_counters)
Set number of counters to configure.
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_actions(struct doca_flow_pipe_cfg *cfg, struct doca_flow_actions *const *actions, struct doca_flow_actions *const *actions_masks, struct doca_flow_action_descs *const *action_descs, size_t nr_actions)
Set pipe's actions, actions mask and actions descriptor.
DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_actions_mem_size(struct doca_flow_port_cfg *cfg, uint32_t size)
Set max memory size used by actions.
DOCA_STABLE doca_error_t doca_flow_cfg_set_nr_shared_resource(struct doca_flow_cfg *cfg, uint32_t nr_shared_resource, enum doca_flow_shared_resource_type type)
Set number of shared resource.
DOCA_STABLE doca_error_t doca_flow_port_stop(struct doca_flow_port *port)
Stop a doca port.
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_monitor(struct doca_flow_pipe_cfg *cfg, const struct doca_flow_monitor *monitor)
Set pipe's monitor.
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_add_entry(uint16_t pipe_queue, struct doca_flow_pipe *pipe, const struct doca_flow_match *match, const struct doca_flow_actions *actions, const struct doca_flow_monitor *monitor, const struct doca_flow_fwd *fwd, uint32_t flags, void *usr_ctx, struct doca_flow_pipe_entry **entry)
Add one new entry to a pipe.
DOCA_STABLE doca_error_t doca_flow_pipe_remove_entry(uint16_t pipe_queue, uint32_t flags, struct doca_flow_pipe_entry *entry)
Free one pipe entry.
doca_flow_entry_status
doca flow entry status
DOCA_STABLE void doca_flow_destroy(void)
Destroy the doca flow.
DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_port_id(struct doca_flow_port_cfg *cfg, uint16_t port_id)
Set the logical port ID.
DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_nr_entries(struct doca_flow_pipe_cfg *cfg, uint32_t nr_entries)
Set pipe's maximum number of flow rules.
DOCA_EXPERIMENTAL doca_error_t doca_flow_cfg_set_default_rss(struct doca_flow_cfg *cfg, const struct doca_flow_resource_rss_cfg *rss)
Set RSS global configuration.
DOCA_EXPERIMENTAL doca_error_t doca_flow_resource_query_pipe_miss(struct doca_flow_pipe *pipe, struct doca_flow_resource_query *query_stats)
Extract information about pipe miss entry.
DOCA_STABLE doca_error_t doca_flow_port_cfg_create(struct doca_flow_port_cfg **cfg)
Create DOCA Flow port configuration struct.
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_dir_info(struct doca_flow_pipe_cfg *cfg, enum doca_flow_direction_info dir_info)
Set pipe's Direction info.
doca_flow_l4_meta
doca flow l4 valid type for parser meta
DOCA_STABLE doca_error_t doca_flow_port_cfg_destroy(struct doca_flow_port_cfg *cfg)
Destroy DOCA Flow port configuration struct.
DOCA_STABLE doca_error_t doca_flow_cfg_set_pipe_queues(struct doca_flow_cfg *cfg, uint16_t pipe_queues)
Set pipe queues.
DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_domain(struct doca_flow_pipe_cfg *cfg, enum doca_flow_pipe_domain domain)
Set pipe's domain.
DOCA_STABLE doca_error_t doca_flow_cfg_destroy(struct doca_flow_cfg *cfg)
Destroy DOCA Flow configuration struct.
DOCA_EXPERIMENTAL doca_error_t doca_flow_resource_query_entry(struct doca_flow_pipe_entry *entry, struct doca_flow_resource_query *query_stats)
Extract information about specific entry.
@ DOCA_FLOW_SHARED_RESOURCE_PSP
@ DOCA_FLOW_SHARED_RESOURCE_MIRROR
@ DOCA_FLOW_DIRECTION_HOST_TO_NETWORK
@ DOCA_FLOW_DIRECTION_NETWORK_TO_HOST
@ DOCA_FLOW_CRYPTO_SYNDROME_ICV_FAIL
@ DOCA_FLOW_CRYPTO_SYNDROME_BAD_TRAILER
@ DOCA_FLOW_RESOURCE_TYPE_NON_SHARED
@ DOCA_FLOW_FWD_CHANGEABLE
@ DOCA_FLOW_ENTRY_STATUS_SUCCESS
@ DOCA_FLOW_PIPE_DOMAIN_EGRESS
@ DOCA_FLOW_PIPE_DOMAIN_SECURE_INGRESS
@ DOCA_FLOW_PIPE_DOMAIN_SECURE_EGRESS
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
#define DOCA_LOG_WARN(format,...)
Generates a WARNING application log message.
#define DOCA_LOG_INFO(format,...)
Generates an INFO application log message.
#define DOCA_LOG_DBG(format,...)
Generates a DEBUG application log message.
std::pair< std::string, std::string > session_key
static constexpr uint32_t IPV6_ADDR_LEN
DOCA_LOG_REGISTER(PSP_GATEWAY)
#define IF_SUCCESS(result, expr)
const uint8_t PSP_SAMPLE_ENABLE
static const uint32_t DEFAULT_TIMEOUT_US
static const uint32_t PSP_ICV_SIZE
struct PSP_GatewayFlows::pipe_query __rte_aligned
static const uint32_t MAX_ACTIONS_MEM_SIZE
static const int NUM_OF_PSP_SYNDROMES
std::string mac_to_string(const rte_ether_addr &mac_addr)
Converts a MAC/ethernet address to a C++ string.
std::string ip_to_string(const struct doca_flow_ip_addr &ip_addr)
Converts a DOCA Flow IP address struct to a C++ string.
doca_flow_pipe_entry * entry
doca flow actions information
struct doca_flow_crypto_encap_action crypto_encap
struct doca_flow_meta meta
struct doca_flow_crypto_action crypto
enum doca_flow_crypto_action_type action_type
enum doca_flow_crypto_resource_type resource_type
enum doca_flow_crypto_encap_action_type action_type
enum doca_flow_crypto_encap_net_type net_type
uint8_t encap_data[DOCA_FLOW_CRYPTO_HEADER_LEN_MAX]
enum doca_flow_crypto_key_type key_type
struct doca_flow_pipe * next_pipe
enum doca_flow_fwd_type type
enum doca_flow_resource_type rss_type
struct doca_flow_resource_rss_cfg rss
enum doca_flow_l3_type type
doca flow matcher information
struct doca_flow_header_format inner
struct doca_flow_parser_meta parser_meta
struct doca_flow_header_format outer
struct doca_flow_meta meta
doca monitor action configuration
uint32_t shared_mirror_id
enum doca_flow_resource_type counter_type
struct doca_flow_mirror_target * target
struct doca_flow_crypto_key_cfg key_cfg
struct doca_flow_resource_query::@115::@117 counter
doca flow shared resource configuration
struct doca_flow_resource_psp_cfg psp_cfg
struct doca_flow_resource_mirror_cfg mirror_cfg
enum doca_flow_tun_type type
struct doca_flow_header_psp psp
user context struct that will be used in entries process callback
packet header structure to simplify populating the encap_data array for tunnel encap ipv4 data
rte_be64_t psp_virt_cookie
packet header structure to simplify populating the encap_data array for tunnel encap ipv6 data
rte_be64_t psp_virt_cookie
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
packet header structure to simplify populating the encap_data array for transport encap data
rte_be64_t psp_virt_cookie