Parse RSS action. */
| 8438 | |
| 8439 | /** Parse RSS action. */ |
| 8440 | static int |
| 8441 | parse_vc_action_rss(struct context *ctx, const struct token *token, |
| 8442 | const char *str, unsigned int len, |
| 8443 | void *buf, unsigned int size) |
| 8444 | { |
| 8445 | struct buffer *out = buf; |
| 8446 | struct rte_flow_action *action; |
| 8447 | struct action_rss_data *action_rss_data; |
| 8448 | unsigned int i; |
| 8449 | int ret; |
| 8450 | |
| 8451 | ret = parse_vc(ctx, token, str, len, buf, size); |
| 8452 | if (ret < 0) |
| 8453 | return ret; |
| 8454 | /* Nothing else to do if there is no buffer. */ |
| 8455 | if (!out) |
| 8456 | return ret; |
| 8457 | if (!out->args.vc.actions_n) |
| 8458 | return -1; |
| 8459 | action = &out->args.vc.actions[out->args.vc.actions_n - 1]; |
| 8460 | /* Point to selected object. */ |
| 8461 | ctx->object = out->args.vc.data; |
| 8462 | ctx->objmask = NULL; |
| 8463 | /* Set up default configuration. */ |
| 8464 | action_rss_data = ctx->object; |
| 8465 | *action_rss_data = (struct action_rss_data){ |
| 8466 | .conf = (struct rte_flow_action_rss){ |
| 8467 | .func = RTE_ETH_HASH_FUNCTION_DEFAULT, |
| 8468 | .level = 0, |
| 8469 | .types = rss_hf, |
| 8470 | .key_len = 0, |
| 8471 | .queue_num = RTE_MIN(nb_rxq, ACTION_RSS_QUEUE_NUM), |
| 8472 | .key = NULL, |
| 8473 | .queue = action_rss_data->queue, |
| 8474 | }, |
| 8475 | .queue = { 0 }, |
| 8476 | }; |
| 8477 | for (i = 0; i < action_rss_data->conf.queue_num; ++i) |
| 8478 | action_rss_data->queue[i] = i; |
| 8479 | action->conf = &action_rss_data->conf; |
| 8480 | return ret; |
| 8481 | } |
| 8482 | |
| 8483 | /** |
| 8484 | * Parse func field for RSS action. |
nothing calls this directly
no test coverage detected