RTE_FLOW_ACTION_TYPE_SHARED, RTE_FLOW_ACTION_TYPE_METER_COLOR and
RTE_FLOW_ACTION_TYPE_SKIP_CMAN were never added to
rte_flow_desc_action[]. The table uses designated initializers, so
these slots are zero filled: their name is NULL and their size is
zero.

As a result, RTE_FLOW_CONV_OP_ACTION_NAME on any of them passes a
NULL source to strlcpy(), and rte_flow_copy() as well as the action
conversion operations reject any action list containing one of them
as an unknown action type.

Add the missing descriptor entries.

Fixes: 4d9fd85fb545 ("ethdev: add shared actions to flow API")
Fixes: 5f0d54f372f0 ("ethdev: add pre-defined meter policy API")
Fixes: 6807e8b52a18 ("ethdev: skip congestion management configuration")
Cc: [email protected]

Signed-off-by: Anatoly Burakov <[email protected]>
---
 lib/ethdev/rte_flow.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index eeab79aa5d9..8a4833695c0 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -324,6 +324,8 @@ static const struct rte_flow_desc_data 
rte_flow_desc_action[] = {
        MK_FLOW_ACTION(SET_IPV6_DSCP, sizeof(struct rte_flow_action_set_dscp)),
        MK_FLOW_ACTION(AGE, sizeof(struct rte_flow_action_age)),
        MK_FLOW_ACTION(SAMPLE, sizeof(struct rte_flow_action_sample)),
+       /* Deprecated; handle stored in conf as for INDIRECT. */
+       MK_FLOW_ACTION(SHARED, 0),
        MK_FLOW_ACTION(MODIFY_FIELD,
                       sizeof(struct rte_flow_action_modify_field)),
        /**
@@ -334,11 +336,13 @@ static const struct rte_flow_desc_data 
rte_flow_desc_action[] = {
         */
        MK_FLOW_ACTION(INDIRECT, 0),
        MK_FLOW_ACTION(CONNTRACK, sizeof(struct rte_flow_action_conntrack)),
+       MK_FLOW_ACTION(METER_COLOR, sizeof(struct rte_flow_action_meter_color)),
        MK_FLOW_ACTION(PORT_REPRESENTOR, sizeof(struct rte_flow_action_ethdev)),
        MK_FLOW_ACTION(REPRESENTED_PORT, sizeof(struct rte_flow_action_ethdev)),
        MK_FLOW_ACTION(METER_MARK, sizeof(struct rte_flow_action_meter_mark)),
        MK_FLOW_ACTION(SEND_TO_KERNEL, 0),
        MK_FLOW_ACTION(QUOTA, sizeof(struct rte_flow_action_quota)),
+       MK_FLOW_ACTION(SKIP_CMAN, 0),
        MK_FLOW_ACTION(IPV6_EXT_PUSH, sizeof(struct 
rte_flow_action_ipv6_ext_push)),
        MK_FLOW_ACTION(IPV6_EXT_REMOVE, sizeof(struct 
rte_flow_action_ipv6_ext_remove)),
        MK_FLOW_ACTION(INDIRECT_LIST,
-- 
2.52.0

Reply via email to