From owner-svn-src-head@freebsd.org Sun Jul 8 16:23:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 112411037B7C for ; Sun, 8 Jul 2018 16:23:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FCBB7CA43 for ; Sun, 8 Jul 2018 16:23:53 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x229.google.com with SMTP id z19-v6so14972949ioh.4 for ; Sun, 08 Jul 2018 09:23:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=hqqhprhJAAx2GoL9sqZrDmcwDDcvDFtQoyxq6msTHBY=; b=0dnwD+qJpFdy6fHClUQYK+HFQFMmsxVLXiQP8DUIXv1nCINiNZ/fEPQlLsnmmOJhUr w8aRdUW2xGYO8qSD4PVjcuYY1QuLxMeEqzc3pbPJDHsGfNpB4pgrU3e9utpqpVn9s+Fk z3+Vy7/7Ck15pr/IVpxDsO6solYWuyjT8Xa+QXTyYrB3vIvqHSn+PGmJpQuxmoCYePRJ lzpczlOKhwWUem8FCaMyaRXKCmk4o17wUKmOI2lIHgf/8dP6qo3vIpRp99a/9N/gJIk3 UBuL+KLZxjSc81mDQbUHqTgxEKTGZb3G7Cg05homotDtjgTTl3GUZn/DxANiRqrqk4v9 AOyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=hqqhprhJAAx2GoL9sqZrDmcwDDcvDFtQoyxq6msTHBY=; b=tcxhu9yjHYG2EKd2zY2I3Zs1Bo4dFSH1hmH2uR4IOabphEfu3ZpMKgaryzfYUc88rn HLTyx8w9tzqgq3DdtmUwBg22Sv/+yDne7vC2R/lK70dnaI+qAJQe9wn1PbDxb0DFa81X 8ocYTk613nOY/euXaAGyIODo9SnYVJKFVbpCdhnSRhbhhHWLskx4J+/vycBkQMm9drKG qO9bsESqZnq4v9EP5fDhcUWbLkW25KBnhfx1uh+y8QdQTvf7Q0e3M6AOXfthP8YP1zze jBcHIB/1Kc3Sdpgl+pKuRMGNls6LDvrtnrZsAsUTfHWtv2nhSD0Fy3weQJGcGmqPrNke H2jw== X-Gm-Message-State: APt69E1LIyXMeAhfFPWvGud4YYXZNh+w/ZiK/VH9kEnxjMo8uJfOybxn wcN7wR7FEMYD+GeRzohwseIFzyIGz9Zy1weVrDu8uw== X-Google-Smtp-Source: AAOMgpdkSdEazlNhTiG/VXUzoCpkI38VskA/V0+HE4LfIc6mO3z0bdH9ujxtsA0g19c9KKb1QDaSiNZX87ktQlpADgs= X-Received: by 2002:a6b:d40c:: with SMTP id l12-v6mr14887767iog.37.1531067032806; Sun, 08 Jul 2018 09:23:52 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:1183:0:0:0:0:0 with HTTP; Sun, 8 Jul 2018 09:23:52 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180708161415.GD18193@pesky> References: <201806091447.w59ElnpU026396@repo.freebsd.org> <20180707174351.GA95934@pesky> <20180708152621.GB18193@pesky> <5483bcd6-f3bc-8b78-ee51-3bf3c2a1c2da@freebsd.org> <20180708161415.GD18193@pesky> From: Warner Losh Date: Sun, 8 Jul 2018 10:23:52 -0600 X-Google-Sender-Auth: -b7HnerTbMTmQ8ODW49Qkru1TJY Message-ID: Subject: Re: svn commit: r334880 - head/sys/dev/vnic To: Mark Johnston Cc: Sean Bruno , Andrew Turner , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2018 16:23:54 -0000 On Sun, Jul 8, 2018 at 10:14 AM, Mark Johnston wrote: > On Sun, Jul 08, 2018 at 09:58:35AM -0600, Warner Losh wrote: > > On Sun, Jul 8, 2018 at 9:55 AM, Sean Bruno wrote: > > > > > > > > > > > On 07/08/18 09:26, Mark Johnston wrote: > > > > On Sun, Jul 08, 2018 at 09:10:27AM -0600, Sean Bruno wrote: > > > >> > > > >> > > > >> On 07/07/18 11:43, Mark Johnston wrote: > > > >>> On Sat, Jun 09, 2018 at 02:47:49PM +0000, Andrew Turner wrote: > > > >>>> Author: andrew > > > >>>> Date: Sat Jun 9 14:47:49 2018 > > > >>>> New Revision: 334880 > > > >>>> URL: https://svnweb.freebsd.org/changeset/base/334880 > > > >>>> > > > >>>> Log: > > > >>>> In the ThunderX BGX network driver we were skipping the NULL > > > terminator > > > >>>> when parsing the phy type, however this is included in the > length > > > returned > > > >>>> by OF_getprop. To fix this stop ignoring the terminator. > > > >>>> > > > >>>> PR: 228828 > > > >>>> Reported by: sbruno > > > >>>> Sponsored by: DARPA, AFRL > > > >>> > > > >>> This seems to break vnic on packet.net ThunderXs. In particular, > VF > > > >>> creation fails. It seems the problem in my case is that there are > > > >>> multiple PHY devices in the device tree, e.g., xfi@0, xfi@1. With > > > this > > > >>> change, bgx_fdt_phy_name_match() fails to match against any device > > > >>> containing a unit address in the node name. > > > >>> > > > >> > > > >> > > > >> Huh ... this was *required* to get the ThunderXs we have in the > FreeBSD > > > >> cluster to work at all. o.0 > > > >> > > > >> I guess "someone" needs to contact "someone" to figure out which is > > > >> correct or we need to replace our FreeBSD cluster machines with ones > > > >> that work like the packet.net machines? > > > > > > > > I think the current code works fine if there's only one PHY device, > so > > > > my problem is probably just the result of having a different hardware > > > > setup. We can probably fix the code to handle both cases. Could you > > > > mail me the output of "ofwdump -ap" from the cluster machine? > > > > > > > > > > > > > > > > > I dropped the output here: > > > https://people.freebsd.org/~sbruno/ofwdump.txt > > > > > > Ian's method is better. But Ian's question is better: are there not > > phandles to find this stuff? Names in FDT are kinda meaningless most of > the > > time (I say kinda here to gloss over a laundry list of exceptions that > PHY > > finding typically does not fall into). > > Sean's output shows why the current code works for him. In my case the > bgx subnodes don't contain a qlm-mode property, so we're falling back to > name matching: > > Node 0x891c: bgx0 > #address-cells: > 00 00 00 01 > #size-cells: > 00 00 00 00 > reg: > 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > Node 0x8ad8: xfi@0 > reg: > 00 00 00 00 > local-mac-address: > fc 15 b4 97 48 b7 > phy-handle: > 00 00 00 75 > Node 0x8b34: xfi@1 > reg: > 00 00 00 01 > local-mac-address: > fc 15 b4 97 48 b8 > phy-handle: > 00 00 00 76 > > Being unfamiliar with FDT, could I ask you to explain how the code could > be using phandles to find the PHYs? > Allwinner provides a good example, and says it in code better than I could quickly summarize: static phandle_t awg_get_phy_node(device_t dev) { phandle_t node; pcell_t phy_handle; node = ofw_bus_get_node(dev); if (OF_getencprop(node, "phy-handle", (void *)&phy_handle, sizeof(phy_handle)) <= 0) return (0); return (OF_node_from_xref(phy_handle)); } Warner