Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3804811imj; Tue, 12 Feb 2019 05:05:18 -0800 (PST) X-Google-Smtp-Source: AHgI3IaP/YB/XBvsgmJsR6+SRokkE+X9a5XJIOi98CDfKNbaORUsYQx3zPRYiKz5BeOKavKMi9Nq X-Received: by 2002:a65:6105:: with SMTP id z5mr3671546pgu.26.1549976718557; Tue, 12 Feb 2019 05:05:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549976718; cv=none; d=google.com; s=arc-20160816; b=Uol4vW/teu7Jzrzy99ODGojtl0F0Y+us21Fwt16Mdtu4nGJPnsCK5Atrau07H2wXbr v+pEwm1jY3EV7cAQeMOyLoSVMWyTiuC6GWUJn/CpiRoAXJ9O/RoO+qUfuvsYUPW9L+KI 0H4w02SroKCoO9DRkJVzsleflW37V2EbFCp7o5pbYEKFkwl4okANZ5fxS1Al6JQeACRy fDmRttQCI8Ly/dEoXEqi6dqPQuWlglSrUiFbKR7I1U79v86noOkZPUnLWBq5jGjas0IW l/pq6vR5Dz6zLSJDaz6N8VrWDF/rqhgWw9ysdaZrWze1uovxGJ3fu12bbYA5QrJdoys2 KnSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=sw8IU+TYplN45/8QQsFeJWdS4KsmAm/XXRW0JzxRFHc=; b=q1G2GvP9JsoubilcH4L+1dBk+Tc0ildqOliT8mBq7DmkjbaUWVIGl6GFwxMikK5Ziu KGmlLZ/P0x8kkLE8IzA+xN+MI98+cHqxHlHqJnvPy3hCy0Mla/QbADu4ZaFoTEL3NWpJ u89+W4UMKnIQXJoQsVdDdMUZmH17HR6I37zxQv1z079OoNIr0MHkB5b6EtgzGtDKkfKE E9QZG09nK8SFGlO3IYeUDmlhLELDX6unaGJhf7QHx02ET3pM5SkDjz8xKcMsAO3S1/Xd wqjwqINmrBk1TBcSOBopxcZEy6yKagzt/rOyhXPihNu/3BRGIzfHBG6ZDDCF/irzyWtn VtYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 39si6341869ple.336.2019.02.12.05.04.55; Tue, 12 Feb 2019 05:05:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729383AbfBLMyU (ORCPT + 99 others); Tue, 12 Feb 2019 07:54:20 -0500 Received: from bmailout3.hostsharing.net ([176.9.242.62]:39763 "EHLO bmailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728413AbfBLMyT (ORCPT ); Tue, 12 Feb 2019 07:54:19 -0500 Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id A57D1100D940B; Tue, 12 Feb 2019 13:54:17 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 5FD43160E04; Tue, 12 Feb 2019 13:54:17 +0100 (CET) Date: Tue, 12 Feb 2019 13:54:17 +0100 From: Lukas Wunner To: Mika Westerberg Cc: linux-kernel@vger.kernel.org, Michael Jamet , Yehezkel Bernat , Andreas Noever , Andy Shevchenko Subject: Re: [PATCH v2 14/28] thunderbolt: Extend tunnel creation to more than 2 adjacent switches Message-ID: <20190212125417.4an7efllnf7pqw2v@wunner.de> References: <20190206131738.43696-1-mika.westerberg@linux.intel.com> <20190206131738.43696-15-mika.westerberg@linux.intel.com> <20190210153328.44ur6o5z2xjae42c@wunner.de> <20190211084558.GU7875@lahna.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190211084558.GU7875@lahna.fi.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 11, 2019 at 10:45:58AM +0200, Mika Westerberg wrote: > On Sun, Feb 10, 2019 at 04:33:28PM +0100, Lukas Wunner wrote: > > at the bottom of this page there's > > a figure showing a PCI tunnel between non-adjacent switches (blue line): > > > > https://developer.apple.com/library/archive/documentation/HardwareDrivers/Conceptual/ThunderboltDevGuide/Basics/Basics.html > > > Are you sure Apple actually uses setup like that? I think I have never > seen such configuration happening on any of the devices I have. Sorry, I don't know if they actually use that. > I can update the changelog to mention that if you think it is useful. > Something like below maybe? > > PCIe actually does not need this as it is typically a daisy chain > between two adjacent switches but this way we do not need to hard-code > creation of the tunnel. LGTM, thanks. > > > + i = 0; > > > + tb_for_each_port(in_port, src, dst) > > > + i++; > > > > This looks more complicated than necessary. Isn't the path length > > always the length of the route string from in_port switch to out_port > > switch, plus 2 for the adapter on each end? Or do paths without > > adapters exist? > > Yes, I think you are right. Simply subtracting the depths of the start and end port's switch also yields the path length. Of course this assumes that tunnels aren't established between non-adjacent switches, but your algorithm doesn't do that. Thanks, Lukas