[40/69] net/i40e/base: change link flapping on 25g cards

Message ID 20191202074935.97629-41-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
  After NVM update on some 25g cards link start periodically flap.
The issue was fixed by adding additional check into
i40e_get_lpi_counters() which calls i40e_aq_run_phy_activity()
only for EEE capable cards.

Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Galazka Krzysztof <krzysztof.galazka@intel.com>
Reviewed-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Reviewed-by: Formela Marcin <marcin.formela@intel.com>
Reviewed-by: Kirsher Jeffrey T <jeffrey.t.kirsher@intel.com>
Reviewed-by: Michael Alice <alice.michael@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
---
 drivers/net/i40e/base/i40e_common.c | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Patch

diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
index 4d2d86196..337d62b5f 100644
--- a/drivers/net/i40e/base/i40e_common.c
+++ b/drivers/net/i40e/base/i40e_common.c
@@ -7176,6 +7176,15 @@  enum i40e_status_code i40e_get_lpi_counters(struct i40e_hw *hw,
 	enum i40e_status_code retval;
 	u32 cmd_status;
 
+	/* only X710-T*L requires special handling of counters
+	 * for other devices we just read the MAC registers
+	 */
+	if (hw->device_id != I40E_DEV_ID_10G_BASE_T_BC) {
+		*tx_counter = rd32(hw, I40E_PRTPM_TLPIC);
+		*rx_counter = rd32(hw, I40E_PRTPM_RLPIC);
+		return I40E_SUCCESS;
+	}
+
 	retval = i40e_aq_run_phy_activity(hw,
 			I40E_AQ_RUN_PHY_ACTIVITY_ACTIVITY_ID_USER_DEFINED,
 			I40E_AQ_RUN_PHY_ACTIVITY_DNL_OPCODE_GET_EEE_STATISTICS,