net: hns3: use FEC capability queried from firmware
For maintainability and compatibility, add support to use FEC capability queried from firmware. Signed-off-by: Yufeng Mo <moyufeng@huawei.com> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c53d21af67
commit
433ccce835
@ -353,7 +353,9 @@ static void hclge_set_default_capability(struct hclge_dev *hdev)
|
||||
|
||||
set_bit(HNAE3_DEV_SUPPORT_FD_B, ae_dev->caps);
|
||||
set_bit(HNAE3_DEV_SUPPORT_GRO_B, ae_dev->caps);
|
||||
set_bit(HNAE3_DEV_SUPPORT_FEC_B, ae_dev->caps);
|
||||
if (hdev->ae_dev->dev_version == HNAE3_DEVICE_VERSION_V2) {
|
||||
set_bit(HNAE3_DEV_SUPPORT_FEC_B, ae_dev->caps);
|
||||
}
|
||||
}
|
||||
|
||||
static void hclge_parse_capability(struct hclge_dev *hdev,
|
||||
@ -378,6 +380,8 @@ static void hclge_parse_capability(struct hclge_dev *hdev,
|
||||
set_bit(HNAE3_DEV_SUPPORT_UDP_TUNNEL_CSUM_B, ae_dev->caps);
|
||||
if (hnae3_get_bit(caps, HCLGE_CAP_FD_FORWARD_TC_B))
|
||||
set_bit(HNAE3_DEV_SUPPORT_FD_FORWARD_TC_B, ae_dev->caps);
|
||||
if (hnae3_get_bit(caps, HCLGE_CAP_FEC_B))
|
||||
set_bit(HNAE3_DEV_SUPPORT_FEC_B, ae_dev->caps);
|
||||
}
|
||||
|
||||
static __le32 hclge_build_api_caps(void)
|
||||
|
@ -384,6 +384,7 @@ enum HCLGE_CAP_BITS {
|
||||
HCLGE_CAP_HW_PAD_B,
|
||||
HCLGE_CAP_STASH_B,
|
||||
HCLGE_CAP_UDP_TUNNEL_CSUM_B,
|
||||
HCLGE_CAP_FEC_B = 13,
|
||||
};
|
||||
|
||||
enum HCLGE_API_CAP_BITS {
|
||||
|
@ -2889,10 +2889,12 @@ static void hclge_update_link_status(struct hclge_dev *hdev)
|
||||
clear_bit(HCLGE_STATE_LINK_UPDATING, &hdev->state);
|
||||
}
|
||||
|
||||
static void hclge_update_port_capability(struct hclge_mac *mac)
|
||||
static void hclge_update_port_capability(struct hclge_dev *hdev,
|
||||
struct hclge_mac *mac)
|
||||
{
|
||||
/* update fec ability by speed */
|
||||
hclge_convert_setting_fec(mac);
|
||||
if (hnae3_dev_fec_supported(hdev))
|
||||
/* update fec ability by speed */
|
||||
hclge_convert_setting_fec(mac);
|
||||
|
||||
/* firmware can not identify back plane type, the media type
|
||||
* read from configuration can help deal it
|
||||
@ -3012,7 +3014,7 @@ static int hclge_update_port_info(struct hclge_dev *hdev)
|
||||
|
||||
if (hdev->ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V2) {
|
||||
if (mac->speed_type == QUERY_ACTIVE_SPEED) {
|
||||
hclge_update_port_capability(mac);
|
||||
hclge_update_port_capability(hdev, mac);
|
||||
return 0;
|
||||
}
|
||||
return hclge_cfg_mac_speed_dup(hdev, mac->speed,
|
||||
|
Loading…
Reference in New Issue
Block a user