Hi,

> -----Original Message-----
> From: Thomas Monjalon <[email protected]>
> Sent: Saturday, March 13, 2021 1:47
> To: [email protected]
> Cc: Ori Kam <[email protected]>; Ajit Khaparde
> <[email protected]>; Somnath Kotur
> <[email protected]>; Chas Williams <[email protected]>; Min Hu
> (Connor) <[email protected]>; Rahul Lakkireddy
> <[email protected]>; Hemant Agrawal
> <[email protected]>; Sachin Saxena <[email protected]>;
> Guo, Jia <[email protected]>; Wang, Haiyue <[email protected]>;
> Daley, John <[email protected]>; Hyong Youb Kim <[email protected]>;
> Gaetan Rivet <[email protected]>; Ziyang Xuan <[email protected]>;
> Xiaoyun Wang <[email protected]>; Guoyang Zhou
> <[email protected]>; Yisen Zhuang <[email protected]>;
> Lijun Ou <[email protected]>; Xing, Beilei <[email protected]>; Wu,
> Jingjing <[email protected]>; Yang, Qiming <[email protected]>;
> Zhang, Qi Z <[email protected]>; Xu, Rosen <[email protected]>;
> Matan Azrad <[email protected]>; Shahaf Shuler <[email protected]>;
> Viacheslav Ovsiienko <[email protected]>; Liron Himi
> <[email protected]>; Jerin Jacob <[email protected]>; Nithin Dabilpuram
> <[email protected]>; Kiran Kumar K <[email protected]>;
> Rasesh Mody <[email protected]>; Shahed Shaikh
> <[email protected]>; Andrew Rybchenko
> <[email protected]>; Singh, Jasvinder
> <[email protected]>; Dumitrescu, Cristian
> <[email protected]>; Wiles, Keith <[email protected]>;
> Jiawen Wu <[email protected]>; Jian Wang
> <[email protected]>; Yigit, Ferruh <[email protected]>
> Subject: [PATCH v2 1/2] ethdev: replace callback getting filter operations
> 
> Since rte_flow is the only API for filtering operations,
> the legacy driver interface filter_ctrl was too much complicated
> for the simple task of getting the struct rte_flow_ops.
> 
> The filter type RTE_ETH_FILTER_GENERIC and
> the filter operarion RTE_ETH_FILTER_GET are removed.
> The new driver callback flow_ops_get replaces filter_ctrl.
> 
> Signed-off-by: Thomas Monjalon <[email protected]>
> ---
>  drivers/net/ipn3ke/ipn3ke_representor.c | 28 ++++-----------

> diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c
> b/drivers/net/ipn3ke/ipn3ke_representor.c
> index 856d21ef9b..589d9fa587 100644
> --- a/drivers/net/ipn3ke/ipn3ke_representor.c
> +++ b/drivers/net/ipn3ke/ipn3ke_representor.c
> @@ -2821,11 +2821,9 @@ ipn3ke_rpst_mtu_set(struct rte_eth_dev *ethdev,
> uint16_t mtu)
>  }
> 
>  static int
> -ipn3ke_afu_filter_ctrl(struct rte_eth_dev *ethdev,
> -     enum rte_filter_type filter_type, enum rte_filter_op filter_op,
> -     void *arg)
> +ipn3ke_afu_flow_ops_get(struct rte_eth_dev *ethdev,
> +                     const struct rte_flow_ops **ops)
>  {
> -     int ret = 0;
>       struct ipn3ke_hw *hw;
>       struct ipn3ke_rpst *rpst;
> 
> @@ -2836,27 +2834,13 @@ ipn3ke_afu_filter_ctrl(struct rte_eth_dev
> *ethdev,
>       rpst = IPN3KE_DEV_PRIVATE_TO_RPST(ethdev);
> 
>       if (hw->acc_flow)
> -             switch (filter_type) {
> -             case RTE_ETH_FILTER_GENERIC:
> -                     if (filter_op != RTE_ETH_FILTER_GET)
> -                             return -EINVAL;
> -                     *(const void **)arg = &ipn3ke_flow_ops;
> -                     break;
> -             default:
> -                     IPN3KE_AFU_PMD_WARN("Filter type (%d) not
> supported",
> -                                     filter_type);
> -                     ret = -EINVAL;
> -                     break;
> -             }
> +             *ops = &ipn3ke_flow_ops;
>       else if (rpst->i40e_pf_eth)
> -             (*rpst->i40e_pf_eth->dev_ops->filter_ctrl)(ethdev,
> -                                                     filter_type,
> -                                                     filter_op,
> -                                                     arg);
> +             (*rpst->i40e_pf_eth->dev_ops->flow_ops_get)(ethdev, ops);
>       else
>               return -EINVAL;
> 
> -     return ret;
> +     return 0;
>  }
> 
>  static const struct eth_dev_ops ipn3ke_rpst_dev_ops = {
> @@ -2874,7 +2858,7 @@ static const struct eth_dev_ops
> ipn3ke_rpst_dev_ops = {
>       .stats_reset          = ipn3ke_rpst_stats_reset,
>       .xstats_reset         = ipn3ke_rpst_stats_reset,
> 
> -     .filter_ctrl          = ipn3ke_afu_filter_ctrl,
> +     .flow_ops_get         = ipn3ke_afu_flow_ops_get,
> 
>       .rx_queue_start       = ipn3ke_rpst_rx_queue_start,
>       .rx_queue_stop        = ipn3ke_rpst_rx_queue_stop,

Acked-by: Rosen Xu <[email protected]>

Reply via email to