patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Raslan Darawsheh <rasland@mellanox.com>
To: Raslan Darawsheh <rasland@mellanox.com>,
	Slava Ovsiienko <viacheslavo@mellanox.com>,
	Matan Azrad <matan@mellanox.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Ori Kam <orika@mellanox.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH v4] net/mlx5: fix matching for UDP tunnels with verbs
Date: Mon, 11 May 2020 11:46:54 +0000	[thread overview]
Message-ID: <AM0PR05MB6707F56C9162BF935E30542BC2A10@AM0PR05MB6707.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <20200506065756.1989-1-rasland@mellanox.com>

Hi,

> -----Original Message-----
> From: Raslan Darawsheh <rasland@mellanox.com>
> Sent: Wednesday, May 6, 2020 9:58 AM
> To: Slava Ovsiienko <viacheslavo@mellanox.com>; Matan Azrad
> <matan@mellanox.com>
> Cc: dev@dpdk.org; Ori Kam <orika@mellanox.com>; stable@dpdk.org
> Subject: [PATCH v4] net/mlx5: fix matching for UDP tunnels with verbs
> 
> When creating flow rule with zero specs it will cause
> matching all UDP packets like following:
>  eth / ipv4 / udp / vxlan / end
> Such rule will match all udp packets.
> 
> This change the behavior to match the dv flow engine
> which will automatically set the match on relative
> outer UDP port if the user didn't specify any.
> 
> Fixes: 84c406e74524 ("net/mlx5: add flow translate function")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
> Acked-by: Matan Azrad <matan@mellanox.com>
> ---
> v2: fixed checkpatch issues
> v3: handled ITEM_VOID after udp item.
> v4: removed extra unnecessary check for NULL
> ---
> 
>  drivers/net/mlx5/mlx5_flow_verbs.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c
> b/drivers/net/mlx5/mlx5_flow_verbs.c
> index 7efd97f54..24d4a7203 100644
> --- a/drivers/net/mlx5/mlx5_flow_verbs.c
> +++ b/drivers/net/mlx5/mlx5_flow_verbs.c
> @@ -680,6 +680,28 @@ flow_verbs_translate_item_udp(struct mlx5_flow
> *dev_flow,
>  		udp.val.src_port &= udp.mask.src_port;
>  		udp.val.dst_port &= udp.mask.dst_port;
>  	}
> +	item++;
> +	while (item->type == RTE_FLOW_ITEM_TYPE_VOID)
> +		item++;
> +	if (!(udp.val.dst_port & udp.mask.dst_port)) {
> +		switch ((item)->type) {
> +		case RTE_FLOW_ITEM_TYPE_VXLAN:
> +			udp.val.dst_port = htons(MLX5_UDP_PORT_VXLAN);
> +			udp.mask.dst_port = 0xffff;
> +			break;
> +		case RTE_FLOW_ITEM_TYPE_VXLAN_GPE:
> +			udp.val.dst_port =
> htons(MLX5_UDP_PORT_VXLAN_GPE);
> +			udp.mask.dst_port = 0xffff;
> +			break;
> +		case RTE_FLOW_ITEM_TYPE_MPLS:
> +			udp.val.dst_port = htons(MLX5_UDP_PORT_MPLS);
> +			udp.mask.dst_port = 0xffff;
> +			break;
> +		default:
> +			break;
> +		}
> +	}
> +
>  	flow_verbs_spec_add(&dev_flow->verbs, &udp, size);
>  }
> 
> --
> 2.26.0


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

  reply	other threads:[~2020-05-11 11:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05  9:42 [dpdk-stable] [PATCH] " Raslan Darawsheh
2020-05-05  9:45 ` [dpdk-stable] [PATCH v2] " Raslan Darawsheh
2020-05-06  6:48   ` [dpdk-stable] [PATCH v3] " Raslan Darawsheh
2020-05-06  6:57   ` [dpdk-stable] [PATCH v4] " Raslan Darawsheh
2020-05-11 11:46     ` Raslan Darawsheh [this message]
2020-05-05 11:37 ` [dpdk-stable] [PATCH] " Slava Ovsiienko

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