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 70F30A04F5 for ; Wed, 11 Dec 2019 22:28:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 641B62C6A; Wed, 11 Dec 2019 22:28:05 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 4C900374C for ; Wed, 11 Dec 2019 22:28:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576099682; 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=byp7L+ppdUbgA1wBolcV4toXr24B0u6dPW3KCOr4srI=; b=YVJ7LNS07tbIuQjO6bQEPG6TW/5QjDz57OJKg2tY7J0MtDfgDwSglRgHooQDuN0r+u0hhX aIIQX8gmTDN0C9ADT/noCBiZVGBgKtSiwfKl/LNlXkfLUqwMYIpywEAufKheXA1nEPXrEm osLPqFZgQ7mpskoSB563rPwFcUjtw44= 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-368-cdbfxUxvNOGA1FQiQ666Kw-1; Wed, 11 Dec 2019 16:27:59 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5E9B8800D41; Wed, 11 Dec 2019 21:27:58 +0000 (UTC) Received: from rh.redhat.com (ovpn-116-64.ams2.redhat.com [10.36.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1FEA010016DA; Wed, 11 Dec 2019 21:27:56 +0000 (UTC) From: Kevin Traynor To: Matan Azrad Cc: Xiaoyu Min , Ori Kam , dpdk stable Date: Wed, 11 Dec 2019 21:26:08 +0000 Message-Id: <20191211212702.27851-16-ktraynor@redhat.com> In-Reply-To: <20191211212702.27851-1-ktraynor@redhat.com> References: <20191211212702.27851-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: cdbfxUxvNOGA1FQiQ666Kw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'ethdev: fix last item detection on RSS flow expand' has been queued to LTS release 18.11.6 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.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/17/19. 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/97a8a6723d88bdb4ff= 221f40d7391c7a32625bd3 Thanks. Kevin. --- >From 97a8a6723d88bdb4ff221f40d7391c7a32625bd3 Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Mon, 11 Nov 2019 10:42:05 +0000 Subject: [PATCH] ethdev: fix last item detection on RSS flow expand [ upstream commit eccc5d3237fc549ba647654a7f74f8b9e9dcaf6d ] There is a rte_flow API which expands a RSS flow pattern to multiple patterns according to the RSS hash types in the RSS action configuration. As part of the expansion, detection of the last item of the flow uses the "next proto" field of the last configured item in the pattern list. Wrongly, the mask of this field was not considered in order to validate the field. Ignore "next proto" fields when their corresponded masks invalidate them. Fixes: fc2dd8dd492f ("ethdev: fix expand RSS flows") Signed-off-by: Matan Azrad Acked-by: Xiaoyu Min Acked-by: Ori Kam --- lib/librte_ethdev/rte_flow.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c index 5725aceda..7bfc06db7 100644 --- a/lib/librte_ethdev/rte_flow.c +++ b/lib/librte_ethdev/rte_flow.c @@ -163,5 +163,7 @@ rte_flow_expand_rss_item_complete(const struct rte_flow= _item *item) =09enum rte_flow_item_type ret =3D RTE_FLOW_ITEM_TYPE_VOID; =09uint16_t ether_type =3D 0; +=09uint16_t ether_type_m; =09uint8_t ip_next_proto =3D 0; +=09uint8_t ip_next_proto_m; =20 =09if (item =3D=3D NULL || item->spec =3D=3D NULL) @@ -169,4 +171,11 @@ rte_flow_expand_rss_item_complete(const struct rte_flo= w_item *item) =09switch (item->type) { =09case RTE_FLOW_ITEM_TYPE_ETH: +=09=09if (item->mask) +=09=09=09ether_type_m =3D ((const struct rte_flow_item_eth *) +=09=09=09=09=09=09(item->mask))->type; +=09=09else +=09=09=09ether_type_m =3D rte_flow_item_eth_mask.type; +=09=09if (ether_type_m !=3D RTE_BE16(0xFFFF)) +=09=09=09break; =09=09ether_type =3D ((const struct rte_flow_item_eth *) =09=09=09=09(item->spec))->type; @@ -179,4 +188,11 @@ rte_flow_expand_rss_item_complete(const struct rte_flo= w_item *item) =09=09break; =09case RTE_FLOW_ITEM_TYPE_VLAN: +=09=09if (item->mask) +=09=09=09ether_type_m =3D ((const struct rte_flow_item_vlan *) +=09=09=09=09=09=09(item->mask))->inner_type; +=09=09else +=09=09=09ether_type_m =3D rte_flow_item_vlan_mask.inner_type; +=09=09if (ether_type_m !=3D RTE_BE16(0xFFFF)) +=09=09=09break; =09=09ether_type =3D ((const struct rte_flow_item_vlan *) =09=09=09=09(item->spec))->inner_type; @@ -189,4 +205,12 @@ rte_flow_expand_rss_item_complete(const struct rte_flo= w_item *item) =09=09break; =09case RTE_FLOW_ITEM_TYPE_IPV4: +=09=09if (item->mask) +=09=09=09ip_next_proto_m =3D ((const struct rte_flow_item_ipv4 *) +=09=09=09=09=09(item->mask))->hdr.next_proto_id; +=09=09else +=09=09=09ip_next_proto_m =3D +=09=09=09=09rte_flow_item_ipv4_mask.hdr.next_proto_id; +=09=09if (ip_next_proto_m !=3D 0xFF) +=09=09=09break; =09=09ip_next_proto =3D ((const struct rte_flow_item_ipv4 *) =09=09=09=09(item->spec))->hdr.next_proto_id; @@ -201,4 +225,12 @@ rte_flow_expand_rss_item_complete(const struct rte_flo= w_item *item) =09=09break; =09case RTE_FLOW_ITEM_TYPE_IPV6: +=09=09if (item->mask) +=09=09=09ip_next_proto_m =3D ((const struct rte_flow_item_ipv6 *) +=09=09=09=09=09=09(item->mask))->hdr.proto; +=09=09else +=09=09=09ip_next_proto_m =3D +=09=09=09=09rte_flow_item_ipv6_mask.hdr.proto; +=09=09if (ip_next_proto_m !=3D 0xFF) +=09=09=09break; =09=09ip_next_proto =3D ((const struct rte_flow_item_ipv6 *) =09=09=09=09(item->spec))->hdr.proto; --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-11 21:24:14.047572816 +0000 +++ 0016-ethdev-fix-last-item-detection-on-RSS-flow-expand.patch=092019-12-= 11 21:24:12.599652623 +0000 @@ -1 +1 @@ -From eccc5d3237fc549ba647654a7f74f8b9e9dcaf6d Mon Sep 17 00:00:00 2001 +From 97a8a6723d88bdb4ff221f40d7391c7a32625bd3 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit eccc5d3237fc549ba647654a7f74f8b9e9dcaf6d ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -28 +29 @@ -index 8ec9c90cd..d7f29e532 100644 +index 5725aceda..7bfc06db7 100644 @@ -31 +32 @@ -@@ -219,5 +219,7 @@ rte_flow_expand_rss_item_complete(const struct rte_flo= w_item *item) +@@ -163,5 +163,7 @@ rte_flow_expand_rss_item_complete(const struct rte_flo= w_item *item) @@ -39 +40 @@ -@@ -225,4 +227,11 @@ rte_flow_expand_rss_item_complete(const struct rte_fl= ow_item *item) +@@ -169,4 +171,11 @@ rte_flow_expand_rss_item_complete(const struct rte_fl= ow_item *item) @@ -51 +52 @@ -@@ -235,4 +244,11 @@ rte_flow_expand_rss_item_complete(const struct rte_fl= ow_item *item) +@@ -179,4 +188,11 @@ rte_flow_expand_rss_item_complete(const struct rte_fl= ow_item *item) @@ -63 +64 @@ -@@ -245,4 +261,12 @@ rte_flow_expand_rss_item_complete(const struct rte_fl= ow_item *item) +@@ -189,4 +205,12 @@ rte_flow_expand_rss_item_complete(const struct rte_fl= ow_item *item) @@ -76 +77 @@ -@@ -257,4 +281,12 @@ rte_flow_expand_rss_item_complete(const struct rte_fl= ow_item *item) +@@ -201,4 +225,12 @@ rte_flow_expand_rss_item_complete(const struct rte_fl= ow_item *item)