[dpdk-dev] [PATCH 54/69] net/i40e/base: change for reading lpi statistics

Xiaolong Ye xiaolong.ye at intel.com
Mon Dec 2 08:49:20 CET 2019


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 at intel.com>
Reviewed-by: Grzegorz Szczurek <grzegorzx.szczurek at intel.com>
Reviewed-by: Galazka Krzysztof <krzysztof.galazka at intel.com>
Reviewed-by: Slawomir Laba <slawomirx.laba at intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov at intel.com>
Reviewed-by: Paul M Stillwell Jr <paul.m.stillwell.jr at intel.com>
Reviewed-by: Michael Alice <alice.michael at intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye at 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(-)

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;
-- 
2.17.1



More information about the dev mailing list