DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] net/mlx5: fix MARK action in active tunnel offload
@ 2021-01-20 19:17 Gregory Etelson
  2021-01-20 19:17 ` [dpdk-dev] [PATCH 2/2] net/mlx5: fix DROP action in tunnel offload mode Gregory Etelson
  2021-01-24  9:01 ` [dpdk-dev] [PATCH 1/2] net/mlx5: fix MARK action in active tunnel offload Raslan Darawsheh
  0 siblings, 2 replies; 3+ messages in thread
From: Gregory Etelson @ 2021-01-20 19:17 UTC (permalink / raw)
  To: dev; +Cc: getelson, matan, rasland, Viacheslav Ovsiienko, Shahaf Shuler

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.

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 4f638e24ad..ede484d026 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -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,
-- 
2.29.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [PATCH 2/2] net/mlx5: fix DROP action in tunnel offload mode
  2021-01-20 19:17 [dpdk-dev] [PATCH 1/2] net/mlx5: fix MARK action in active tunnel offload Gregory Etelson
@ 2021-01-20 19:17 ` Gregory Etelson
  2021-01-24  9:01 ` [dpdk-dev] [PATCH 1/2] net/mlx5: fix MARK action in active tunnel offload Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Gregory Etelson @ 2021-01-20 19:17 UTC (permalink / raw)
  To: dev; +Cc: getelson, matan, rasland, Viacheslav Ovsiienko, Shahaf Shuler

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.

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index ede484d026..bb3af246cd 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -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,
-- 
2.29.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] net/mlx5: fix MARK action in active tunnel offload
  2021-01-20 19:17 [dpdk-dev] [PATCH 1/2] net/mlx5: fix MARK action in active tunnel offload Gregory Etelson
  2021-01-20 19:17 ` [dpdk-dev] [PATCH 2/2] net/mlx5: fix DROP action in tunnel offload mode Gregory Etelson
@ 2021-01-24  9:01 ` Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Raslan Darawsheh @ 2021-01-24  9:01 UTC (permalink / raw)
  To: Gregory Etelson, dev; +Cc: Matan Azrad, Slava Ovsiienko, Shahaf Shuler

Hi,

> -----Original Message-----
> From: Gregory Etelson <getelson@nvidia.com>
> Sent: Wednesday, January 20, 2021 9:17 PM
> To: dev@dpdk.org
> Cc: Gregory Etelson <getelson@nvidia.com>; Matan Azrad
> <matan@nvidia.com>; Raslan Darawsheh <rasland@nvidia.com>; Slava
> Ovsiienko <viacheslavo@nvidia.com>; Shahaf Shuler <shahafs@nvidia.com>
> Subject: [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.
> 
Missing:
Fixes: 4ec6360de37d ("net/mlx5: implement tunnel offload")
Cc: stable@dpdk.org
Which is added to both patches during integration, 

> Signed-off-by: Gregory Etelson <getelson@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> ---

Series applied to next-net-mlx,
Kindest regards
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-24  9:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 19:17 [dpdk-dev] [PATCH 1/2] net/mlx5: fix MARK action in active tunnel offload Gregory Etelson
2021-01-20 19:17 ` [dpdk-dev] [PATCH 2/2] net/mlx5: fix DROP action in tunnel offload mode Gregory Etelson
2021-01-24  9:01 ` [dpdk-dev] [PATCH 1/2] net/mlx5: fix MARK action in active tunnel offload Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).