[dpdk-dev] [RFC v2 2/3] ethdev: add flow api actions to modify TCP/UDP port numbers

Xiaoyu Min jackmin at mellanox.com
Tue Sep 18 11:29:10 CEST 2018


> 
> diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> index 638331c17..f60be0862 100644
> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> @@ -3713,6 +3713,14 @@ This section lists supported actions and their
> attributes, if any.
> 
>    - ``ipv6_addr``: New IPv6 destination address.
> 
> +- ``of_set_tp_src``: Set a new TCP/UDP source port number.
should be set_tp_src :-)
> +
> +  - ``port``: New TCP/UDP source port number.
> +
> +- ``of_set_tp_dst``: Set a new TCP/UDP destination port number.
set_tp_dst
> +  - ``port``: New TCP/UDP destination port number.
> +
>  Destroying flow rules
>  ~~~~~~~~~~~~~~~~~~~~~
> 


>  static int
> diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
> index 48c3c606e..c80771b25 100644
> --- a/lib/librte_ethdev/rte_flow.h
> +++ b/lib/librte_ethdev/rte_flow.h
> @@ -1533,6 +1533,20 @@ enum rte_flow_action_type {
>          * See struct rte_flow_action_set_ipv6.
>          */
>         RTE_FLOW_ACTION_TYPE_SET_IPV6_DST,
> +
> +       /**
> +        * Modify source port in TCP/UDP packets.
> +        *
> +        * See struct rte_flow_action_set_tp.
> +        */
> +       RTE_FLOW_ACTION_TYPE_SET_TP_SRC,
> +
> +       /**
> +        * Modify destination port in TCP/UDP packets.
> +        *
> +        * See struct rte_flow_action_set_tp.
> +        */
> +       RTE_FLOW_ACTION_TYPE_SET_TP_DST,
>  };
> 
We need to state the corresponding RTE_FLOW_ITEM_TYPE_(UDP|TCP) should be in pattern

-Jack   


More information about the dev mailing list