Is there any doca flow samples about traffic from software Tx, I try to create a egress root pipe to match all the ICMP packets from software Tx traffic with DOCA 3.1.0 on ConnectX-8, but it doesn’t work。
For example:
static doca_error_t create_root_pipe(struct doca_flow_port *port,
struct doca_flow_pipe *next_pipe,
struct entries_status *status,
struct doca_flow_pipe **pipe_ptr)
{
struct doca_flow_match match = {.parser_meta = {.outer_l3_type = UINT32_MAX, .outer_l4_type = UINT32_MAX}};
struct doca_flow_fwd fwd = {.type = DOCA_FLOW_FWD_PIPE, .next_pipe = next_pipe};
struct doca_flow_fwd fwd_miss = {.type = DOCA_FLOW_FWD_DROP};
struct doca_flow_pipe *pipe;
struct doca_flow_pipe_entry *entry;
doca_error_t result;
result = create_basic_pipe(port, "ROOT_PIPE", &match, NULL, NULL, &fwd, &fwd_miss, 0, 2, true, true, &pipe);
if (result != DOCA_SUCCESS) {
DOCA_LOG_ERR("Failed to create root pipe, pipe creation failed");
return result;
}
match.parser_meta.outer_l3_type = DOCA_FLOW_L3_META_IPV4;
match.parser_meta.outer_l4_type = DOCA_FLOW_L4_META_ICMP;
result = doca_flow_pipe_add_entry(0, pipe, &match, NULL, NULL, &fwd, 0, status, &entry);
if (result != DOCA_SUCCESS) {
DOCA_LOG_ERR("Failed to create root pipe, IPv4 entry adding failed");
doca_flow_pipe_destroy(pipe);
return result;
}
g_entry[g_port_id][DOCA_ROOT_ENTRY] = entry;
*pipe_ptr = pipe;
return DOCA_SUCCESS;
}
Then use doca_flow_pipe_cfg_set_domain(cfg, DOCA_FLOW_PIPE_DOMAIN_EGRESS) to set pipe to EGRESS domain:
result = doca_flow_pipe_cfg_create(&cfg, port);
if (result != DOCA_SUCCESS) {
DOCA_LOG_ERR("Failed to create doca_flow_pipe_cfg: %s", doca_error_get_descr(result));
return result;
}
result = set_flow_pipe_cfg(cfg, name, DOCA_FLOW_PIPE_BASIC, is_root);
if (result != DOCA_SUCCESS) {
DOCA_LOG_ERR("Failed to set doca_flow_pipe_cfg: %s", doca_error_get_descr(result));
doca_flow_pipe_cfg_destroy(cfg);
return result;
}
result = doca_flow_pipe_cfg_set_domain(cfg, DOCA_FLOW_PIPE_DOMAIN_EGRESS);
if (result != DOCA_SUCCESS) {
DOCA_LOG_ERR("Failed to set doca_flow_pipe_cfg domain: %s", doca_error_get_descr(result));
doca_flow_pipe_cfg_destroy(cfg);
return result;
}
When I ping the gateway from this port, tcpdump shows that icmp packets are sent, but the egress root pipe does not match or drop any icmp packets, So, how to make it works?
thanks!