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

Xu, Rosen rosen.xu at intel.com
Mon Mar 15 04:05:38 CET 2021


Hi,

> -----Original Message-----
> From: Thomas Monjalon <thomas at monjalon.net>
> Sent: Saturday, March 13, 2021 1:47
> To: dev at dpdk.org
> Cc: 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>; Wang, Haiyue <haiyue.wang 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>; Andrew Rybchenko
> <andrew.rybchenko at oktetlabs.ru>; 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: [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 <thomas at monjalon.net>
> ---
>  drivers/net/ipn3ke/ipn3ke_representor.c | 28 ++++-----------

> 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 <rosen.xu at intel.com>


More information about the dev mailing list