Return-Path: From: Marek Lindner Date: Sun, 13 May 2018 06:02:23 +0800 Message-Id: <20180512220223.3039-1-mareklindner@neomailbox.ch> Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: disable ethtool link speed detection when auto negotiation off List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: b.a.t.m.a.n@lists.open-mesh.org Cc: Marek Lindner If link auto-negotiation is disabled the exported link speed can not be relied on. Signed-off-by: Marek Lindner --- net/batman-adv/bat_v_elp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c index 28687493..fd6fe847 100644 --- a/net/batman-adv/bat_v_elp.c +++ b/net/batman-adv/bat_v_elp.c @@ -127,7 +127,11 @@ static u32 batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh) rtnl_lock(); ret = __ethtool_get_link_ksettings(hard_iface->net_dev, &link_settings); rtnl_unlock(); - if (ret == 0) { + + /* If link auto-negotiation is disabled the exported link speed can + * not be relied on. + */ + if (ret == 0 && link_settings.base.autoneg == AUTONEG_ENABLE) { /* link characteristics might change over time */ if (link_settings.base.duplex == DUPLEX_FULL) hard_iface->bat_v.flags |= BATADV_FULL_DUPLEX; -- 2.17.0