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. Preserve the deprecated SHARED
action handle directly, as for INDIRECT, instead of treating it as
configuration data to copy into the destination buffer.
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 | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 6e544f4bc91..e29bcefab0e 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,
@@ -1043,7 +1047,8 @@ rte_flow_conv_actions(struct rte_flow_action *dst,
num = i;
src -= num;
for (i = 0; i != num; ++i, ++src) {
- if (src->type == RTE_FLOW_ACTION_TYPE_INDIRECT) {
+ if (src->type == RTE_FLOW_ACTION_TYPE_INDIRECT ||
+ src->type == RTE_FLOW_ACTION_TYPE_SHARED) {
/*
* Indirect action conf fills the indirect action
* handler. Copy the action handle directly instead
--
2.52.0