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 6A15FA0096 for ; Mon, 3 Jun 2019 23:33:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8D5061B9D1; Mon, 3 Jun 2019 23:32:53 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 602561B9B8 for ; Mon, 3 Jun 2019 23:32:50 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 4 Jun 2019 00:32:46 +0300 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x53LWeDE020818; Tue, 4 Jun 2019 00:32:44 +0300 From: Yongseok Koh To: shahafs@mellanox.com, thomas@monjalon.net, ferruh.yigit@intel.com, arybchenko@solarflare.com, adrien.mazarguil@6wind.com, olivier.matz@6wind.com Cc: dev@dpdk.org Date: Mon, 3 Jun 2019 14:32:30 -0700 Message-Id: <20190603213231.27020-2-yskoh@mellanox.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190603213231.27020-1-yskoh@mellanox.com> References: <20190603213231.27020-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [RFC 2/3] ethdev: add flow modify mark action 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" Mark ID can be modified when supporting multiple tables. Partial bit alteration is supported to preserve some bit-fields set by previous match. Signed-off-by: Yongseok Koh --- doc/guides/prog_guide/rte_flow.rst | 21 +++++++++++++++++++++ lib/librte_ethdev/rte_flow.h | 24 ++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 016cd90e52..2907edfff4 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -1463,6 +1463,27 @@ depends on the underlying implementation. It is returned in the | ``id`` | integer value to return with packets | +--------+--------------------------------------+ +Action: ``MODIFY_MARK`` +^^^^^^^^^^^^^^^^^^^^^^^ + +Alter partial bits of mark ID set by ``MARK`` action. + +``mask`` indicates which bits are modified. For bits which have never been set +by ``MARK`` or ``MODIFY_MARK``, unpredictable value will be seen depending on +driver implementation. + +.. _table_rte_flow_action_modify_mark: + +.. table:: MODIFY_MARK + + +----------+--------------------------------------+ + | Field | Value | + +==========+======================================+ + | ``id`` | integer value to return with packets | + +----------+--------------------------------------+ + | ``mask`` | bit-mask applies to "id" | + +----------+--------------------------------------+ + Action: ``FLAG`` ^^^^^^^^^^^^^^^^ diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index cda8628183..d811f8a06e 100644 --- a/lib/librte_ethdev/rte_flow.h +++ b/lib/librte_ethdev/rte_flow.h @@ -1316,6 +1316,13 @@ enum rte_flow_action_type { */ RTE_FLOW_ACTION_TYPE_MARK, + /** + * Alter partial bits of mark ID set by RTE_FLOW_ACTION_TYPE_MARK. + * + * See struct rte_flow_action_modify_mark. + */ + RTE_FLOW_ACTION_TYPE_MODIFY_MARK, + /** * Flags packets. Similar to MARK without a specific value; only * sets the PKT_RX_FDIR mbuf flag. @@ -1681,6 +1688,23 @@ struct rte_flow_action_mark { uint32_t id; /**< Integer value to return with packets. */ }; +/** + * @warning + * @b EXPERIMENTAL: this structure may change without prior notice + * + * RTE_FLOW_ACTION_TYPE_MODIFY_MARK + * + * Alter partial bits of mark ID set by RTE_FLOW_ACTION_TYPE_MARK. + * + * Provided mask indicates which bits are modified. For bits which have never + * been set by mark action or modify_mark action, unpredictable value will be + * seen depending on driver implementation. + */ +struct rte_flow_action_modify_mark { + uint32_t id; /**< Integer value to return with packets. */ + uint32_t mask; /**< Mask of bits to modify. */ +}; + /** * @warning * @b EXPERIMENTAL: this structure may change without prior notice -- 2.21.0