DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix VXLAN device rollback if rule apply fails
@ 2018-11-10 10:01 Slava Ovsiienko
  2018-11-11 11:34 ` Yongseok Koh
  0 siblings, 1 reply; 3+ messages in thread
From: Slava Ovsiienko @ 2018-11-10 10:01 UTC (permalink / raw)
  To: Shahaf Shuler, Yongseok Koh; +Cc: dev, Slava Ovsiienko

If rule contains tunneling action (like VXLAN encapsulation)
the VTEP (Virtual Tunneling EndPoint) device is preconfigured
before appying the rule. If kernel returnsan error this
VTEP configuration should be rolled back to the origin state.
The patch adds the missing VTEP configuration restoration.

Fixes: 95a464cecc21 ("net/mlx5: add E-switch VXLAN tunnel devices management")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_tcf.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_tcf.c
index 21eb99e..7dd3a64 100644
--- a/drivers/net/mlx5/mlx5_flow_tcf.c
+++ b/drivers/net/mlx5/mlx5_flow_tcf.c
@@ -5124,6 +5124,13 @@ struct tcf_nlcb_context {
 		dev_flow->tcf.applied = 1;
 		return 0;
 	}
+	if (dev_flow->tcf.tunnel) {
+		/* Rollback the VTEP configuration if rule aplly failed. */
+		assert(dev_flow->tcf.tunnel->vtep);
+		flow_tcf_vtep_release(ctx, dev_flow->tcf.tunnel->vtep,
+				      dev_flow);
+		dev_flow->tcf.tunnel->vtep = NULL;
+	}
 	return rte_flow_error_set(error, rte_errno,
 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
 				  "netlink: failed to create TC flow rule");
-- 
1.8.3.1

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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix VXLAN device rollback if rule apply fails
  2018-11-10 10:01 [dpdk-dev] [PATCH] net/mlx5: fix VXLAN device rollback if rule apply fails Slava Ovsiienko
@ 2018-11-11 11:34 ` Yongseok Koh
  2018-11-11 12:42   ` Shahaf Shuler
  0 siblings, 1 reply; 3+ messages in thread
From: Yongseok Koh @ 2018-11-11 11:34 UTC (permalink / raw)
  To: Slava Ovsiienko; +Cc: Shahaf Shuler, dev


> On Nov 10, 2018, at 2:01 AM, Slava Ovsiienko <viacheslavo@mellanox.com> wrote:
> 
> If rule contains tunneling action (like VXLAN encapsulation)
> the VTEP (Virtual Tunneling EndPoint) device is preconfigured
> before appying the rule. If kernel returnsan error this
> VTEP configuration should be rolled back to the origin state.
> The patch adds the missing VTEP configuration restoration.
> 
> Fixes: 95a464cecc21 ("net/mlx5: add E-switch VXLAN tunnel devices management")
> 
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> ---
Acked-by: Yongseok Koh <yskoh@mellanox.com>
 
Thanks

> drivers/net/mlx5/mlx5_flow_tcf.c | 7 +++++++
> 1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_tcf.c
> index 21eb99e..7dd3a64 100644
> --- a/drivers/net/mlx5/mlx5_flow_tcf.c
> +++ b/drivers/net/mlx5/mlx5_flow_tcf.c
> @@ -5124,6 +5124,13 @@ struct tcf_nlcb_context {
> 		dev_flow->tcf.applied = 1;
> 		return 0;
> 	}
> +	if (dev_flow->tcf.tunnel) {
> +		/* Rollback the VTEP configuration if rule aplly failed. */
> +		assert(dev_flow->tcf.tunnel->vtep);
> +		flow_tcf_vtep_release(ctx, dev_flow->tcf.tunnel->vtep,
> +				      dev_flow);
> +		dev_flow->tcf.tunnel->vtep = NULL;
> +	}
> 	return rte_flow_error_set(error, rte_errno,
> 				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
> 				  "netlink: failed to create TC flow rule");
> -- 
> 1.8.3.1
> 

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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix VXLAN device rollback if rule apply fails
  2018-11-11 11:34 ` Yongseok Koh
@ 2018-11-11 12:42   ` Shahaf Shuler
  0 siblings, 0 replies; 3+ messages in thread
From: Shahaf Shuler @ 2018-11-11 12:42 UTC (permalink / raw)
  To: Yongseok Koh, Slava Ovsiienko; +Cc: dev

Sunday, November 11, 2018 1:34 PM, Yongseok Koh:
> Subject: Re: [PATCH] net/mlx5: fix VXLAN device rollback if rule apply fails
> > On Nov 10, 2018, at 2:01 AM, Slava Ovsiienko <viacheslavo@mellanox.com>
> wrote:
> >
> > If rule contains tunneling action (like VXLAN encapsulation) the VTEP
> > (Virtual Tunneling EndPoint) device is preconfigured before appying
> > the rule. If kernel returnsan error this VTEP configuration should be
> > rolled back to the origin state.
> > The patch adds the missing VTEP configuration restoration.
> >
> > Fixes: 95a464cecc21 ("net/mlx5: add E-switch VXLAN tunnel devices
> > management")
> >
> > Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> > ---
> Acked-by: Yongseok Koh <yskoh@mellanox.com>

Applied to next-net-mlx, thanks. 

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

end of thread, other threads:[~2018-11-11 12:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-10 10:01 [dpdk-dev] [PATCH] net/mlx5: fix VXLAN device rollback if rule apply fails Slava Ovsiienko
2018-11-11 11:34 ` Yongseok Koh
2018-11-11 12:42   ` Shahaf Shuler

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).