Thread (41 messages) 41 messages, 8 authors, 2021-03-29

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

From: Wang, Haiyue <hidden>
Date: 2021-03-12 08:40:54

-----Original Message-----
From: Andrew Rybchenko <redacted>
Sent: Friday, March 12, 2021 16:26
To: Thomas Monjalon <redacted>; Wang, Haiyue <redacted>
Cc: dev@dpdk.org; Ori Kam <redacted>; Ajit Khaparde <ajit.khaparde@broadcom.com>; Somnath
Kotur [off-list ref]; Chas Williams [off-list ref]; Min Hu (Connor)
[off-list ref]; Rahul Lakkireddy [off-list ref]; Hemant Agrawal
[off-list ref]; Sachin Saxena [off-list ref]; Guo, Jia [off-list ref];
Daley, John [off-list ref]; Hyong Youb Kim [off-list ref]; Gaetan Rivet [off-list ref];
Ziyang Xuan [off-list ref]; Xiaoyun Wang [off-list ref]; Guoyang Zhou
[off-list ref]; Yisen Zhuang [off-list ref]; Lijun Ou [off-list ref]; Xing,
Beilei [off-list ref]; Wu, Jingjing [off-list ref]; Yang, Qiming
[off-list ref]; Zhang, Qi Z [off-list ref]; Xu, Rosen [off-list ref]; Matan
Azrad [off-list ref]; Shahaf Shuler [off-list ref]; Viacheslav Ovsiienko
[off-list ref]; Liron Himi [off-list ref]; Jerin Jacob [off-list ref]; Nithin
Dabilpuram [off-list ref]; Kiran Kumar K [off-list ref]; Rasesh Mody
[off-list ref]; Shahed Shaikh [off-list ref]; Singh, Jasvinder
[off-list ref]; Dumitrescu, Cristian [off-list ref]; Wiles, Keith
[off-list ref]; Jiawen Wu [off-list ref]; Jian Wang [off-list ref];
Yigit, Ferruh [off-list ref]
Subject: Re: [PATCH 1/2] ethdev: replace callback getting filter operations

On 3/12/21 11:22 AM, Thomas Monjalon wrote:
quoted
12/03/2021 02:44, Wang, Haiyue:
quoted
From: Thomas Monjalon <redacted>
quoted
-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. ;-)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help