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 42CBAA0555 for ; Wed, 19 Feb 2020 16:57:44 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3566F1B951; Wed, 19 Feb 2020 16:57:44 +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 6A5B11B951 for ; Wed, 19 Feb 2020 16:57:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582127861; 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=xg6Tc5NrEFI1XmjC8D10/95d8WyYbrEzRLPyfVvr6o8=; b=ZAzBk76Rpl5ocMpTYxL/Yj9tlqtUGhodqYYxJgb0Q9CYciw7GS4I1NCcI4XaJxXjLe4AXa ww6xZ1H6s6+t4pf5Uz27EvBEt5eZiZZ1iwj9lNHUs2bZ0TDNF0aiSsnYZtW+JBV3U9TgTK LhoD/SKmSjgLp0njrnAnMQ/Fm6rL4Sk= 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-269-YLu_jDUAPqmmcod6Yar2vg-1; Wed, 19 Feb 2020 10:57:34 -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 C8DCF18FE862; Wed, 19 Feb 2020 15:57:33 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id B50D0811F8; Wed, 19 Feb 2020 15:57:30 +0000 (UTC) From: Kevin Traynor To: Dekel Peled Cc: Matan Azrad , dpdk stable Date: Wed, 19 Feb 2020 15:56:00 +0000 Message-Id: <20200219155607.20495-15-ktraynor@redhat.com> In-Reply-To: <20200219155607.20495-1-ktraynor@redhat.com> References: <20200219155607.20495-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: YLu_jDUAPqmmcod6Yar2vg-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 VLAN match for DV mode' 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/25/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/3d79e4f2d563857344= a06385ccfae412076d0704 Thanks. Kevin. --- >From 3d79e4f2d563857344a06385ccfae412076d0704 Mon Sep 17 00:00:00 2001 From: Dekel Peled Date: Tue, 11 Feb 2020 13:05:11 +0200 Subject: [PATCH] net/mlx5: fix VLAN match for DV mode [ upstream commit 00f75a40576b28aa5633d2cadd86f23c30c7d220 ] Currently MLX5 PMD can't match on untagged packets specifically. Tagged traffic still hits the flows intended for untagged packets. If the flow has ETH, it will catch all matching packets, tagged and untagged. The solution is to use cvlan_tag bit. If mask=3D1 and value=3D0 it matches on untagged traffic. If mask=3D1 and value=3D1 it matches on tagged traffic. This is the kernel implementation. This patch updated MLX5 PMD to set cvlan_tag mask and value according to flow rule contents. This update is relevant when using DV flow engine (dv_flow_en=3D1). See example at https://doc.dpdk.org/guides/nics/mlx5.html#limitations. Fixes: fc2c498ccb94 ("net/mlx5: add Direct Verbs translate items") Signed-off-by: Dekel Peled Acked-by: Matan Azrad --- doc/guides/nics/mlx5.rst | 9 +++------ drivers/net/mlx5/mlx5_flow_dv.c | 11 +++++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst index 6acbbca6e0..e566f44189 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -93,5 +93,6 @@ Limitations different virtual address in secondary process, unexpected error may h= appen. =20 -- Flow pattern without any specific vlan will match for vlan packets as we= ll: +- When using Verbs flow engine (``dv_flow_en`` =3D 0), flow pattern withou= t any + specific VLAN will match for VLAN packets as well: =20 When VLAN spec is not specified in the pattern, the matching rule will b= e created with VLAN as a wild card. @@ -100,12 +101,8 @@ Limitations flow create 0 ingress pattern eth / vlan vid is 3 / ipv4 / end ... =20 - Will only match vlan packets with vid=3D3. and the flow rules:: + Will only match vlan packets with vid=3D3. and the flow rule:: =20 flow create 0 ingress pattern eth / ipv4 / end ... =20 - Or:: - - flow create 0 ingress pattern eth / vlan / ipv4 / end ... - Will match any ipv4 packet (VLAN included). =20 diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_d= v.c index 04c0a5813b..a6c9137079 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -1189,4 +1189,13 @@ flow_dv_translate_item_eth(void *matcher, void *key, =09l24_v =3D MLX5_ADDR_OF(fte_match_set_lyr_2_4, headers_v, ethertype); =09*(uint16_t *)(l24_v) =3D eth_m->type & eth_v->type; +=09if (eth_v->type) { +=09=09/* When ethertype is present set mask for tagged VLAN. */ +=09=09MLX5_SET(fte_match_set_lyr_2_4, headers_m, cvlan_tag, 1); +=09=09/* Set value for tagged VLAN if ethertype is 802.1Q. */ +=09=09if (eth_v->type =3D=3D RTE_BE16(ETHER_TYPE_VLAN) || +=09=09 eth_v->type =3D=3D RTE_BE16(ETHER_TYPE_QINQ)) +=09=09=09MLX5_SET(fte_match_set_lyr_2_4, headers_v, cvlan_tag, +=09=09=09=09 1); +=09} } =20 @@ -1315,4 +1324,5 @@ flow_dv_translate_item_ipv4(void *matcher, void *key, =09MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol, =09=09 ipv4_v->hdr.next_proto_id & ipv4_m->hdr.next_proto_id); +=09MLX5_SET(fte_match_set_lyr_2_4, headers_m, cvlan_tag, 1); } =20 @@ -1414,4 +1424,5 @@ flow_dv_translate_item_ipv6(void *matcher, void *key, =09MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol, =09=09 ipv6_v->hdr.proto & ipv6_m->hdr.proto); +=09MLX5_SET(fte_match_set_lyr_2_4, headers_m, cvlan_tag, 1); } =20 --=20 2.21.1 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092020-02-19 15:43:50.504928425 +0000 +++ 0015-net-mlx5-fix-VLAN-match-for-DV-mode.patch=092020-02-19 15:43:49.75= 1141587 +0000 @@ -1 +1 @@ -From 00f75a40576b28aa5633d2cadd86f23c30c7d220 Mon Sep 17 00:00:00 2001 +From 3d79e4f2d563857344a06385ccfae412076d0704 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 00f75a40576b28aa5633d2cadd86f23c30c7d220 ] + @@ -22 +23,0 @@ -Cc: stable@dpdk.org @@ -27,4 +28,3 @@ - doc/guides/nics/mlx5.rst | 9 +++------ - doc/guides/rel_notes/release_20_02.rst | 1 + - drivers/net/mlx5/mlx5_flow_dv.c | 11 +++++++++++ - 3 files changed, 15 insertions(+), 6 deletions(-) + doc/guides/nics/mlx5.rst | 9 +++------ + drivers/net/mlx5/mlx5_flow_dv.c | 11 +++++++++++ + 2 files changed, 14 insertions(+), 6 deletions(-) @@ -33 +33 @@ -index 2411fb3461..2ea4fa9546 100644 +index 6acbbca6e0..e566f44189 100644 @@ -36 +36 @@ -@@ -111,5 +111,6 @@ Limitations +@@ -93,5 +93,6 @@ Limitations @@ -44 +44 @@ -@@ -118,12 +119,8 @@ Limitations +@@ -100,12 +101,8 @@ Limitations @@ -58,10 +57,0 @@ -diff --git a/doc/guides/rel_notes/release_20_02.rst b/doc/guides/rel_notes= /release_20_02.rst -index 2d28a04ab6..3c7b5d71c0 100644 ---- a/doc/guides/rel_notes/release_20_02.rst -+++ b/doc/guides/rel_notes/release_20_02.rst -@@ -119,4 +119,5 @@ New Features - * Added support for RSS using L3/L4 source/destination only. - * Added support for matching on GTP tunnel header item. -+ * Removed limitation of matching on tagged/untagged packets (when using= DV flow engine). -=20 - * **Add new vDPA PMD based on Mellanox devices** @@ -69 +59 @@ -index d88daeccbc..a9bb0b4f10 100644 +index 04c0a5813b..a6c9137079 100644 @@ -72 +62 @@ -@@ -5217,4 +5217,13 @@ flow_dv_translate_item_eth(void *matcher, void *key= , +@@ -1189,4 +1189,13 @@ flow_dv_translate_item_eth(void *matcher, void *key= , @@ -79,2 +69,2 @@ -+=09=09if (eth_v->type =3D=3D RTE_BE16(RTE_ETHER_TYPE_VLAN) || -+=09=09 eth_v->type =3D=3D RTE_BE16(RTE_ETHER_TYPE_QINQ)) ++=09=09if (eth_v->type =3D=3D RTE_BE16(ETHER_TYPE_VLAN) || ++=09=09 eth_v->type =3D=3D RTE_BE16(ETHER_TYPE_QINQ)) @@ -86 +76 @@ -@@ -5357,4 +5366,5 @@ flow_dv_translate_item_ipv4(void *matcher, void *key= , +@@ -1315,4 +1324,5 @@ flow_dv_translate_item_ipv4(void *matcher, void *key= , @@ -92 +82 @@ -@@ -5461,4 +5471,5 @@ flow_dv_translate_item_ipv6(void *matcher, void *key= , +@@ -1414,4 +1424,5 @@ flow_dv_translate_item_ipv6(void *matcher, void *key= ,