Hi,

> -----Original Message-----
> From: Thomas Monjalon <tho...@monjalon.net>
> Sent: Saturday, March 13, 2021 1:47
> To: dev@dpdk.org
> Cc: Ori Kam <or...@nvidia.com>; Ajit Khaparde
> <ajit.khapa...@broadcom.com>; Somnath Kotur
> <somnath.ko...@broadcom.com>; Chas Williams <ch...@att.com>; Min Hu
> (Connor) <humi...@huawei.com>; Rahul Lakkireddy
> <rahul.lakkire...@chelsio.com>; Hemant Agrawal
> <hemant.agra...@nxp.com>; Sachin Saxena <sachin.sax...@oss.nxp.com>;
> Guo, Jia <jia....@intel.com>; Wang, Haiyue <haiyue.w...@intel.com>;
> Daley, John <johnd...@cisco.com>; Hyong Youb Kim <hyon...@cisco.com>;
> Gaetan Rivet <gr...@u256.net>; Ziyang Xuan <xuanziya...@huawei.com>;
> Xiaoyun Wang <cloud.wangxiao...@huawei.com>; Guoyang Zhou
> <zhouguoy...@huawei.com>; Yisen Zhuang <yisen.zhu...@huawei.com>;
> Lijun Ou <ouli...@huawei.com>; Xing, Beilei <beilei.x...@intel.com>; Wu,
> Jingjing <jingjing...@intel.com>; Yang, Qiming <qiming.y...@intel.com>;
> Zhang, Qi Z <qi.z.zh...@intel.com>; Xu, Rosen <rosen...@intel.com>;
> Matan Azrad <ma...@nvidia.com>; Shahaf Shuler <shah...@nvidia.com>;
> Viacheslav Ovsiienko <viachesl...@nvidia.com>; Liron Himi
> <lir...@marvell.com>; Jerin Jacob <jer...@marvell.com>; Nithin Dabilpuram
> <ndabilpu...@marvell.com>; Kiran Kumar K <kirankum...@marvell.com>;
> Rasesh Mody <rm...@marvell.com>; Shahed Shaikh
> <shsha...@marvell.com>; Andrew Rybchenko
> <andrew.rybche...@oktetlabs.ru>; Singh, Jasvinder
> <jasvinder.si...@intel.com>; Dumitrescu, Cristian
> <cristian.dumitre...@intel.com>; Wiles, Keith <keith.wi...@intel.com>;
> Jiawen Wu <jiawe...@trustnetic.com>; Jian Wang
> <jianw...@trustnetic.com>; Yigit, Ferruh <ferruh.yi...@intel.com>
> 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 <tho...@monjalon.net>
> ---
>  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 <rosen...@intel.com>

Reply via email to