From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 5F9A4A0096 for ; Wed, 10 Apr 2019 18:45:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 53B7F1B105; Wed, 10 Apr 2019 18:45:59 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 2C7641B105 for ; Wed, 10 Apr 2019 18:45:58 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 927BF30BC665; Wed, 10 Apr 2019 16:45:57 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-94.ams2.redhat.com [10.36.117.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 589BA5D961; Wed, 10 Apr 2019 16:45:56 +0000 (UTC) From: Kevin Traynor To: Hyong Youb Kim Cc: John Daley , dpdk stable Date: Wed, 10 Apr 2019 17:44:03 +0100 Message-Id: <20190410164411.10546-55-ktraynor@redhat.com> In-Reply-To: <20190410164411.10546-1-ktraynor@redhat.com> References: <20190410164411.10546-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 10 Apr 2019 16:45:57 +0000 (UTC) Subject: [dpdk-stable] patch 'net/enic: allow flow mark ID 0' has been queued to LTS release 18.11.2 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.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/16/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 rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Kevin Traynor --- >From 8403c0848e8058657c5ce63a9090200d2748b43c Mon Sep 17 00:00:00 2001 From: Hyong Youb Kim Date: Sat, 2 Mar 2019 02:42:42 -0800 Subject: [PATCH] net/enic: allow flow mark ID 0 [ upstream commit e7347a8aff483f22c75491ca1d59e1f822318500 ] The driver currently accepts mark ID 0 but does not report it in matching packet's mbuf. For example, the following testpmd command succeeds. But, the mbuf of a matching IPv4 UDP packet does not have PKT_RX_FDIR_ID set. flow create 0 ingress pattern ... actions mark id 0 / queue index 0 / end The problem has to do with mapping mark IDs (32-bit) to NIC filter IDs. Filter ID is currently 16-bit, so values greater than 0xffff are rejected. The firmware reserves filter ID 0 for filters that do not mark (e.g. steer w/o mark). And, the driver reserves 0xffff for the flag action. This leaves 1...0xfffe for app use. It is possible to simply reject mark ID 0 as unsupported. But, 0 is commonly used (e.g. OVS-DPDK and VPP). So, when adding a filter, set filter ID = mark ID + 1 to support mark ID 0. The receive handler subtracts 1 from filter ID to get back the original mark ID. Fixes: dfbd6a9cb504 ("net/enic: extend flow director support for 1300 series") Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- doc/guides/nics/enic.rst | 1 + drivers/net/enic/enic_flow.c | 15 +++++++++++---- drivers/net/enic/enic_rxtx_common.h | 3 ++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/doc/guides/nics/enic.rst b/doc/guides/nics/enic.rst index bc38f51aa..e456e6c2d 100644 --- a/doc/guides/nics/enic.rst +++ b/doc/guides/nics/enic.rst @@ -451,4 +451,5 @@ PKT_RX_VLAN_STRIPPED mbuf flags would not be set. This mode is enabled with the were added. Since there currently is no grouping or priority support, 'catch-all' filters should be added last. + - The supported range of IDs for the 'MARK' action is 0 - 0xFFFD. - **Statistics** diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c index 55d8d50a1..e12a6ec73 100644 --- a/drivers/net/enic/enic_flow.c +++ b/drivers/net/enic/enic_flow.c @@ -1082,10 +1082,16 @@ enic_copy_action_v2(const struct rte_flow_action actions[], return ENOTSUP; overlap |= MARK; - /* ENIC_MAGIC_FILTER_ID is reserved and is the highest - * in the range of allows mark ids. + /* + * Map mark ID (32-bit) to filter ID (16-bit): + * - Reject values > 16 bits + * - Filter ID 0 is reserved for filters that steer + * but not mark. So add 1 to the mark ID to avoid + * using 0. + * - Filter ID (ENIC_MAGIC_FILTER_ID = 0xffff) is + * reserved for the "flag" action below. */ - if (mark->id >= ENIC_MAGIC_FILTER_ID) + if (mark->id >= ENIC_MAGIC_FILTER_ID - 1) return EINVAL; - enic_action->filter_id = mark->id; + enic_action->filter_id = mark->id + 1; enic_action->flags |= FILTER_ACTION_FILTER_ID_FLAG; break; @@ -1095,4 +1101,5 @@ enic_copy_action_v2(const struct rte_flow_action actions[], return ENOTSUP; overlap |= MARK; + /* ENIC_MAGIC_FILTER_ID is reserved for flagging */ enic_action->filter_id = ENIC_MAGIC_FILTER_ID; enic_action->flags |= FILTER_ACTION_FILTER_ID_FLAG; diff --git a/drivers/net/enic/enic_rxtx_common.h b/drivers/net/enic/enic_rxtx_common.h index bfbb4909e..66f631dfe 100644 --- a/drivers/net/enic/enic_rxtx_common.h +++ b/drivers/net/enic/enic_rxtx_common.h @@ -227,5 +227,6 @@ enic_cq_rx_to_pkt_flags(struct cq_desc *cqd, struct rte_mbuf *mbuf) pkt_flags |= PKT_RX_FDIR; if (filter_id != ENIC_MAGIC_FILTER_ID) { - mbuf->hash.fdir.hi = clsf_cqd->filter_id; + /* filter_id = mark id + 1, so subtract 1 */ + mbuf->hash.fdir.hi = filter_id - 1; pkt_flags |= PKT_RX_FDIR_ID; } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-04-10 14:06:12.090386556 +0100 +++ 0055-net-enic-allow-flow-mark-ID-0.patch 2019-04-10 14:06:08.009290924 +0100 @@ -1,8 +1,10 @@ -From e7347a8aff483f22c75491ca1d59e1f822318500 Mon Sep 17 00:00:00 2001 +From 8403c0848e8058657c5ce63a9090200d2748b43c Mon Sep 17 00:00:00 2001 From: Hyong Youb Kim Date: Sat, 2 Mar 2019 02:42:42 -0800 Subject: [PATCH] net/enic: allow flow mark ID 0 +[ upstream commit e7347a8aff483f22c75491ca1d59e1f822318500 ] + The driver currently accepts mark ID 0 but does not report it in matching packet's mbuf. For example, the following testpmd command succeeds. But, the mbuf of a matching IPv4 UDP packet does not have @@ -22,7 +24,6 @@ subtracts 1 from filter ID to get back the original mark ID. Fixes: dfbd6a9cb504 ("net/enic: extend flow director support for 1300 series") -Cc: stable@dpdk.org Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley