[v2,2/7] net/hns3: replace fp ops config function

Message ID 20231020100746.31520-3-fengchengwen@huawei.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series fix race-condition of proactive error handling mode |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

fengchengwen Oct. 20, 2023, 10:07 a.m. UTC
  This patch replace hns3_eth_dev_fp_ops_config() with
rte_eth_fp_ops_setup().

Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 21 +++------------------
 1 file changed, 3 insertions(+), 18 deletions(-)
  

Comments

lihuisong (C) Nov. 1, 2023, 3:40 a.m. UTC | #1
lgtm,
Acked-by: Huisong Li <lihuisong@huawei.com>

在 2023/10/20 18:07, Chengwen Feng 写道:
> This patch replace hns3_eth_dev_fp_ops_config() with
> rte_eth_fp_ops_setup().
>
> Cc: stable@dpdk.org
>
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> Acked-by: Dongdong Liu <liudongdong3@huawei.com>
> ---
>   drivers/net/hns3/hns3_rxtx.c | 21 +++------------------
>   1 file changed, 3 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
> index f3c3b38c55..f43f1eb9ad 100644
> --- a/drivers/net/hns3/hns3_rxtx.c
> +++ b/drivers/net/hns3/hns3_rxtx.c
> @@ -4434,21 +4434,6 @@ hns3_trace_rxtx_function(struct rte_eth_dev *dev)
>   		 rx_mode.info, tx_mode.info);
>   }
>   
> -static void
> -hns3_eth_dev_fp_ops_config(const struct rte_eth_dev *dev)
> -{
> -	struct rte_eth_fp_ops *fpo = rte_eth_fp_ops;
> -	uint16_t port_id = dev->data->port_id;
> -
> -	fpo[port_id].rx_pkt_burst = dev->rx_pkt_burst;
> -	fpo[port_id].tx_pkt_burst = dev->tx_pkt_burst;
> -	fpo[port_id].tx_pkt_prepare = dev->tx_pkt_prepare;
> -	fpo[port_id].rx_descriptor_status = dev->rx_descriptor_status;
> -	fpo[port_id].tx_descriptor_status = dev->tx_descriptor_status;
> -	fpo[port_id].rxq.data = dev->data->rx_queues;
> -	fpo[port_id].txq.data = dev->data->tx_queues;
> -}
> -
>   void
>   hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
>   {
> @@ -4471,7 +4456,7 @@ hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
>   	}
>   
>   	hns3_trace_rxtx_function(eth_dev);
> -	hns3_eth_dev_fp_ops_config(eth_dev);
> +	rte_eth_fp_ops_setup(eth_dev);
>   }
>   
>   void
> @@ -4824,7 +4809,7 @@ hns3_stop_tx_datapath(struct rte_eth_dev *dev)
>   {
>   	dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
>   	dev->tx_pkt_prepare = NULL;
> -	hns3_eth_dev_fp_ops_config(dev);
> +	rte_eth_fp_ops_setup(dev);
>   
>   	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
>   		return;
> @@ -4841,7 +4826,7 @@ hns3_start_tx_datapath(struct rte_eth_dev *dev)
>   {
>   	dev->tx_pkt_burst = hns3_get_tx_function(dev);
>   	dev->tx_pkt_prepare = hns3_get_tx_prepare(dev);
> -	hns3_eth_dev_fp_ops_config(dev);
> +	rte_eth_fp_ops_setup(dev);
>   
>   	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
>   		return;
  
Konstantin Ananyev Nov. 2, 2023, 10:34 a.m. UTC | #2
> -----Original Message-----
> From: Fengchengwen <fengchengwen@huawei.com>
> Sent: Friday, October 20, 2023 11:08 AM
> To: thomas@monjalon.net; ferruh.yigit@amd.com; Konstantin Ananyev <konstantin.ananyev@huawei.com>;
> ajit.khaparde@broadcom.com; haijie <haijie1@huawei.com>; Zhuangyuzeng (Yisen) <yisen.zhuang@huawei.com>
> Cc: dev@dpdk.org; andrew.rybchenko@oktetlabs.ru; kalesh-anakkur.purayil@broadcom.com; Honnappa.Nagarahalli@arm.com
> Subject: [PATCH v2 2/7] net/hns3: replace fp ops config function
> 
> This patch replace hns3_eth_dev_fp_ops_config() with
> rte_eth_fp_ops_setup().
> 
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> Acked-by: Dongdong Liu <liudongdong3@huawei.com>
> ---
>  drivers/net/hns3/hns3_rxtx.c | 21 +++------------------
>  1 file changed, 3 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
> index f3c3b38c55..f43f1eb9ad 100644
> --- a/drivers/net/hns3/hns3_rxtx.c
> +++ b/drivers/net/hns3/hns3_rxtx.c
> @@ -4434,21 +4434,6 @@ hns3_trace_rxtx_function(struct rte_eth_dev *dev)
>  		 rx_mode.info, tx_mode.info);
>  }
> 
> -static void
> -hns3_eth_dev_fp_ops_config(const struct rte_eth_dev *dev)
> -{
> -	struct rte_eth_fp_ops *fpo = rte_eth_fp_ops;
> -	uint16_t port_id = dev->data->port_id;
> -
> -	fpo[port_id].rx_pkt_burst = dev->rx_pkt_burst;
> -	fpo[port_id].tx_pkt_burst = dev->tx_pkt_burst;
> -	fpo[port_id].tx_pkt_prepare = dev->tx_pkt_prepare;
> -	fpo[port_id].rx_descriptor_status = dev->rx_descriptor_status;
> -	fpo[port_id].tx_descriptor_status = dev->tx_descriptor_status;
> -	fpo[port_id].rxq.data = dev->data->rx_queues;
> -	fpo[port_id].txq.data = dev->data->tx_queues;
> -}
> -
>  void
>  hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
>  {
> @@ -4471,7 +4456,7 @@ hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
>  	}
> 
>  	hns3_trace_rxtx_function(eth_dev);
> -	hns3_eth_dev_fp_ops_config(eth_dev);
> +	rte_eth_fp_ops_setup(eth_dev);
>  }
> 
>  void
> @@ -4824,7 +4809,7 @@ hns3_stop_tx_datapath(struct rte_eth_dev *dev)
>  {
>  	dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
>  	dev->tx_pkt_prepare = NULL;
> -	hns3_eth_dev_fp_ops_config(dev);
> +	rte_eth_fp_ops_setup(dev);
> 
>  	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
>  		return;
> @@ -4841,7 +4826,7 @@ hns3_start_tx_datapath(struct rte_eth_dev *dev)
>  {
>  	dev->tx_pkt_burst = hns3_get_tx_function(dev);
>  	dev->tx_pkt_prepare = hns3_get_tx_prepare(dev);
> -	hns3_eth_dev_fp_ops_config(dev);
> +	rte_eth_fp_ops_setup(dev);
> 
>  	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
>  		return;
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com> 


> 2.17.1
  

Patch

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index f3c3b38c55..f43f1eb9ad 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -4434,21 +4434,6 @@  hns3_trace_rxtx_function(struct rte_eth_dev *dev)
 		 rx_mode.info, tx_mode.info);
 }
 
-static void
-hns3_eth_dev_fp_ops_config(const struct rte_eth_dev *dev)
-{
-	struct rte_eth_fp_ops *fpo = rte_eth_fp_ops;
-	uint16_t port_id = dev->data->port_id;
-
-	fpo[port_id].rx_pkt_burst = dev->rx_pkt_burst;
-	fpo[port_id].tx_pkt_burst = dev->tx_pkt_burst;
-	fpo[port_id].tx_pkt_prepare = dev->tx_pkt_prepare;
-	fpo[port_id].rx_descriptor_status = dev->rx_descriptor_status;
-	fpo[port_id].tx_descriptor_status = dev->tx_descriptor_status;
-	fpo[port_id].rxq.data = dev->data->rx_queues;
-	fpo[port_id].txq.data = dev->data->tx_queues;
-}
-
 void
 hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
 {
@@ -4471,7 +4456,7 @@  hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
 	}
 
 	hns3_trace_rxtx_function(eth_dev);
-	hns3_eth_dev_fp_ops_config(eth_dev);
+	rte_eth_fp_ops_setup(eth_dev);
 }
 
 void
@@ -4824,7 +4809,7 @@  hns3_stop_tx_datapath(struct rte_eth_dev *dev)
 {
 	dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
 	dev->tx_pkt_prepare = NULL;
-	hns3_eth_dev_fp_ops_config(dev);
+	rte_eth_fp_ops_setup(dev);
 
 	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
 		return;
@@ -4841,7 +4826,7 @@  hns3_start_tx_datapath(struct rte_eth_dev *dev)
 {
 	dev->tx_pkt_burst = hns3_get_tx_function(dev);
 	dev->tx_pkt_prepare = hns3_get_tx_prepare(dev);
-	hns3_eth_dev_fp_ops_config(dev);
+	rte_eth_fp_ops_setup(dev);
 
 	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
 		return;