[54/69] net/i40e/base: change for reading lpi statistics

Message ID 20191202074935.97629-55-xiaolong.ye@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: xiaolong ye
Headers
Series update for i40e base code |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Xiaolong Ye Dec. 2, 2019, 7:49 a.m. UTC
  There was no values for time duration statistics for LPI in EEE.
Two byte mask has been added to filter the flags because F/W
returns the status only in two lower bytes.

Signed-off-by: Jaroslaw Gawin <jaroslawx.gawin@intel.com>
Reviewed-by: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
Reviewed-by: Galazka Krzysztof <krzysztof.galazka@intel.com>
Reviewed-by: Slawomir Laba <slawomirx.laba@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Reviewed-by: Michael Alice <alice.michael@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 1 +
 drivers/net/i40e/base/i40e_common.c     | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h
index 5879f32ff..bc4aefba6 100644
--- a/drivers/net/i40e/base/i40e_adminq_cmd.h
+++ b/drivers/net/i40e/base/i40e_adminq_cmd.h
@@ -2301,6 +2301,7 @@  struct i40e_aqc_run_phy_activity {
 		struct {
 			__le32	cmd_status;
 #define I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC		0x4
+#define I40E_AQ_RUN_PHY_ACT_CMD_STAT_MASK		0xFFFF
 			__le32	data0;
 			__le32	data1;
 		} resp;
diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
index aebbd6004..1766214b9 100644
--- a/drivers/net/i40e/base/i40e_common.c
+++ b/drivers/net/i40e/base/i40e_common.c
@@ -7248,7 +7248,8 @@  enum i40e_status_code i40e_get_lpi_duration(struct i40e_hw *hw,
 
 	if (retval)
 		return retval;
-	if (cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)
+	if ((cmd_status & I40E_AQ_RUN_PHY_ACT_CMD_STAT_MASK) !=
+	    I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)
 		return I40E_ERR_ADMIN_QUEUE_ERROR;
 
 	if (hw->phy.link_info.link_speed == I40E_LINK_SPEED_1GB &&
@@ -7262,7 +7263,8 @@  enum i40e_status_code i40e_get_lpi_duration(struct i40e_hw *hw,
 
 		if (retval)
 			return retval;
-		if (cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)
+		if ((cmd_status & I40E_AQ_RUN_PHY_ACT_CMD_STAT_MASK) !=
+		    I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)
 			return I40E_ERR_ADMIN_QUEUE_ERROR;
 		tx_time_dur = 0;
 		rx_time_dur = 0;