[PATCH v5 06/25] net/nfp: support basic flow actions
Ferruh Yigit
ferruh.yigit at amd.com
Thu Oct 20 13:12:16 CEST 2022
On 10/20/2022 3:19 AM, Chaoyong He wrote:
> Add the offload support of very basic actions: mark, rss,
> count, drop and output.
>
> Signed-off-by: Chaoyong He <chaoyong.he at corigine.com>
> Reviewed-by: Niklas Söderlund <niklas.soderlund at corigine.com>
<...>
> +static int
> +nfp_flow_compile_action(__rte_unused struct nfp_flower_representor *representor,
> + const struct rte_flow_action actions[],
> + struct rte_flow *nfp_flow)
> +{
> + int ret = 0;
> + char *position;
> + char *action_data;
> + bool drop_flag = false;
> + uint32_t total_actions = 0;
> + const struct rte_flow_action *action;
> + struct nfp_fl_rule_metadata *nfp_flow_meta;
> +
> + nfp_flow_meta = nfp_flow->payload.meta;
> + action_data = nfp_flow->payload.action_data;
> + position = action_data;
> +
> + for (action = actions; action->type != RTE_FLOW_ACTION_TYPE_END; ++action) {
> + switch (action->type) {
> + case RTE_FLOW_ACTION_TYPE_VOID:
> + break;
> + case RTE_FLOW_ACTION_TYPE_MARK:
> + PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_MARK");
> + break;
> + case RTE_FLOW_ACTION_TYPE_DROP:
> + PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_DROP");
> + drop_flag = true;
> + break;
> + case RTE_FLOW_ACTION_TYPE_COUNT:
> + PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_COUNT");
> + break;
> + case RTE_FLOW_ACTION_TYPE_RSS:
> + PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_RSS");
> + break;
Above MARK and RSS actions not doing anything but not returning error as
if it is supported.
Not sure about COUNT, since driver is keeping stats may be it is
supported by default, but if not it also needs to return error.
More information about the dev
mailing list