[v2,3/3] app/testpmd: fix meter mark handle update
Checks
Commit Message
The indirect action handle update for the METER_MERK action
was implemented only for the async RTE Flow API.
Allow updating the METER_MARK parameters via the old sync method.
Fixes: 9c4a0c1859a3 ("ethdev: add meter color mark flow action")
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
---
app/test-pmd/config.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
Comments
> -----Original Message-----
> From: Alexander Kozyrev <akozyrev@nvidia.com>
> Sent: Tuesday, July 18, 2023 4:32 PM
>
> The indirect action handle update for the METER_MERK action
> was implemented only for the async RTE Flow API.
> Allow updating the METER_MARK parameters via the old sync method.
>
> Fixes: 9c4a0c1859a3 ("ethdev: add meter color mark flow action")
>
> Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
> ---
Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori
@@ -1943,6 +1943,7 @@ port_action_handle_update(portid_t port_id, uint32_t id,
struct rte_flow_error error;
struct rte_flow_action_handle *action_handle;
struct port_indirect_action *pia;
+ struct rte_flow_update_meter_mark mtr_update;
const void *update;
action_handle = port_action_handle_get_by_id(port_id, id);
@@ -1956,6 +1957,17 @@ port_action_handle_update(portid_t port_id, uint32_t id,
case RTE_FLOW_ACTION_TYPE_CONNTRACK:
update = action->conf;
break;
+ case RTE_FLOW_ACTION_TYPE_METER_MARK:
+ memcpy(&mtr_update.meter_mark, action->conf,
+ sizeof(struct rte_flow_action_meter_mark));
+ if (mtr_update.meter_mark.profile)
+ mtr_update.profile_valid = 1;
+ if (mtr_update.meter_mark.policy)
+ mtr_update.policy_valid = 1;
+ mtr_update.color_mode_valid = 1;
+ mtr_update.state_valid = 1;
+ update = &mtr_update;
+ break;
default:
update = action;
break;
@@ -3162,8 +3174,10 @@ port_queue_action_handle_update(portid_t port_id,
case RTE_FLOW_ACTION_TYPE_METER_MARK:
rte_memcpy(&mtr_update.meter_mark, action->conf,
sizeof(struct rte_flow_action_meter_mark));
- mtr_update.profile_valid = 1;
- mtr_update.policy_valid = 1;
+ if (mtr_update.meter_mark.profile)
+ mtr_update.profile_valid = 1;
+ if (mtr_update.meter_mark.policy)
+ mtr_update.policy_valid = 1;
mtr_update.color_mode_valid = 1;
mtr_update.init_color_valid = 1;
mtr_update.state_valid = 1;