net: hns3: Fix speed/duplex information loss problem when executing ethtool ethx...
authorFuyun Liang <liangfuyun1@huawei.com>
Fri, 21 Sep 2018 15:41:47 +0000 (16:41 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 22 Sep 2018 02:29:32 +0000 (19:29 -0700)
commit5f373b1585234bb15c7377076d01af2aed62d0a2
treefebb232efedb68264bb0e54d13e99d9c828ce608
parentc136b88425890030d7ba09a8e62abc29ed9b98da
net: hns3: Fix speed/duplex information loss problem when executing ethtool ethx cmd of VF

Our VF has not implemented the ops for get_port_type. So when we executing
ethtool ethx cmd of VF, hns3_get_link_ksettings will return directly. And
we can not query anything.

To support get_link_ksettings for VF, this patch replaces get_port_type
with get_media_type. If the media type is HNAE3_MEDIA_TYPE_NONE,
hns3_get_link_ksettings will return link information of VF.

Fixes: 12f46bc1d447 ("net: hns3: Refine hns3_get_link_ksettings()")
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c