Skip to content

Commit 674d959

Browse files
Yisen ZhuangPaolo Abeni
authored andcommitted
net: hns3: fix the port information display when sfp is absent
When sfp is absent or unidentified, the port type should be displayed as PORT_OTHERS, rather than PORT_FIBRE. Fixes: 88d10bd ("net: hns3: add support for multiple media type") Signed-off-by: Yisen Zhuang <yisen.zhuang@huawei.com> Signed-off-by: Jijie Shao <shaojijie@huawei.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent fa55649 commit 674d959

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,9 @@ static int hns3_get_link_ksettings(struct net_device *netdev,
773773
hns3_get_ksettings(h, cmd);
774774
break;
775775
case HNAE3_MEDIA_TYPE_FIBER:
776-
if (module_type == HNAE3_MODULE_TYPE_CR)
776+
if (module_type == HNAE3_MODULE_TYPE_UNKNOWN)
777+
cmd->base.port = PORT_OTHER;
778+
else if (module_type == HNAE3_MODULE_TYPE_CR)
777779
cmd->base.port = PORT_DA;
778780
else
779781
cmd->base.port = PORT_FIBRE;

0 commit comments

Comments
 (0)