From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 514A66CCA for ; Wed, 18 Apr 2018 23:13:31 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Apr 2018 14:13:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,466,1517904000"; d="scan'208";a="47271258" Received: from dwdohert-ws.ir.intel.com ([163.33.210.60]) by fmsmga004.fm.intel.com with ESMTP; 18 Apr 2018 14:13:27 -0700 From: Declan Doherty To: dev@dpdk.org Cc: Alex Rosenbaum , Ferruh Yigit , Thomas Monjalon , Shahaf Shuler , Qi Zhang , Alejandro Lucero , Andrew Rybchenko , Mohammad Abdul Awal , Remy Horton , John McNamara , Rony Efraim , Jingjing Wu , Wenzhuo Lu , Vincent Jardin , Yuanhan Liu , Bruce Richardson , Konstantin Ananyev , Zhihong Wang , Declan Doherty Date: Wed, 18 Apr 2018 22:04:19 +0100 Message-Id: <20180418210423.13847-3-declan.doherty@intel.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180418210423.13847-1-declan.doherty@intel.com> References: <1523017443-12414-1-git-send-email-declan.doherty@intel.com> <20180418210423.13847-1-declan.doherty@intel.com> Subject: [dpdk-dev] [PATCH v4 2/6] ethdev: Add jump action type to rte_flow 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: , X-List-Received-Date: Wed, 18 Apr 2018 21:13:31 -0000 Add jump action type which defines an action which allows a matched flow to be redirect to the specified group. This allows physical and logical flow table/group hierarchies to be managed through rte_flow. Signed-off-by: Declan Doherty --- doc/guides/prog_guide/rte_flow.rst | 26 ++++++++++++++++++++++++-- lib/librte_ether/rte_flow.h | 27 +++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 672473d33..325010544 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -1188,6 +1188,28 @@ flow rules: | 2 | END | +-------+----------------------------+ + +Action: ``JUMP`` +^^^^^^^^^^^^^^^^ + +Redirects packets to a group on the current device. + +In a hierarchy of groups, which can be used to represent physical or logical +flow group/tables on the device, this action allows the terminating action to +be a group on that device. + +- Terminating by default. + +.. _table_rte_flow_action_jump: + +.. table:: JUMP + + +-----------+---------------------------------+ + | Field | Value | + +===========+=================================+ + | ``group`` | Group ID to redirect packets to | + +-----------+---------------------------------+ + Action: ``MARK`` ^^^^^^^^^^^^^^^^ @@ -1512,7 +1534,7 @@ the RTE_FLOW_ITEM_TYPE_END item type. | ``definition`` | Tunnel end-point overlay definition | +----------------+-------------------------------------+ -.. _table_rte_flow_action_tunnel_encap_example: +.. _table_rte_flow_action_tunnel_encap_vxlan_example: .. table:: IPv4 VxLAN flow pattern example. @@ -1551,7 +1573,7 @@ NVGRE network overlay which conforms with RFC 7637 (NVGRE: Network Virtualizatio Using Generic Routing Encapsulation). The pattern must be terminated with the RTE_FLOW_ITEM_TYPE_END item type. -.. _table_rte_flow_action_tunnel_encap_example: +.. _table_rte_flow_action_tunnel_encap_nvgre_example: .. table:: IPv4 NVGRE flow pattern example. diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h index 537e1bfba..91544f62b 100644 --- a/lib/librte_ether/rte_flow.h +++ b/lib/librte_ether/rte_flow.h @@ -913,6 +913,20 @@ enum rte_flow_action_type { */ RTE_FLOW_ACTION_TYPE_PASSTHRU, + /** + * RTE_FLOW_ACTION_TYPE_JUMP + * + * Redirects packets to a group on the current device. + * + * In a hierarchy of groups, which can be used to represent + * physical or logical flow groups/tables on a device, this + * action allows the terminating action to be a group on + * that device. + * + * See struct rte_flow_action_jump + */ + RTE_FLOW_ACTION_TYPE_JUMP, + /** * [META] * @@ -1213,6 +1227,19 @@ struct rte_flow_action_tunnel_encap { */ }; +/** + * RTE_FLOW_ACTION_TYPE_JUMP + * + * Redirects packets to a group on the current device. + * + * In a hierarchy of groups, which can be used to represent physical or logical + * flow tables on the device, this action allows the action to be a redirect to + * a group on that device. + */ +struct rte_flow_action_jump { + uint32_t group; +}; + /** * Definition of a single action. * -- 2.14.3