From patchwork Sat Nov 21 00:26:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 547104 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id 5EA9714149A for ; Sat, 21 Nov 2015 11:26:29 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b=Ye/8pzJo; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 60EC710776; Fri, 20 Nov 2015 16:26:27 -0800 (PST) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 6A09010775 for ; Fri, 20 Nov 2015 16:26:26 -0800 (PST) Received: from bar2.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id BCFA2420168 for ; Fri, 20 Nov 2015 17:26:24 -0700 (MST) X-ASG-Debug-ID: 1448065583-03dc537b3d0a910001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar2.cudamail.com with ESMTP id IKrCypB3CrQiMDqu (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 20 Nov 2015 17:26:23 -0700 (MST) X-Barracuda-Envelope-From: simon.horman@netronome.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO mail-pa0-f47.google.com) (209.85.220.47) by mx1-pf2.cudamail.com with ESMTPS (RC4-SHA encrypted); 21 Nov 2015 00:26:23 -0000 Received-SPF: none (mx1-pf2.cudamail.com: domain at netronome.com does not designate permitted sender hosts) X-Barracuda-RBL-Trusted-Forwarder: 209.85.220.47 Received: by pacdm15 with SMTP id dm15so131212238pac.3 for ; Fri, 20 Nov 2015 16:26:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=YcXwFrrbQchZiD5Usd7PzPnx1T5abI14HxYNGs1jq4c=; b=Ye/8pzJoZnT7rkrDNNerJcwr4HRgOjo6k7YGtlEho/e5kTt8caAFgcttyznSJzetVD yuruCpEiadVFMtAQdNpX3P8gyjdt6wYHaxFZx0kKnFWRuO7EWqzgwORwQ2szhC9yxslC ZzUvYbSu18hDq2RG44n8UCaBP2N97KvmKcDsv1jlJxTTHx9REaWhBTbRpEPB5Pxvl2WL w7l3Lv+AtFoM+xnl7LpZS9W6NTm4e5WUTsZDqkvu0iialHUFqyzLuBRXbvKQFHwjqSn8 N3wCGzG4ikneBMvUZKYaQIMPxJAw7RKoowX7f3rRlUB3fn6boQLdBqYLer8DTCxrqxR4 Jmxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=YcXwFrrbQchZiD5Usd7PzPnx1T5abI14HxYNGs1jq4c=; b=dEbhkur7vUVJ9A2p/1NPvEdDL57UqPcx3zGu93o4eFj+XyK+dDdYOFziuOphA8rXE2 TrVgE/wMeyVtB6Tzq8gcJ2+yv2GSMZrC/iPLO0eViT8An+WmlcwqOKoolMbExsIDXe/3 4QgFchp+KneEfk8g6AU4MYmCTY1dVA9TdXURCXDLYPDT7y1JUbTx2OOq8est3J8tLXh3 DbXaWOlZITkqZWGVQcQFnpQYXgL8MOsamtVbFrWHUfr/vVhLHLp8VyhfepvuVIko5Vbf rOjW0fHLusS9KFWKVusBQfQ5oi55QO9+q7awb5IFt2EzGBjhBsUpFOWuPYivTkEPE7b/ 8lJQ== X-Gm-Message-State: ALoCoQmD6Q/Vr4e+dN8zJj6+Km2uKF3/UAppNWDd14KHTshlyuDtM7X43CGsDxfytgT30Vqlr2hR X-Received: by 10.68.215.67 with SMTP id og3mr22895862pbc.30.1448065582516; Fri, 20 Nov 2015 16:26:22 -0800 (PST) Received: from penelope.netronome.com (adsl-68-251-138-17.dsl.covlil.ameritech.net. [68.251.138.17]) by smtp.gmail.com with ESMTPSA id qk7sm1140812pbb.80.2015.11.20.16.26.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Nov 2015 16:26:21 -0800 (PST) X-CudaMail-Envelope-Sender: simon.horman@netronome.com X-Barracuda-Apparent-Source-IP: 68.251.138.17 From: Simon Horman To: dev@openvswitch.org X-CudaMail-MID: CM-E2-1119084693 X-CudaMail-DTE: 112015 X-CudaMail-Originating-IP: 209.85.220.47 Date: Fri, 20 Nov 2015 16:26:12 -0800 X-ASG-Orig-Subj: [##CM-E2-1119084693##][PATCH] netdev-linux: correctly detect port speed bits beyond 16bit Message-Id: <1448065572-23160-1-git-send-email-simon.horman@netronome.com> X-Mailer: git-send-email 2.1.4 X-GBUdb-Analysis: 0, 209.85.220.47, Ugly c=0.443535 p=-0.594595 Source Normal X-MessageSniffer-Rules: 0-0-0-4877-c X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1448065583 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using per-user scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, DKIM_SIGNED, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.24585 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Cc: Simon Horman Subject: [ovs-dev] [PATCH] netdev-linux: correctly detect port speed bits beyond 16bit X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" This includes bits for: * Backplane * 1000 baseKX (full duplex) * All speeds of 10Gbit and above other than 10000 baseT (full duplex). Signed-off-by: Simon Horman --- * ethtool_cmd_speed() is a trivial provided by Linux kernel headers. It was introduced in 2.6.27. The source file in question is only compiled when building for a Linux host. I am unsure of that compatibility considerations are regarding Linux kernel versions and OVS user-space code. --- lib/netdev-linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 584e804b6c8a..9ce1e29ecf15 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -1849,7 +1849,7 @@ netdev_linux_read_features(struct netdev_linux *netdev) } /* Current settings. */ - speed = ecmd.speed; + speed = ethtool_cmd_speed(&ecmd); if (speed == SPEED_10) { netdev->current = ecmd.duplex ? NETDEV_F_10MB_FD : NETDEV_F_10MB_HD; } else if (speed == SPEED_100) {