> -----Original Message----- > From: Andrew Rybchenko <andrew.rybche...@oktetlabs.ru> > Sent: Friday, March 12, 2021 16:26 > To: Thomas Monjalon <tho...@monjalon.net>; Wang, Haiyue > <haiyue.w...@intel.com> > Cc: dev@dpdk.org; 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>; > 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>; 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: Re: [PATCH 1/2] ethdev: replace callback getting filter operations > > On 3/12/21 11:22 AM, Thomas Monjalon wrote: > > 12/03/2021 02:44, Wang, Haiyue: > >> From: Thomas Monjalon <tho...@monjalon.net> > >>> -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); > > > > Not sure. > > Returning an int may allow different error codes. > > Any opinions? > > > > I would keep int return value. There is no point to optimize it > (make it simpler). It is called in just one place where > int return value may be used/forwarded (see my review notes).
NULL ops means ENOSYS, non-NULL ops means that PMD can have different runtime ops ? Just guess. ;-)