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

Function flow_check_match_action

dpdk/drivers/net/mlx5/mlx5_flow.c:6249–6349  ·  view source on GitHub ↗

* Check the match action from the action list. * * @param[in] actions * Pointer to the list of actions. * @param[in] attr * Flow rule attributes. * @param[in] action * The action to be check if exist. * @param[out] match_action_pos * Pointer to the position of the matched action if exists, otherwise is -1. * @param[out] qrss_action_pos * Pointer to the position of the Queue/RS

Source from the content-addressed store, hash-verified

6247 * 0 if not found match action in action list.
6248 */
6249static int
6250flow_check_match_action(const struct rte_flow_action actions[],
6251 const struct rte_flow_attr *attr,
6252 enum rte_flow_action_type action,
6253 int *match_action_pos, int *qrss_action_pos,
6254 int *modify_after_mirror)
6255{
6256 const struct rte_flow_action_sample *sample;
6257 const struct rte_flow_action_raw_decap *decap;
6258 const struct rte_flow_action *action_cur = NULL;
6259 int actions_n = 0;
6260 uint32_t ratio = 0;
6261 int sub_type = 0;
6262 int flag = 0;
6263 int fdb_mirror = 0;
6264
6265 *match_action_pos = -1;
6266 *qrss_action_pos = -1;
6267 for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
6268 if (actions->type == action) {
6269 flag = 1;
6270 *match_action_pos = actions_n;
6271 }
6272 switch (actions->type) {
6273 case RTE_FLOW_ACTION_TYPE_QUEUE:
6274 case RTE_FLOW_ACTION_TYPE_RSS:
6275 *qrss_action_pos = actions_n;
6276 break;
6277 case RTE_FLOW_ACTION_TYPE_SAMPLE:
6278 sample = actions->conf;
6279 ratio = sample->ratio;
6280 sub_type = ((const struct rte_flow_action *)
6281 (sample->actions))->type;
6282 if (ratio == 1 && attr->transfer &&
6283 sub_type != RTE_FLOW_ACTION_TYPE_END)
6284 fdb_mirror = 1;
6285 break;
6286 case RTE_FLOW_ACTION_TYPE_SET_MAC_SRC:
6287 case RTE_FLOW_ACTION_TYPE_SET_MAC_DST:
6288 case RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC:
6289 case RTE_FLOW_ACTION_TYPE_SET_IPV4_DST:
6290 case RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC:
6291 case RTE_FLOW_ACTION_TYPE_SET_IPV6_DST:
6292 case RTE_FLOW_ACTION_TYPE_SET_TP_SRC:
6293 case RTE_FLOW_ACTION_TYPE_SET_TP_DST:
6294 case RTE_FLOW_ACTION_TYPE_DEC_TTL:
6295 case RTE_FLOW_ACTION_TYPE_SET_TTL:
6296 case RTE_FLOW_ACTION_TYPE_INC_TCP_SEQ:
6297 case RTE_FLOW_ACTION_TYPE_DEC_TCP_SEQ:
6298 case RTE_FLOW_ACTION_TYPE_INC_TCP_ACK:
6299 case RTE_FLOW_ACTION_TYPE_DEC_TCP_ACK:
6300 case RTE_FLOW_ACTION_TYPE_SET_IPV4_DSCP:
6301 case RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP:
6302 case RTE_FLOW_ACTION_TYPE_FLAG:
6303 case RTE_FLOW_ACTION_TYPE_MARK:
6304 case RTE_FLOW_ACTION_TYPE_SET_META:
6305 case RTE_FLOW_ACTION_TYPE_SET_TAG:
6306 case RTE_FLOW_ACTION_TYPE_OF_POP_VLAN:

Callers 1

flow_create_split_sampleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected