Commit 21d529d5 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

nfp: report link speed from NSP

On the PF prefer the link speed value provided by the NSP.
Refresh port table if needed.
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: default avatarSimon Horman <simon.horman@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 172f638c
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include "nfpcore/nfp.h" #include "nfpcore/nfp.h"
#include "nfpcore/nfp_nsp_eth.h"
#include "nfp_net_ctrl.h" #include "nfp_net_ctrl.h"
#include "nfp_net.h" #include "nfp_net.h"
...@@ -205,6 +206,16 @@ nfp_net_get_link_ksettings(struct net_device *netdev, ...@@ -205,6 +206,16 @@ nfp_net_get_link_ksettings(struct net_device *netdev,
if (!netif_carrier_ok(netdev)) if (!netif_carrier_ok(netdev))
return 0; return 0;
/* Use link speed from ETH table if available, otherwise try the BAR */
if (nn->eth_port && nfp_net_link_changed_read_clear(nn))
nfp_net_refresh_port_config(nn);
/* Separate if - on FW error the port could've disappeared from table */
if (nn->eth_port) {
cmd->base.speed = nn->eth_port->speed;
cmd->base.duplex = DUPLEX_FULL;
return 0;
}
sts = nn_readl(nn, NFP_NET_CFG_STS); sts = nn_readl(nn, NFP_NET_CFG_STS);
ls = FIELD_GET(NFP_NET_CFG_STS_LINK_RATE, sts); ls = FIELD_GET(NFP_NET_CFG_STS_LINK_RATE, sts);
......
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