Commit 3e03d7cc authored by Henry Tieman's avatar Henry Tieman Committed by Jeff Kirsher

i40e: Save link FEC info from link up event

Store the FEC status bits from the link up event into the
hw_link_info structure.

Change-ID: I9a7b256f6dfb0dce89c2f503075d0d383526832e
Signed-off-by: default avatarHenry Tieman <henry.w.tieman@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent b3f028fc
...@@ -1838,6 +1838,8 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw, ...@@ -1838,6 +1838,8 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw,
hw_link_info->link_speed = (enum i40e_aq_link_speed)resp->link_speed; hw_link_info->link_speed = (enum i40e_aq_link_speed)resp->link_speed;
hw_link_info->link_info = resp->link_info; hw_link_info->link_info = resp->link_info;
hw_link_info->an_info = resp->an_info; hw_link_info->an_info = resp->an_info;
hw_link_info->fec_info = resp->config & (I40E_AQ_CONFIG_FEC_KR_ENA |
I40E_AQ_CONFIG_FEC_RS_ENA);
hw_link_info->ext_info = resp->ext_info; hw_link_info->ext_info = resp->ext_info;
hw_link_info->loopback = resp->loopback; hw_link_info->loopback = resp->loopback;
hw_link_info->max_frame_size = le16_to_cpu(resp->max_frame_size); hw_link_info->max_frame_size = le16_to_cpu(resp->max_frame_size);
......
...@@ -5272,6 +5272,8 @@ void i40e_print_link_message(struct i40e_vsi *vsi, bool isup) ...@@ -5272,6 +5272,8 @@ void i40e_print_link_message(struct i40e_vsi *vsi, bool isup)
enum i40e_aq_link_speed new_speed; enum i40e_aq_link_speed new_speed;
char *speed = "Unknown"; char *speed = "Unknown";
char *fc = "Unknown"; char *fc = "Unknown";
char *fec = "";
char *an = "";
new_speed = vsi->back->hw.phy.link_info.link_speed; new_speed = vsi->back->hw.phy.link_info.link_speed;
...@@ -5331,8 +5333,23 @@ void i40e_print_link_message(struct i40e_vsi *vsi, bool isup) ...@@ -5331,8 +5333,23 @@ void i40e_print_link_message(struct i40e_vsi *vsi, bool isup)
break; break;
} }
netdev_info(vsi->netdev, "NIC Link is Up %sbps Full Duplex, Flow Control: %s\n", if (vsi->back->hw.phy.link_info.link_speed == I40E_LINK_SPEED_25GB) {
speed, fc); fec = ", FEC: None";
an = ", Autoneg: False";
if (vsi->back->hw.phy.link_info.an_info & I40E_AQ_AN_COMPLETED)
an = ", Autoneg: True";
if (vsi->back->hw.phy.link_info.fec_info &
I40E_AQ_CONFIG_FEC_KR_ENA)
fec = ", FEC: CL74 FC-FEC/BASE-R";
else if (vsi->back->hw.phy.link_info.fec_info &
I40E_AQ_CONFIG_FEC_RS_ENA)
fec = ", FEC: CL108 RS-FEC";
}
netdev_info(vsi->netdev, "NIC Link is Up, %sbps Full Duplex%s%s, Flow Control: %s\n",
speed, fec, an, fc);
} }
/** /**
......
...@@ -184,6 +184,7 @@ struct i40e_link_status { ...@@ -184,6 +184,7 @@ struct i40e_link_status {
enum i40e_aq_link_speed link_speed; enum i40e_aq_link_speed link_speed;
u8 link_info; u8 link_info;
u8 an_info; u8 an_info;
u8 fec_info;
u8 ext_info; u8 ext_info;
u8 loopback; u8 loopback;
/* is Link Status Event notification to SW enabled */ /* is Link Status Event notification to SW enabled */
......
...@@ -158,6 +158,7 @@ struct i40e_link_status { ...@@ -158,6 +158,7 @@ struct i40e_link_status {
enum i40e_aq_link_speed link_speed; enum i40e_aq_link_speed link_speed;
u8 link_info; u8 link_info;
u8 an_info; u8 an_info;
u8 fec_info;
u8 ext_info; u8 ext_info;
u8 loopback; u8 loopback;
/* is Link Status Event notification to SW enabled */ /* is Link Status Event notification to SW enabled */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment