From patchwork Thu Jul 6 03:46:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zhang X-Patchwork-Id: 26531 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id C82961C0B; Thu, 6 Jul 2017 12:53:42 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 2670A1094 for ; Thu, 6 Jul 2017 12:53:40 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP; 06 Jul 2017 03:53:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,316,1496127600"; d="scan'208";a="121573728" Received: from dpdk777.sh.intel.com ([10.67.111.90]) by orsmga005.jf.intel.com with ESMTP; 06 Jul 2017 03:53:38 -0700 From: Qi Zhang To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Qi Zhang Date: Wed, 5 Jul 2017 23:46:32 -0400 Message-Id: <1499312792-3963-1-git-send-email-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] ethdev: fix document for fuzzy match X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fix couple document issues for fuzzy match. Fixes: a3a2e2c8f7de ("ethdev: add fuzzy match in flow API") Signed-off-by: Qi Zhang --- doc/guides/prog_guide/rte_flow.rst | 13 ++++++++----- lib/librte_ether/rte_flow.h | 5 ++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 1b44f50..5063d58 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -898,7 +898,7 @@ Matches a MPLS header. - Default ``mask`` matches label only. Item: ``GRE`` -^^^^^^^^^^^^^^ +^^^^^^^^^^^^^ Matches a GRE header. @@ -907,7 +907,7 @@ Matches a GRE header. - Default ``mask`` matches protocol only. Item: ``FUZZY`` -^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^ Fuzzy pattern match, expect faster than default. @@ -918,19 +918,22 @@ value, but it is possible two different patterns have the same hash value. Matching accuracy level can be configured by threshold. Driver can divide the range of threshold and map to different accuracy levels that device support. +Threshold 0 means perfect match(no fuzziness), while threshold 0xffffffff +means fuzziest match. + .. _table_rte_flow_item_fuzzy: .. table:: FUZZY +----------+---------------+--------------------------------------------------+ | Field | Subfield | Value | - +==========+===========+======================================================+ + +==========+===============+==================================================+ | ``spec`` | ``threshold`` | 0 as perfect match, 0xffffffff as fuzziest match | +----------+---------------+--------------------------------------------------+ | ``last`` | ``threshold`` | upper range value | - +----------+-----------+------------------------------------------------------+ + +----------+---------------+--------------------------------------------------+ | ``mask`` | ``threshold`` | bit-mask apply to "spec" and "last" | - +----------+-----------+------------------------------------------------------+ + +----------+---------------+--------------------------------------------------+ Usage example, fuzzy match a TCPv4 packets: diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h index cfbed30..f92f3c3 100644 --- a/lib/librte_ether/rte_flow.h +++ b/lib/librte_ether/rte_flow.h @@ -719,9 +719,12 @@ static const struct rte_flow_item_gre rte_flow_item_gre_mask = { * Matching accuracy level can be configure by threshold. * Driver can divide the range of threshold and map to different * accuracy levels that device support. + * + * Threshold 0 means perfect match(no fuzziness), while threshold + * 0xffffffff means fuzziest match. */ struct rte_flow_item_fuzzy { - uint32_t thresh; /**< Accuracy threshold*/ + uint32_t thresh; /**< Accuracy threshold. */ }; /** Default mask for RTE_FLOW_ITEM_TYPE_FUZZY. */