DPDK patches and discussions
 help / color / mirror / Atom feed
From: Raslan Darawsheh <rasland@mellanox.com>
To: Dekel Peled <dekelp@mellanox.com>,
	Matan Azrad <matan@mellanox.com>,
	Slava Ovsiienko <viacheslavo@mellanox.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix mask used for IPv6 item validation
Date: Sun, 8 Mar 2020 11:33:40 +0000	[thread overview]
Message-ID: <AM0PR05MB67072D5FE4D2F2968DF1A553C2E10@AM0PR05MB6707.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <5b62429c2368041d9f6a4e1d9b5a8b389261c8cd.1583238768.git.dekelp@mellanox.com>

Hi,

> -----Original Message-----
> From: Dekel Peled <dekelp@mellanox.com>
> Sent: Tuesday, March 3, 2020 2:38 PM
> To: Matan Azrad <matan@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; Raslan Darawsheh <rasland@mellanox.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix mask used for IPv6 item validation
> 
> The nic_mask struct in function mlx5_flow_validate_item_ipv6()
> includes hop_limits field.
> This is redundant since matching on this item is not supported using
> Verbs flow engine (dv_flow_en=0).
> 
> (Separate patch will be sent to handle this issue for DV flow engine.)
> 
> Setting a rule including match on this field will fail:
> testpmd> flow create 0 ingress pattern eth / ipv6 hop is 1 / end actions
> drop / end
> port_flow_complain(): Caught PMD error type 1 (cause unspecified):
> hardware refuses to create flow: Operation not supported
> 
> This patch removes the redundant field from nic_mask, to ensure that
> such flow rules will be rejected by PMD validation:
> testpmd> flow create 0 ingress pattern eth / ipv6 hop is 1 / end actions
> drop / end
> port_flow_complain(): Caught PMD error type 13 (specific pattern item):
> cause: 0x7fffffffa2c8, mask enables non supported bits: Operation not
> supported
> 
> The related lines in function flow_verbs_translate_item_ipv6() are
> removed as well, since they are redundant.
> 
> Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function")
> Fixes: 84c406e74524 ("net/mlx5: add flow translate function")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
> Acked-by: Matan Azrad <matan@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_flow.c       | 1 -
>  drivers/net/mlx5/mlx5_flow_verbs.c | 3 ---
>  2 files changed, 4 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
> index 16c1ef3..41072da 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -1640,7 +1640,6 @@ uint32_t mlx5_flow_adjust_priority(struct
> rte_eth_dev *dev, int32_t priority,
>  				"\xff\xff\xff\xff\xff\xff\xff\xff",
>  			.vtc_flow = RTE_BE32(0xffffffff),
>  			.proto = 0xff,
> -			.hop_limits = 0xff,
>  		},
>  	};
>  	const int tunnel = !!(item_flags & MLX5_FLOW_LAYER_TUNNEL);
> diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c
> b/drivers/net/mlx5/mlx5_flow_verbs.c
> index 04845f8..459e7b6 100644
> --- a/drivers/net/mlx5/mlx5_flow_verbs.c
> +++ b/drivers/net/mlx5/mlx5_flow_verbs.c
> @@ -494,14 +494,12 @@
>  		ipv6.val.traffic_class = (vtc_flow_val &
> RTE_IPV6_HDR_TC_MASK) >>
>  					 RTE_IPV6_HDR_TC_SHIFT;
>  		ipv6.val.next_hdr = spec->hdr.proto;
> -		ipv6.val.hop_limit = spec->hdr.hop_limits;
>  		ipv6.mask.flow_label =
>  			rte_cpu_to_be_32((vtc_flow_mask &
> RTE_IPV6_HDR_FL_MASK) >>
>  					 RTE_IPV6_HDR_FL_SHIFT);
>  		ipv6.mask.traffic_class = (vtc_flow_mask &
> RTE_IPV6_HDR_TC_MASK) >>
>  					  RTE_IPV6_HDR_TC_SHIFT;
>  		ipv6.mask.next_hdr = mask->hdr.proto;
> -		ipv6.mask.hop_limit = mask->hdr.hop_limits;
>  		/* Remove unwanted bits from values. */
>  		for (i = 0; i < RTE_DIM(ipv6.val.src_ip); ++i) {
>  			ipv6.val.src_ip[i] &= ipv6.mask.src_ip[i];
> @@ -510,7 +508,6 @@
>  		ipv6.val.flow_label &= ipv6.mask.flow_label;
>  		ipv6.val.traffic_class &= ipv6.mask.traffic_class;
>  		ipv6.val.next_hdr &= ipv6.mask.next_hdr;
> -		ipv6.val.hop_limit &= ipv6.mask.hop_limit;
>  	}
>  	flow_verbs_spec_add(&dev_flow->verbs, &ipv6, size);
>  }
> --
> 1.8.3.1



Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

      reply	other threads:[~2020-03-08 11:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-03 12:37 Dekel Peled
2020-03-08 11:33 ` Raslan Darawsheh [this message]

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=AM0PR05MB67072D5FE4D2F2968DF1A553C2E10@AM0PR05MB6707.eurprd05.prod.outlook.com \
    --to=rasland@mellanox.com \
    --cc=dekelp@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=stable@dpdk.org \
    --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).