> -----Original Message-----
> From: Thomas Monjalon <[email protected]>
> Sent: Friday, March 12, 2021 06:18
> 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 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]>
> ---
> doc/guides/nics/features.rst | 4 +--
> doc/guides/prog_guide/rte_flow.rst | 14 +-------
> doc/guides/rel_notes/release_20_11.rst | 2 +-
> doc/guides/rel_notes/release_2_2.rst | 2 +-
> drivers/net/bnxt/bnxt.h | 6 ++--
> drivers/net/bnxt/bnxt_ethdev.c | 40 +++++++--------------
> drivers/net/bnxt/bnxt_reps.c | 2 +-
> drivers/net/bonding/rte_eth_bond_pmd.c | 13 +++----
> drivers/net/cxgbe/cxgbe_ethdev.c | 2 +-
> drivers/net/cxgbe/cxgbe_flow.c | 22 +++---------
> drivers/net/cxgbe/cxgbe_flow.h | 7 ++--
> drivers/net/dpaa2/dpaa2_ethdev.c | 44 +++--------------------
> drivers/net/dpaa2/dpaa2_flow.c | 29 +++++-----------
> drivers/net/e1000/igb_ethdev.c | 31 ++++-------------
> drivers/net/enic/enic_ethdev.c | 30 +++++-----------
> drivers/net/enic/enic_vf_representor.c | 33 ++++++------------
> drivers/net/failsafe/failsafe_ops.c | 16 +++------
> drivers/net/hinic/hinic_pmd_ethdev.c | 36 ++++---------------
> drivers/net/hns3/hns3_ethdev.c | 2 +-
> drivers/net/hns3/hns3_ethdev.h | 5 ++-
> drivers/net/hns3/hns3_ethdev_vf.c | 2 +-
> drivers/net/hns3/hns3_flow.c | 30 ++++------------
> drivers/net/i40e/i40e_ethdev.c | 32 ++++-------------
> drivers/net/iavf/iavf_ethdev.c | 32 ++++-------------
> drivers/net/ice/ice_dcf_ethdev.c | 27 +++------------
> drivers/net/ice/ice_ethdev.c | 32 ++++-------------
> drivers/net/igc/igc_ethdev.c | 2 +-
> drivers/net/igc/igc_filter.c | 23 +++----------
> drivers/net/igc/igc_filter.h | 5 ++-
> drivers/net/ipn3ke/ipn3ke_representor.c | 28 ++++-----------
> drivers/net/ixgbe/ixgbe_ethdev.c | 32 ++++-------------
> drivers/net/mlx4/mlx4.c | 2 +-
> drivers/net/mlx4/mlx4_flow.c | 32 ++++-------------
> drivers/net/mlx4/mlx4_flow.h | 5 +--
> drivers/net/mlx5/mlx5.c | 4 +--
> drivers/net/mlx5/mlx5.h | 5 +--
> drivers/net/mlx5/mlx5_flow.c | 32 ++++-------------
> drivers/net/mvpp2/mrvl_ethdev.c | 26 ++++----------
> drivers/net/octeontx2/otx2_ethdev.c | 2 +-
> drivers/net/octeontx2/otx2_ethdev.h | 5 ++-
> drivers/net/octeontx2/otx2_ethdev_ops.c | 21 +++--------
> drivers/net/qede/qede_ethdev.c | 2 +-
> drivers/net/qede/qede_ethdev.h | 7 ++--
> drivers/net/qede/qede_filter.c | 27 ++++-----------
> drivers/net/sfc/sfc_ethdev.c | 31 +++--------------
> drivers/net/softnic/rte_eth_softnic.c | 17 +++------
> drivers/net/tap/rte_eth_tap.c | 2 +-
> drivers/net/tap/tap_flow.c | 27 ++++-----------
> drivers/net/tap/tap_flow.h | 6 ++--
> drivers/net/txgbe/txgbe_ethdev.c | 26 +++-----------
> lib/librte_ethdev/ethdev_driver.h | 46 +++++++++----------------
> lib/librte_ethdev/rte_eth_ctrl.h | 2 +-
> lib/librte_ethdev/rte_flow.c | 9 ++---
> lib/librte_ethdev/rte_flow_driver.h | 25 --------------
> 54 files changed, 226 insertions(+), 720 deletions(-)
>
> -enum rte_filter_op {
> - RTE_ETH_FILTER_GET, /**< get flow API ops */
> -};
> -
> -typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
> - enum rte_filter_type filter_type,
> - enum rte_filter_op filter_op,
> - void *arg);
> -/**< @internal Take operations to assigned filter type on an Ethernet device
> */
> +struct rte_flow_ops;
> +typedef int (*eth_flow_ops_get_t)(struct rte_eth_dev *dev,
> + const struct rte_flow_ops **ops);
> +/**< @internal Get flow operations */
>
How about to change the return type to "const struct rte_flow_ops *" directly ?
typedef const struct rte_flow_ops * (*eth_flow_ops_get_t)(struct rte_eth_dev
*dev);
> --
> 2.30.1