[dpdk-dev] [PATCH 1/2] ethdev: replace callback getting filter operations

Wang, Haiyue haiyue.wang at intel.com
Fri Mar 12 09:40:23 CET 2021


> -----Original Message-----
> From: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
> Sent: Friday, March 12, 2021 16:26
> To: Thomas Monjalon <thomas at monjalon.net>; Wang, Haiyue <haiyue.wang at intel.com>
> Cc: dev at dpdk.org; Ori Kam <orika at nvidia.com>; Ajit Khaparde <ajit.khaparde at broadcom.com>; Somnath
> Kotur <somnath.kotur at broadcom.com>; Chas Williams <chas3 at att.com>; Min Hu (Connor)
> <humin29 at huawei.com>; Rahul Lakkireddy <rahul.lakkireddy at chelsio.com>; Hemant Agrawal
> <hemant.agrawal at nxp.com>; Sachin Saxena <sachin.saxena at oss.nxp.com>; Guo, Jia <jia.guo at intel.com>;
> Daley, John <johndale at cisco.com>; Hyong Youb Kim <hyonkim at cisco.com>; Gaetan Rivet <grive at u256.net>;
> Ziyang Xuan <xuanziyang2 at huawei.com>; Xiaoyun Wang <cloud.wangxiaoyun at huawei.com>; Guoyang Zhou
> <zhouguoyang at huawei.com>; Yisen Zhuang <yisen.zhuang at huawei.com>; Lijun Ou <oulijun at huawei.com>; Xing,
> Beilei <beilei.xing at intel.com>; Wu, Jingjing <jingjing.wu at intel.com>; Yang, Qiming
> <qiming.yang at intel.com>; Zhang, Qi Z <qi.z.zhang at intel.com>; Xu, Rosen <rosen.xu at intel.com>; Matan
> Azrad <matan at nvidia.com>; Shahaf Shuler <shahafs at nvidia.com>; Viacheslav Ovsiienko
> <viacheslavo at nvidia.com>; Liron Himi <lironh at marvell.com>; Jerin Jacob <jerinj at marvell.com>; Nithin
> Dabilpuram <ndabilpuram at marvell.com>; Kiran Kumar K <kirankumark at marvell.com>; Rasesh Mody
> <rmody at marvell.com>; Shahed Shaikh <shshaikh at marvell.com>; Singh, Jasvinder
> <jasvinder.singh at intel.com>; Dumitrescu, Cristian <cristian.dumitrescu at intel.com>; Wiles, Keith
> <keith.wiles at intel.com>; Jiawen Wu <jiawenwu at trustnetic.com>; Jian Wang <jianwang at trustnetic.com>;
> Yigit, Ferruh <ferruh.yigit at 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 <thomas at 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. ;-)


More information about the dev mailing list