From: Ori Kam <orika@mellanox.com>
To: Dekel Peled <dekelp@mellanox.com>,
Yongseok Koh <yskoh@mellanox.com>,
Shahaf Shuler <shahafs@mellanox.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix MPLS item validation
Date: Mon, 12 Nov 2018 09:52:40 +0000 [thread overview]
Message-ID: <AM4PR05MB342571F821AB533485917BD3DBC10@AM4PR05MB3425.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <1542014408-12853-1-git-send-email-dekelp@mellanox.com>
PSB
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Dekel Peled
> Sent: Monday, November 12, 2018 11:20 AM
> To: Yongseok Koh <yskoh@mellanox.com>; Shahaf Shuler
> <shahafs@mellanox.com>
> Cc: dev@dpdk.org; Ori Kam <orika@mellanox.com>
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix MPLS item validation
>
> Update the mlx5_flow_validate_item_mpls() function to allow
> MPLS over UDP as well as MPLS over IP.
>
> Fixes: 84c406e74524 ("net/mlx5: add flow translate function")
> Cc: orika@mellanox.com
>
> Signed-off-by: Dekel Peled <dekelp@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 21d65f4..0db862b 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -1626,7 +1626,9 @@ uint32_t mlx5_flow_adjust_priority(struct
> rte_eth_dev *dev, int32_t priority,
> const struct rte_flow_item_mpls *mask = item->mask;
> int ret;
>
> - if (target_protocol != 0xff && target_protocol != IPPROTO_MPLS)
> + /* MPLS over IP and MPLS over UDP is allowed */
> + if (target_protocol != 0xff && target_protocol != IPPROTO_MPLS &&
> + target_protocol != IPPROTO_UDP)
I don' t think this is the solution.
First before MPLS we can have GRE so this also need to be tested.
Second I don't think that the validation should use the target_protocol
since it holds value that is not relevant to the question. For example if
a user inserted the following rule eth / ipv4 proto = udp / mpls
The flow will be O.K which clearly it is not.
> return rte_flow_error_set(error, EINVAL,
> RTE_FLOW_ERROR_TYPE_ITEM,
> item,
> "protocol filtering not compatible"
> --
> 1.8.3.1
Best,
Ori
next prev parent reply other threads:[~2018-11-12 9:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-12 9:20 Dekel Peled
2018-11-12 9:52 ` Ori Kam [this message]
2018-11-13 9:51 ` [dpdk-dev] [PATCH v2 0/2] net/mlx5: update MPLS item support Dekel Peled
2018-11-15 15:17 ` [dpdk-dev] [PATCH v3 0/3] " Dekel Peled
2018-11-15 20:44 ` Shahaf Shuler
2018-11-15 15:17 ` [dpdk-dev] [PATCH v3 1/3] net/mlx5: add MPLS to Direct Verbs flow engine Dekel Peled
2018-11-15 15:17 ` [dpdk-dev] [PATCH v3 2/3] net/mlx5: fix MPLS item validation Dekel Peled
2018-11-15 15:17 ` [dpdk-dev] [PATCH v3 3/3] net/mlx5: fix tunnel ptype of MPLS in UDP Dekel Peled
2018-11-13 9:51 ` [dpdk-dev] [PATCH v2 1/2] net/mlx5: add MPLS to Direct Verbs flow engine Dekel Peled
2018-11-13 9:51 ` [dpdk-dev] [PATCH v2 2/2] net/mlx5: fix MPLS item validation Dekel Peled
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=AM4PR05MB342571F821AB533485917BD3DBC10@AM4PR05MB3425.eurprd05.prod.outlook.com \
--to=orika@mellanox.com \
--cc=dekelp@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).