DPDK patches and discussions
 help / color / mirror / Atom feed
From: Matan Azrad <matan@mellanox.com>
To: Yongseok Koh <yskoh@mellanox.com>, Shahaf Shuler <shahafs@mellanox.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Yongseok Koh <yskoh@mellanox.com>
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix sanity check for MPLS-in-GRE
Date: Sun, 5 Aug 2018 06:41:00 +0000	[thread overview]
Message-ID: <AM0PR0502MB4019344F3E39C8FA3FA7C16DD2210@AM0PR0502MB4019.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <20180803220056.22840-1-yskoh@mellanox.com>

Hi Koh

From: Yongseok Koh
> Multiple tunnel isn't allowed but MPLS over GRE should be accepted.
> 
> Fixes: a4a5cd21d20a ("net/mlx5: add flow MPLS item")
> 
> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_flow.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index
> b7500ec9d6..ca4625b699 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -1778,7 +1778,9 @@ mlx5_flow_item_mpls(const struct rte_flow_item
> *item __rte_unused,
>  					  item,
>  					  "protocol filtering not compatible"
>  					  " with MPLS layer");
> -	if (flow->layers & MLX5_FLOW_LAYER_TUNNEL)
> +	/* Multi-tunnel isn't allowed but MPLS over GRE is an exception. */
> +	if (flow->layers & MLX5_FLOW_LAYER_TUNNEL &&
> +	    (flow->layers & MLX5_FLOW_LAYER_GRE) !=

This check is not fully correct because the GRE item must be the last valid item before the mpls, so the next flow

eth / ipv4 / gre / ipv4 / mpls

is not valid.

But the next flows are valid:
eth / ipv4 / gre / mpls
eth / ipv4 / gre / void / mpls
eth / ipv4 / gre / void / void / void / mpls



> MLX5_FLOW_LAYER_GRE)
>  		return rte_flow_error_set(error, ENOTSUP,
>  					  RTE_FLOW_ERROR_TYPE_ITEM,
>  					  item,
> --
> 2.11.0

  reply	other threads:[~2018-08-05  6:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-03 22:00 Yongseok Koh
2018-08-05  6:41 ` Matan Azrad [this message]
2018-08-05 11:17   ` Shahaf Shuler
2018-08-06 18:36     ` Yongseok Koh

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=AM0PR0502MB4019344F3E39C8FA3FA7C16DD2210@AM0PR0502MB4019.eurprd05.prod.outlook.com \
    --to=matan@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=shahafs@mellanox.com \
    --cc=yskoh@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).