From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A1178A054C for ; Fri, 14 Feb 2020 18:05:23 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 988FFF72; Fri, 14 Feb 2020 18:05:23 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 791061DB9 for ; Fri, 14 Feb 2020 18:05:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581699921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t3Tk/2fpkLstLakcQ8ySxmQah9OayJSP9y+QjsbXNDs=; b=HCzPOsUsez+N9TaYY10Rg9qrlvMkl7NpOIiSHACp8xzAh4L9tosJW6OfEg8N3CyaSxFFhe R/uC0gs+yDfBcmE+GkjXefdlqPuIIJo3lw7lUdCuTV2AFNaDnD0YyCYV58y+n3bw1ycTh3 z+SQj7Nc8drNtc3cXq3FAuw9VkWswbY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-377--jhm5u-CNc6fXTVtK85M-Q-1; Fri, 14 Feb 2020 12:05:17 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A2EF1DB21; Fri, 14 Feb 2020 17:05:16 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB98E84BCD; Fri, 14 Feb 2020 17:05:14 +0000 (UTC) From: Kevin Traynor To: Raslan Darawsheh Cc: Matan Azrad , dpdk stable Date: Fri, 14 Feb 2020 17:03:19 +0000 Message-Id: <20200214170337.25093-25-ktraynor@redhat.com> In-Reply-To: <20200214170337.25093-1-ktraynor@redhat.com> References: <20200214170337.25093-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: -jhm5u-CNc6fXTVtK85M-Q-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/mlx5: fix VXLAN-GPE item translation' has been queued to LTS release 18.11.7 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/20/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasi= ng (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/681c0e0487c48ba811= da3c936eb69fe6956b37f0 Thanks. Kevin. --- >From 681c0e0487c48ba811da3c936eb69fe6956b37f0 Mon Sep 17 00:00:00 2001 From: Raslan Darawsheh Date: Mon, 27 Jan 2020 17:34:12 +0200 Subject: [PATCH] net/mlx5: fix VXLAN-GPE item translation [ upstream commit 90456726eb801df50b98803678427ec8881ff0af ] Currently, when using VXLAN-GPE or VXLAN item in the flow both are being treated the same with flags 0x8 in VXLAN header. Which mean the matching of the item VXLAN-GPE will match any VXLAN packet. This fixes the translation of VXLAN GPE item into PMD flow item. Which will by default set the flags to VXLAN-GPE to be 0xc. Fixes: 3d69434113d1 ("net/mlx5: add Direct Verbs validation function") Signed-off-by: Raslan Darawsheh Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow_dv.c | 75 ++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_d= v.c index b854e66dcb..04c0a5813b 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -1652,4 +1652,74 @@ flow_dv_translate_item_vxlan(void *matcher, void *ke= y, } =20 +/** + * Add VXLAN-GPE item to matcher and to the value. + * + * @param[in, out] matcher + * Flow matcher. + * @param[in, out] key + * Flow matcher value. + * @param[in] item + * Flow pattern to translate. + * @param[in] inner + * Item is inner pattern. + */ + +static void +flow_dv_translate_item_vxlan_gpe(void *matcher, void *key, +=09=09=09=09 const struct rte_flow_item *item, int inner) +{ +=09const struct rte_flow_item_vxlan_gpe *vxlan_m =3D item->mask; +=09const struct rte_flow_item_vxlan_gpe *vxlan_v =3D item->spec; +=09void *headers_m; +=09void *headers_v; +=09void *misc_m =3D +=09=09MLX5_ADDR_OF(fte_match_param, matcher, misc_parameters_3); +=09void *misc_v =3D +=09=09MLX5_ADDR_OF(fte_match_param, key, misc_parameters_3); +=09char *vni_m; +=09char *vni_v; +=09uint16_t dport; +=09int size; +=09int i; +=09uint8_t flags_m =3D 0xff; +=09uint8_t flags_v =3D 0xc; + +=09if (inner) { +=09=09headers_m =3D MLX5_ADDR_OF(fte_match_param, matcher, +=09=09=09=09=09 inner_headers); +=09=09headers_v =3D MLX5_ADDR_OF(fte_match_param, key, inner_headers); +=09} else { +=09=09headers_m =3D MLX5_ADDR_OF(fte_match_param, matcher, +=09=09=09=09=09 outer_headers); +=09=09headers_v =3D MLX5_ADDR_OF(fte_match_param, key, outer_headers); +=09} +=09dport =3D item->type =3D=3D RTE_FLOW_ITEM_TYPE_VXLAN ? +=09=09MLX5_UDP_PORT_VXLAN : MLX5_UDP_PORT_VXLAN_GPE; +=09if (!MLX5_GET16(fte_match_set_lyr_2_4, headers_v, udp_dport)) { +=09=09MLX5_SET(fte_match_set_lyr_2_4, headers_m, udp_dport, 0xFFFF); +=09=09MLX5_SET(fte_match_set_lyr_2_4, headers_v, udp_dport, dport); +=09} +=09if (!vxlan_v) +=09=09return; +=09if (!vxlan_m) +=09=09vxlan_m =3D &rte_flow_item_vxlan_gpe_mask; +=09size =3D sizeof(vxlan_m->vni); +=09vni_m =3D MLX5_ADDR_OF(fte_match_set_misc3, misc_m, outer_vxlan_gpe_vni= ); +=09vni_v =3D MLX5_ADDR_OF(fte_match_set_misc3, misc_v, outer_vxlan_gpe_vni= ); +=09memcpy(vni_m, vxlan_m->vni, size); +=09for (i =3D 0; i < size; ++i) +=09=09vni_v[i] =3D vni_m[i] & vxlan_v->vni[i]; +=09if (vxlan_m->flags) { +=09=09flags_m =3D vxlan_m->flags; +=09=09flags_v =3D vxlan_v->flags; +=09} +=09MLX5_SET(fte_match_set_misc3, misc_m, outer_vxlan_gpe_flags, flags_m); +=09MLX5_SET(fte_match_set_misc3, misc_v, outer_vxlan_gpe_flags, flags_v); +=09MLX5_SET(fte_match_set_misc3, misc_m, outer_vxlan_gpe_next_protocol, +=09=09 vxlan_m->protocol); +=09MLX5_SET(fte_match_set_misc3, misc_v, outer_vxlan_gpe_next_protocol, +=09=09 vxlan_v->protocol); +} + /** * Add MPLS item to matcher and to the value. @@ -2151,6 +2221,7 @@ flow_dv_translate(struct rte_eth_dev *dev, =09=09=09break; =09=09case RTE_FLOW_ITEM_TYPE_VXLAN_GPE: -=09=09=09flow_dv_translate_item_vxlan(match_mask, match_value, -=09=09=09=09=09=09 items, tunnel); +=09=09=09flow_dv_translate_item_vxlan_gpe(match_mask, +=09=09=09=09=09=09=09 match_value, items, +=09=09=09=09=09=09=09 tunnel); =09=09=09last_item =3D MLX5_FLOW_LAYER_VXLAN_GPE; =09=09=09break; --=20 2.21.1 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092020-02-14 17:02:38.425466352 +0000 +++ 0025-net-mlx5-fix-VXLAN-GPE-item-translation.patch=092020-02-14 17:02:3= 6.991407104 +0000 @@ -1 +1 @@ -From 90456726eb801df50b98803678427ec8881ff0af Mon Sep 17 00:00:00 2001 +From 681c0e0487c48ba811da3c936eb69fe6956b37f0 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 90456726eb801df50b98803678427ec8881ff0af ] + @@ -16 +17,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ -index d51d17d877..2878393b17 100644 +index b854e66dcb..04c0a5813b 100644 @@ -28 +29 @@ -@@ -5779,4 +5779,74 @@ flow_dv_translate_item_vxlan(void *matcher, void *k= ey, +@@ -1652,4 +1652,74 @@ flow_dv_translate_item_vxlan(void *matcher, void *k= ey, @@ -102,2 +103,2 @@ - * Add Geneve item to matcher and to the value. -@@ -7560,6 +7630,7 @@ cnt_err: + * Add MPLS item to matcher and to the value. +@@ -2151,6 +2221,7 @@ flow_dv_translate(struct rte_eth_dev *dev,