> -----Original Message----- > From: Andrew Rybchenko <[email protected]> > Sent: Friday, March 12, 2021 16:26 > To: Thomas Monjalon <[email protected]>; Wang, Haiyue > <[email protected]> > Cc: [email protected]; 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]>; > 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]>; 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: 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 <[email protected]> > >>> -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. ;-)

