> -----Original Message-----
> From: Andrew Rybchenko <andrew.rybche...@oktetlabs.ru>
> Sent: Friday, October 1, 2021 7:17 PM
> To: Jerin Jacob Kollanukkaran <jer...@marvell.com>; Nithin Kumar Dabilpuram
> <ndabilpu...@marvell.com>; Kiran Kumar Kokkilagadda
> <kirankum...@marvell.com>
> Cc: dev@dpdk.org; Ori Kam <or...@nvidia.com>; Thomas Monjalon
> <tho...@monjalon.net>; Ferruh Yigit <ferruh.yi...@intel.com>; Ivan Malov
> <ivan.ma...@oktetlabs.ru>
> Subject: [EXT] [PATCH v1 11/12] net/octeontx2: support ethdev flow action
> 
> External Email
> 
> ----------------------------------------------------------------------
> PORT_ID action implementation works for ingress only and has the same
> semantics as ETHDEV action.

Please update the documentation also.


> 
> Signed-off-by: Andrew Rybchenko <andrew.rybche...@oktetlabs.ru>
> ---
>  drivers/net/octeontx2/otx2_flow_parse.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/octeontx2/otx2_flow_parse.c
> b/drivers/net/octeontx2/otx2_flow_parse.c
> index 63a33142a5..5dd8464ec9 100644
> --- a/drivers/net/octeontx2/otx2_flow_parse.c
> +++ b/drivers/net/octeontx2/otx2_flow_parse.c
> @@ -900,7 +900,6 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev,  {
>       struct otx2_eth_dev *hw = dev->data->dev_private;
>       struct otx2_npc_flow_info *npc = &hw->npc_flow;
> -     const struct rte_flow_action_port_id *port_act;
>       const struct rte_flow_action_count *act_count;
>       const struct rte_flow_action_mark *act_mark;
>       const struct rte_flow_action_queue *act_q; @@ -987,9 +986,18 @@
> otx2_flow_parse_actions(struct rte_eth_dev *dev,
>                       break;
> 
>               case RTE_FLOW_ACTION_TYPE_PORT_ID:
> -                     port_act = (const struct rte_flow_action_port_id *)
> -                             actions->conf;
> -                     port_id = port_act->id;
> +             case RTE_FLOW_ACTION_TYPE_ETHDEV:
> +                     if (actions->type ==
> RTE_FLOW_ACTION_TYPE_PORT_ID) {
> +                             const struct rte_flow_action_port_id
> *port_act;
> +
> +                             port_act = actions->conf;
> +                             port_id = port_act->id;
> +                     } else {
> +                             const struct rte_flow_action_ethdev
> *ethdev_act;
> +
> +                             ethdev_act = actions->conf;
> +                             port_id = ethdev_act->id;
> +                     }
>                       if (rte_eth_dev_get_name_by_port(port_id, if_name)) {
>                               errmsg = "Name not found for output port id";
>                               errcode = EINVAL;
> --
> 2.30.2

Reply via email to