MCPcopy Create free account
hub / github.com/F-Stack/f-stack / action_default_check

Function action_default_check

dpdk/examples/ip_pipeline/thread.c:1156–1178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1154}
1155
1156static int
1157action_default_check(struct table_rule_action *action,
1158 struct pipeline *p,
1159 uint32_t table_id)
1160{
1161 if ((action == NULL) ||
1162 (action->action_mask != (1LLU << RTE_TABLE_ACTION_FWD)) ||
1163 (p == NULL) ||
1164 (table_id >= p->n_tables))
1165 return -1;
1166
1167 if (action->action_mask & (1LLU << RTE_TABLE_ACTION_FWD)) {
1168 if ((action->fwd.action == RTE_PIPELINE_ACTION_PORT) &&
1169 (action->fwd.id >= p->n_ports_out))
1170 return -1;
1171
1172 if ((action->fwd.action == RTE_PIPELINE_ACTION_TABLE) &&
1173 (action->fwd.id >= p->n_tables))
1174 return -1;
1175 }
1176
1177 return 0;
1178}
1179
1180union table_rule_match_low_level {
1181 struct rte_table_acl_rule_add_params acl_add;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected