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 <declan.dohe...@intel.com> --- 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