From: Guinan Sun <guinanx.sun@intel.com>
To: dev@dpdk.org
Cc: Jeff Guo <jia.guo@intel.com>, Beilei Xing <beilei.xing@intel.com>,
Guinan Sun <guinanx.sun@intel.com>,
Dawid Lukwinski <dawid.lukwinski@intel.com>
Subject: [dpdk-dev] [PATCH v2 5/7] net/i40e/base: add EEE LPI status check for X722 adapters
Date: Sat, 12 Sep 2020 03:00:37 +0000 [thread overview]
Message-ID: <20200912030039.55273-6-guinanx.sun@intel.com> (raw)
In-Reply-To: <20200912030039.55273-1-guinanx.sun@intel.com>
Add reading LPI (low power idle) status for supported X722 devices.
If adapter's PHY supports EEE in current mode (device ID + link speed),
LPI status is read from PHY Clause 45 PCS status register.
Signed-off-by: Dawid Lukwinski <dawid.lukwinski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
---
drivers/net/i40e/base/i40e_common.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
index cd8b27e40..3be944e84 100644
--- a/drivers/net/i40e/base/i40e_common.c
+++ b/drivers/net/i40e/base/i40e_common.c
@@ -7098,15 +7098,23 @@ enum i40e_status_code i40e_get_phy_lpi_status(struct i40e_hw *hw,
struct i40e_hw_port_stats *stat)
{
enum i40e_status_code ret = I40E_SUCCESS;
+ bool eee_mrvl_phy;
+ bool eee_bcm_phy;
u32 val;
stat->rx_lpi_status = 0;
stat->tx_lpi_status = 0;
- if ((hw->device_id == I40E_DEV_ID_10G_BASE_T_BC ||
- hw->device_id == I40E_DEV_ID_5G_BASE_T_BC) &&
- (hw->phy.link_info.link_speed == I40E_LINK_SPEED_2_5GB ||
- hw->phy.link_info.link_speed == I40E_LINK_SPEED_5GB)) {
+ eee_bcm_phy =
+ (hw->device_id == I40E_DEV_ID_10G_BASE_T_BC ||
+ hw->device_id == I40E_DEV_ID_5G_BASE_T_BC) &&
+ (hw->phy.link_info.link_speed == I40E_LINK_SPEED_2_5GB ||
+ hw->phy.link_info.link_speed == I40E_LINK_SPEED_5GB);
+ eee_mrvl_phy =
+ hw->device_id == I40E_DEV_ID_1G_BASE_T_X722;
+
+ if (eee_bcm_phy || eee_mrvl_phy) {
+ /* read Clause 45 PCS Status 1 register */
ret = i40e_aq_get_phy_register(hw,
I40E_AQ_PHY_REG_ACCESS_EXTERNAL,
I40E_BCM_PHY_PCS_STATUS1_PAGE,
--
2.17.1
next prev parent reply other threads:[~2020-09-12 3:20 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-05 2:49 [dpdk-dev] [PATCH 0/9] update i40e base code Guinan Sun
2020-09-05 2:49 ` [dpdk-dev] [PATCH 1/9] net/i40e/base: add VLAN field for input set Guinan Sun
2020-09-07 11:09 ` Ferruh Yigit
2020-09-05 2:49 ` [dpdk-dev] [PATCH 2/9] net/i40e/base: update FW API version Guinan Sun
2020-09-07 11:10 ` Ferruh Yigit
2020-09-05 2:49 ` [dpdk-dev] [PATCH 3/9] net/i40e/base: enable pipe monitor thresholds Guinan Sun
2020-09-07 11:11 ` Ferruh Yigit
2020-09-05 2:49 ` [dpdk-dev] [PATCH 4/9] net/i40e/base: fix missing function header arguments Guinan Sun
2020-09-08 8:03 ` Yang, Qiming
2020-09-05 2:49 ` [dpdk-dev] [PATCH 5/9] net/i40e/base: add support for minimum rollback revision Guinan Sun
2020-09-05 2:49 ` [dpdk-dev] [PATCH 6/9] net/i40e/base: fix Rx only for unicast promisc on VLAN Guinan Sun
2020-09-05 2:49 ` [dpdk-dev] [PATCH 7/9] net/i40e/base: add EEE LPI status check for X722 adapters Guinan Sun
2020-09-05 2:49 ` [dpdk-dev] [PATCH 8/9] net/i40e/base: fix PHY config param when enabling EEE Guinan Sun
2020-09-05 2:49 ` [dpdk-dev] [PATCH 9/9] net/i40e/base: update version Guinan Sun
2020-09-07 6:27 ` [dpdk-dev] [PATCH 0/9] update i40e base code Zhang, Qi Z
2020-09-12 3:00 ` [dpdk-dev] [PATCH v2 0/7] " Guinan Sun
2020-09-12 3:00 ` [dpdk-dev] [PATCH v2 1/7] net/i40e/base: update FW API version Guinan Sun
2020-09-12 3:00 ` [dpdk-dev] [PATCH v2 2/7] net/i40e/base: fix missing function header arguments Guinan Sun
2020-09-12 3:00 ` [dpdk-dev] [PATCH v2 3/7] net/i40e/base: add support for minimum rollback revision Guinan Sun
2020-09-12 3:00 ` [dpdk-dev] [PATCH v2 4/7] net/i40e/base: fix Rx only for unicast promisc on VLAN Guinan Sun
2020-09-12 3:00 ` Guinan Sun [this message]
2020-09-12 3:00 ` [dpdk-dev] [PATCH v2 6/7] net/i40e/base: fix PHY config param when enabling EEE Guinan Sun
2020-09-12 3:00 ` [dpdk-dev] [PATCH v2 7/7] net/i40e/base: update version Guinan Sun
2020-09-13 1:56 ` [dpdk-dev] [PATCH v2 0/7] update i40e base code Zhang, Qi Z
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200912030039.55273-6-guinanx.sun@intel.com \
--to=guinanx.sun@intel.com \
--cc=beilei.xing@intel.com \
--cc=dawid.lukwinski@intel.com \
--cc=dev@dpdk.org \
--cc=jia.guo@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).