From: Adrien Mazarguil Date: Tue, 10 Jan 2017 13:08:28 +0000 (+0100) Subject: ethdev: clarify MARK and FLAG actions in flow API X-Git-Tag: spdx-start~5195 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ebaa064e2c590673581d25277636c633792f1bf9;p=dpdk.git ethdev: clarify MARK and FLAG actions in flow API Both actions share the PKT_RX_FDIR mbuf flag, as a result there is no way to tell them apart. Moreover, the maximum allowed value for the MARK action may not necessarily cover the entire 32-bit space. Signed-off-by: Adrien Mazarguil --- diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index f415a73ded..a6acbbf39e 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -1049,31 +1049,31 @@ flow rules: Action: ``MARK`` ^^^^^^^^^^^^^^^^ -Attaches a 32 bit value to packets. +Attaches an integer value to packets and sets ``PKT_RX_FDIR`` and +``PKT_RX_FDIR_ID`` mbuf flags. -This value is arbitrary and application-defined. For compatibility with FDIR -it is returned in the ``hash.fdir.hi`` mbuf field. ``PKT_RX_FDIR_ID`` is -also set in ``ol_flags``. +This value is arbitrary and application-defined. Maximum allowed value +depends on the underlying implementation. It is returned in the +``hash.fdir.hi`` mbuf field. .. _table_rte_flow_action_mark: .. table:: MARK - +--------+-------------------------------------+ - | Field | Value | - +========+=====================================+ - | ``id`` | 32 bit value to return with packets | - +--------+-------------------------------------+ + +--------+--------------------------------------+ + | Field | Value | + +========+======================================+ + | ``id`` | integer value to return with packets | + +--------+--------------------------------------+ Action: ``FLAG`` ^^^^^^^^^^^^^^^^ -Flag packets. Similar to `Action: MARK`_ but only affects ``ol_flags``. +Flags packets. Similar to `Action: MARK`_ without a specific value; only +sets the ``PKT_RX_FDIR`` mbuf flag. - No configurable properties. -Note: a distinctive flag must be defined for it. - .. _table_rte_flow_action_flag: .. table:: FLAG diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h index 98084ac72d..c2b9fc5dbb 100644 --- a/lib/librte_ether/rte_flow.h +++ b/lib/librte_ether/rte_flow.h @@ -556,7 +556,8 @@ enum rte_flow_action_type { /** * [META] * - * Attaches a 32 bit value to packets. + * Attaches an integer value to packets and sets PKT_RX_FDIR and + * PKT_RX_FDIR_ID mbuf flags. * * See struct rte_flow_action_mark. */ @@ -565,9 +566,8 @@ enum rte_flow_action_type { /** * [META] * - * Flag packets. Similar to MARK but only affects ol_flags. - * - * Note: a distinctive flag must be defined for it. + * Flags packets. Similar to MARK without a specific value; only + * sets the PKT_RX_FDIR mbuf flag. * * No associated configuration structure. */ @@ -640,14 +640,15 @@ enum rte_flow_action_type { /** * RTE_FLOW_ACTION_TYPE_MARK * - * Attaches a 32 bit value to packets. + * Attaches an integer value to packets and sets PKT_RX_FDIR and + * PKT_RX_FDIR_ID mbuf flags. * - * This value is arbitrary and application-defined. For compatibility with - * FDIR it is returned in the hash.fdir.hi mbuf field. PKT_RX_FDIR_ID is - * also set in ol_flags. + * This value is arbitrary and application-defined. Maximum allowed value + * depends on the underlying implementation. It is returned in the + * hash.fdir.hi mbuf field. */ struct rte_flow_action_mark { - uint32_t id; /**< 32 bit value to return with packets. */ + uint32_t id; /**< Integer value to return with packets. */ }; /**