From: Qi Zhang Date: Thu, 6 Jul 2017 06:32:19 +0000 (-0400) Subject: ethdev: fix documentation for fuzzy match X-Git-Tag: spdx-start~2575 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=92f4bf03964dadb07012d4a7acf00c5e83d39197;p=dpdk.git ethdev: fix documentation for fuzzy match Fix document for fuzzy match and GRE Fixes: a3a2e2c8f7de ("ethdev: add fuzzy match in flow API") Fixes: 7cd048321d1d ("ethdev: add MPLS and GRE flow API items") Signed-off-by: Qi Zhang Acked-by: Adrien Mazarguil --- diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 1b44f50eb7..662a9123bd 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 6ac7cdb3c0..bba6169f00 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. */