Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp117395ybg; Mon, 8 Jun 2020 18:05:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBspXXNqKTg4GKme1Vkx6S55DMrz+0wpnf3z14H4I5SvVnjhin2RyUFKmy26Cs+h+Fad+o X-Received: by 2002:a50:9a81:: with SMTP id p1mr22842257edb.221.1591664732225; Mon, 08 Jun 2020 18:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591664732; cv=none; d=google.com; s=arc-20160816; b=Ma/wWxh7jhgydg+Cf1IXHWTh5cxDpMlfDHFxwQPnOXt0eyxqcXhSkTx/4Tm9cMkhlx bDMA9e6ijHofK59/Xp3NdEk2J/aaP0BrYPyEZGlYZWYLZqdR3ALhuM1yg8d3NSjUPFxg QDIJk5HJaPGib2qCHdAh9jkBe49opazWpn6DMFzznTqNOxzPnfqta+2GUStdIQ69oIbP m0Lk44vxaZlG7bEwHT/dngyfCiPIKLJMjn3sH3+x5rpL+vZfLulvSDcgpmVCY5WuGLwl MW1M7edj3mQ9zTJPXpPcKxDtN/0UQ2Ax1+0ZksWG+s3JgIhK1V2oOT8ncT0xwu15AGkV clsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nARyNylL9tkuW/DZ3FGoElr6vIGUIn0BqVGfo/1HeUY=; b=zjrT0k9aDETqeHxKg6ZvPUBsy/ET4v8eLpEAC6JLtV33xpYobqJ88eDGYLmolVLxLC iXwWEnhvvTflonhSVgZRvta5ODY7YpwgFaKCXoRrEoyoiVvMe7uI2s1kyuWUtRLt3g4U vyLlghj+K3BMW0S+swiEZ+ZTmTmmBnVoUE7LsZ1bu5O+l1CFMcUrfWB9ju+mQOEEq8J5 zcKMDDLyEVgkGsabvYf21eCgmDhi71NvVOYqd4NCzf0YXrjA3uMwe4KZGFMEen5GA4Kn FVSGZgjH0PgGTbRFzoKsArJvX94G5e4dJT5HnTvPxNL/hS8LEG4F4HWpuy+dTcxyVISK qlbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iofGzeyD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d17si9612710ejh.334.2020.06.08.18.05.08; Mon, 08 Jun 2020 18:05:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iofGzeyD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730566AbgFIBDY (ORCPT + 99 others); Mon, 8 Jun 2020 21:03:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:51970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727955AbgFHXHj (ORCPT ); Mon, 8 Jun 2020 19:07:39 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 681F420872; Mon, 8 Jun 2020 23:07:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657659; bh=gumFx8A5m9fNWLYnCaEu3mPXlkEB5qOQe53IV6HBUdM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iofGzeyDknde6/RtOsP1/LBRNvBoC4KPuuKCtiR4QMJxHx6S+pbisToUxaJ2l2WUa J9eJvBlHyA/A8xsqd6vw4GNHcHV75+b6AA3UoYZKSYTIOJUY5V1qw9cMl6c03uOGVW iTFHNJKbTPJfYOHwe7ZUIR0is15QWxp+U/a1FOvc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sven Eckelmann , Matthias Schiffer , Simon Wunderlich , Sasha Levin , b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 071/274] batman-adv: Revert "disable ethtool link speed detection when auto negotiation off" Date: Mon, 8 Jun 2020 19:02:44 -0400 Message-Id: <20200608230607.3361041-71-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sven Eckelmann [ Upstream commit 9ad346c90509ebd983f60da7d082f261ad329507 ] The commit 8c46fcd78308 ("batman-adv: disable ethtool link speed detection when auto negotiation off") disabled the usage of ethtool's link_ksetting when auto negotation was enabled due to invalid values when used with tun/tap virtual net_devices. According to the patch, automatic measurements should be used for these kind of interfaces. But there are major flaws with this argumentation: * automatic measurements are not implemented * auto negotiation has nothing to do with the validity of the retrieved values The first point has to be fixed by a longer patch series. The "validity" part of the second point must be addressed in the same patch series by dropping the usage of ethtool's link_ksetting (thus always doing automatic measurements over ethernet). Drop the patch again to have more default values for various net_device types/configurations. The user can still overwrite them using the batadv_hardif's BATADV_ATTR_THROUGHPUT_OVERRIDE. Reported-by: Matthias Schiffer Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich Signed-off-by: Sasha Levin --- net/batman-adv/bat_v_elp.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c index 1e3172db7492..955e0b8960d6 100644 --- a/net/batman-adv/bat_v_elp.c +++ b/net/batman-adv/bat_v_elp.c @@ -127,20 +127,7 @@ 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(); - - /* Virtual interface drivers such as tun / tap interfaces, VLAN, etc - * tend to initialize the interface throughput with some value for the - * sake of having a throughput number to export via ethtool. This - * exported throughput leaves batman-adv to conclude the interface - * throughput is genuine (reflecting reality), thus no measurements - * are necessary. - * - * Based on the observation that those interface types also tend to set - * the link auto-negotiation to 'off', batman-adv shall check this - * setting to differentiate between genuine link throughput information - * and placeholders installed by virtual interfaces. - */ - if (ret == 0 && link_settings.base.autoneg == AUTONEG_ENABLE) { + if (ret == 0) { /* link characteristics might change over time */ if (link_settings.base.duplex == DUPLEX_FULL) hard_iface->bat_v.flags |= BATADV_FULL_DUPLEX; -- 2.25.1