From: Yongseok Koh <yskoh@mellanox.com>
To: Slava Ovsiienko <viacheslavo@mellanox.com>
Cc: Shahaf Shuler <shahafs@mellanox.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix VXLAN device rollback if rule apply fails
Date: Sun, 11 Nov 2018 11:34:03 +0000 [thread overview]
Message-ID: <3C3703BE-E995-430B-AB08-C2D86C00CD32@mellanox.com> (raw)
In-Reply-To: <1541844105-32135-1-git-send-email-viacheslavo@mellanox.com>
> 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
>
next prev parent reply other threads:[~2018-11-11 11:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-10 10:01 Slava Ovsiienko
2018-11-11 11:34 ` Yongseok Koh [this message]
2018-11-11 12:42 ` Shahaf Shuler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3C3703BE-E995-430B-AB08-C2D86C00CD32@mellanox.com \
--to=yskoh@mellanox.com \
--cc=dev@dpdk.org \
--cc=shahafs@mellanox.com \
--cc=viacheslavo@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).