diff mbox

[dpdk-dev,13/18] i40e: replacement of 'i40e_debug_read_register()'

Message ID 1429518150-28098-14-git-send-email-helin.zhang@intel.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Helin Zhang April 20, 2015, 8:22 a.m. UTC
As base driver provides 'i40e_aq_debug_read_register()', the same
functional interface of 'i40e_debug_read_register()' can be replaced.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 lib/librte_pmd_i40e/i40e_ethdev.c | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

Comments

Thomas Monjalon April 27, 2015, 5:28 p.m. UTC | #1
2015-04-20 16:22, Helin Zhang:
> As base driver provides 'i40e_aq_debug_read_register()', the same
> functional interface of 'i40e_debug_read_register()' can be replaced.
> 
> Signed-off-by: Helin Zhang <helin.zhang@intel.com>
> ---
>  lib/librte_pmd_i40e/i40e_ethdev.c | 22 ++--------------------
>  1 file changed, 2 insertions(+), 20 deletions(-)

It should be merged with the patch introducing the function in the base driver.
So it will be easier to check what changed.
Helin Zhang April 28, 2015, 2:34 a.m. UTC | #2
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Tuesday, April 28, 2015 1:29 AM
> To: Zhang, Helin
> Cc: dev@dpdk.org; Kenguva, Monica; Murray, Steven J; Shih, Chiu-Pi
> Subject: Re: [dpdk-dev] [PATCH 13/18] i40e: replacement of
> 'i40e_debug_read_register()'
> 
> 2015-04-20 16:22, Helin Zhang:
> > As base driver provides 'i40e_aq_debug_read_register()', the same
> > functional interface of 'i40e_debug_read_register()' can be replaced.
> >
> > Signed-off-by: Helin Zhang <helin.zhang@intel.com>
> > ---
> >  lib/librte_pmd_i40e/i40e_ethdev.c | 22 ++--------------------
> >  1 file changed, 2 insertions(+), 20 deletions(-)
> 
> It should be merged with the patch introducing the function in the base driver.
> So it will be easier to check what changed.

OK. Agree with you!

Regards,
Helin
diff mbox

Patch

diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c
index 8832609..5bc2504 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev.c
+++ b/lib/librte_pmd_i40e/i40e_ethdev.c
@@ -5623,25 +5623,6 @@  i40e_pctype_to_flowtype(enum i40e_filter_pctype pctype)
 	return flowtype_table[pctype];
 }
 
-static int
-i40e_debug_read_register(struct i40e_hw *hw, uint32_t addr, uint64_t *val)
-{
-	struct i40e_aq_desc desc;
-	enum i40e_status_code status;
-
-	i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_debug_read_reg);
-	desc.params.internal.param1 = rte_cpu_to_le_32(addr);
-	status = i40e_asq_send_command(hw, &desc, NULL, 0, NULL);
-	if (status < 0)
-		return status;
-
-	*val = ((uint64_t)(rte_le_to_cpu_32(desc.params.internal.param2)) <<
-					(CHAR_BIT * sizeof(uint32_t))) +
-				rte_le_to_cpu_32(desc.params.internal.param3);
-
-	return status;
-}
-
 /*
  * On X710, performance number is far from the expectation on recent firmware
  * versions; on XL710, performance number is also far from the expectation on
@@ -5692,7 +5673,8 @@  i40e_configure_registers(struct i40e_hw *hw)
 					I40E_GL_SWR_PM_UP_THR_EF_VALUE;
 		}
 
-		ret = i40e_debug_read_register(hw, reg_table[i].addr, &reg);
+		ret = i40e_aq_debug_read_register(hw, reg_table[i].addr,
+							&reg, NULL);
 		if (ret < 0) {
 			PMD_DRV_LOG(ERR, "Failed to read from 0x%"PRIx32,
 							reg_table[i].addr);