net/mlx5: fix MARK action in active tunnel offload
PATCH 1/2 net/mlx5: fix MARK action in active tunnel offload
Tunnel offload mode allows application to restore partially offloaded tunneled packets to its original state.
MLX5 PMD stores internal data required to restore partially offloaded packet in packet mark section. Therefore MLX5 PMD will not allow applications to use mark action if tunnel offload mode was activated. The restriction is applied both to regular and tunnel offload rules.
The patch rejects application rules with mark action while tunnel offload is active.
--- drivers/net/mlx5/mlx5_flow_dv.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/mlx5/mlx5_flow_dv.c +5 -0
@@ -2375,6 +2375,11 @@ flow_dv_validate_action_mark(struct rte_eth_dev *dev,const struct rte_flow_action_mark *mark = action->conf;int ret; +if (is_tunnel_offload_active (dev)) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ACTION ,NULL , +"no mark action " +"if tunnel offload active" );/* Fall back if no extended metadata register support. */ if (config->dv_xmeta_en ==MLX5_XMETA_MODE_LEGACY ) return mlx5_flow_validate_action_mark(action, action_flags,
Signature · 1 line
2.29.2
PATCH 2/2 net/mlx5: fix DROP action in tunnel offload mode
Tunnel offload mode allows application to restore partially offloaded tunneled packets to its original state.
The mode was designed to optimize packet recovery. It must not block flow actions that are allowed by MLX5 PMD.
The patch allows tunnel offload match rules to use drop flow action.
--- drivers/net/mlx5/mlx5_flow_dv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow_dv.c +4 -1
@@ -6087,8 +6087,11 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,* Validate the drop action mutual exclusion with other actions. * Drop action is mutually-exclusive with any other action, except for * Count action. +* Drop action compatibility with tunnel offload was already validated. */ -if ((action_flags &MLX5_FLOW_ACTION_DROP ) && +if (action_flags & (MLX5_FLOW_ACTION_TUNNEL_MATCH | +MLX5_FLOW_ACTION_TUNNEL_MATCH )); +else if ((action_flags &MLX5_FLOW_ACTION_DROP ) && (action_flags & ~(MLX5_FLOW_ACTION_DROP |MLX5_FLOW_ACTION_COUNT ))) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, NULL,
Signature · 1 line
2.29.2
Hi,
Quoted 16 lines
-----Original Message-----
From: Gregory Etelson <[email protected]>
Sent: Wednesday, January 20, 2021 9:17 PM
To: [email protected]
Cc: Gregory Etelson <[email protected]>; Matan Azrad <[email protected]>; Raslan Darawsheh <[email protected]>; Slava Ovsiienko <[email protected]>; Shahaf Shuler <[email protected]>
Subject: [PATCH 1/2] net/mlx5: fix MARK action in active tunnel offloadTunnel offload mode allows application to restore partially offloaded tunneled packets to its original state.
MLX5 PMD stores internal data required to restore partially offloaded packet in packet mark section. Therefore MLX5 PMD will not allow applications to use mark action if tunnel offload mode was activated. The restriction is applied both to regular and tunnel offload rules.
Quoted 3 lines
The patch rejects application rules with mark action while tunnel offload is active.
Missing:
Which is added to both patches during integration,
Quoted 3 lines
Signed-off-by Gregory Etelson <[email protected]>---
Series applied to next-net-mlx,
Kindest regards
Raslan Darawsheh