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

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

From: Xu, Rosen <hidden>
Date: 2021-03-15 03:05:52

Hi,
-----Original Message-----
From: Thomas Monjalon <redacted>
Sent: Saturday, March 13, 2021 1:47
To: dev@dpdk.org
Cc: Ori Kam <redacted>; Ajit Khaparde
[off-list ref]; 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]; Wang, Haiyue [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]; Andrew Rybchenko
[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: [PATCH v2 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 <redacted>
---
 drivers/net/ipn3ke/ipn3ke_representor.c | 28 ++++-----------
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c
b/drivers/net/ipn3ke/ipn3ke_representor.c
index 856d21ef9b..589d9fa587 100644
--- a/drivers/net/ipn3ke/ipn3ke_representor.c
+++ b/drivers/net/ipn3ke/ipn3ke_representor.c
@@ -2821,11 +2821,9 @@ ipn3ke_rpst_mtu_set(struct rte_eth_dev *ethdev,
uint16_t mtu)
 }

 static int
-ipn3ke_afu_filter_ctrl(struct rte_eth_dev *ethdev,
-	enum rte_filter_type filter_type, enum rte_filter_op filter_op,
-	void *arg)
+ipn3ke_afu_flow_ops_get(struct rte_eth_dev *ethdev,
+			const struct rte_flow_ops **ops)
 {
-	int ret = 0;
 	struct ipn3ke_hw *hw;
 	struct ipn3ke_rpst *rpst;
@@ -2836,27 +2834,13 @@ ipn3ke_afu_filter_ctrl(struct rte_eth_dev
*ethdev,
 	rpst = IPN3KE_DEV_PRIVATE_TO_RPST(ethdev);

 	if (hw->acc_flow)
-		switch (filter_type) {
-		case RTE_ETH_FILTER_GENERIC:
-			if (filter_op != RTE_ETH_FILTER_GET)
-				return -EINVAL;
-			*(const void **)arg = &ipn3ke_flow_ops;
-			break;
-		default:
-			IPN3KE_AFU_PMD_WARN("Filter type (%d) not
supported",
-					filter_type);
-			ret = -EINVAL;
-			break;
-		}
+		*ops = &ipn3ke_flow_ops;
 	else if (rpst->i40e_pf_eth)
-		(*rpst->i40e_pf_eth->dev_ops->filter_ctrl)(ethdev,
-							filter_type,
-							filter_op,
-							arg);
+		(*rpst->i40e_pf_eth->dev_ops->flow_ops_get)(ethdev, ops);
 	else
 		return -EINVAL;

-	return ret;
+	return 0;
 }

 static const struct eth_dev_ops ipn3ke_rpst_dev_ops = {
@@ -2874,7 +2858,7 @@ static const struct eth_dev_ops
ipn3ke_rpst_dev_ops = {
 	.stats_reset          = ipn3ke_rpst_stats_reset,
 	.xstats_reset         = ipn3ke_rpst_stats_reset,

-	.filter_ctrl          = ipn3ke_afu_filter_ctrl,
+	.flow_ops_get         = ipn3ke_afu_flow_ops_get,

 	.rx_queue_start       = ipn3ke_rpst_rx_queue_start,
 	.rx_queue_stop        = ipn3ke_rpst_rx_queue_stop,
Acked-by: Rosen Xu <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help