Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2504067rdb; Wed, 15 Nov 2023 02:41:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHhq7MNDy6TGkF5e54SxxiCiy+CM36IVwadEdyQKS3AF5uEsUd0PAobjU3wPUnxEGKShG2q X-Received: by 2002:a05:6a21:6d8f:b0:180:d81b:660a with SMTP id wl15-20020a056a216d8f00b00180d81b660amr10949663pzb.34.1700044907097; Wed, 15 Nov 2023 02:41:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700044907; cv=none; d=google.com; s=arc-20160816; b=SFQh1DU8F7YXOPmdwAICGvw69e0tmdKuoDo7Ut/KVdNLyX6uiaex+HzwhuthptOA2k SM1DOvHq5cuex+6gH4eCMnfNOR9PA6eMXLJrj74iKvsjVHUajn5bA9gDQ20WHQA9mIPt LnmuWOVXrxOcSGWY8pdBPuEQg/0nsrKTsGKFFNx+X72/vgCLGTVR/0i8kRO44sI0HvNU hxd+BSvjRSSwHT0kpyQoEnh75PmMqZYctA5ShfIjI7sBW8BvIU+TyizCD8IzFkStkuA2 2E0SdcTpYTKw9vcd9XkZefUwYVjl8X8qU5dZDuHF+IRxEQFfjFmMVAVg7d+I9J1SIHh3 fs4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=x1/d9AiVFG5NAWskPnWY4c1aghwDD7VXaEJ8tqkv0Hs=; fh=eDkf9qRBGgl+wvQVLlr99kz2KMG59/pM5gghfGnleMI=; b=WlElMwPIHihvkUHYg2RkelvciKnf5k+ZoyxHcqV8Sis4JEGsIs/HBNTYW9/noYCM/F VfkQMvsYG8Mh041afv2Fku4PyBWsHUY/UluPlCobChxTUsWvDsZMsd/0/9nqalDE0L2M y6UItQJtmfUzZ/j/y08873bCAp9u6zbu+yQNR+iWcUAZc1Q/5quzQqQCiNfvavAkGOYE KRER2i2df3jEnVpsudXGfTvwZn2M4HqEeq5r5BYFPILnfpE0FX9DcUWTUJGWmc/Oy6yX q34xLXGMpDoKe7CTf+/QoEO+zNB6xNkSHjs1RI441Hv3ukA5NF5qRgHemXfmZkxTq1RX HjZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DqAHXMex; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id t1-20020a63a601000000b005c1c5d338a9si2399074pge.658.2023.11.15.02.41.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 02:41:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DqAHXMex; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 2058F807C861; Wed, 15 Nov 2023 02:41:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234875AbjKOKke (ORCPT + 99 others); Wed, 15 Nov 2023 05:40:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234098AbjKOKka (ORCPT ); Wed, 15 Nov 2023 05:40:30 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05C54C2; Wed, 15 Nov 2023 02:40:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700044827; x=1731580827; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=WhUgLMg4fPuk0HcHV6kkPoQlTphUx0dqokHvR43C3OQ=; b=DqAHXMexfBurmC/XzfmKuCx86GMZeLwTWhfh6NI1Tue8xJikvQ7WDI89 wAG/2auxIdgZPwXiA8iVWjCLl4Um1GYfWi+mU+0XB5kSch6/j4K7o9F2Q OQvQhIAH+oPHGjZ74xA9a24VC6FNFPWAQ1n50MLMJHGBOr55lq2P0x4hG ABaqOeKqvss2uxIGxwUw2HLM0LSU2YkO+XOn4cyEfLEIPRAES+4/Ro/SC 5BeHcepThfV/0eplCInxvOE5MYVykHvkibXqcdNSjIy28MO2gkG+CuJ1k Nzu5ta5iot4ir+IU67QyIHFBPRysT4V/TCNNH6tA9Br/NXawTD8JsaVCo w==; X-IronPort-AV: E=McAfee;i="6600,9927,10894"; a="393711582" X-IronPort-AV: E=Sophos;i="6.03,304,1694761200"; d="scan'208";a="393711582" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2023 02:40:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10894"; a="768552987" X-IronPort-AV: E=Sophos;i="6.03,304,1694761200"; d="scan'208";a="768552987" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 15 Nov 2023 02:40:20 -0800 Received: by black.fi.intel.com (Postfix, from userid 1001) id 3653C305; Wed, 15 Nov 2023 12:40:19 +0200 (EET) Date: Wed, 15 Nov 2023 12:40:19 +0200 From: Mika Westerberg To: Mario Limonciello Cc: Karol Herbst , Lyude Paul , Alex Deucher , Christian =?utf-8?B?S8O2bmln?= , Bjorn Helgaas , Lukas Wunner , Danilo Krummrich , David Airlie , Daniel Vetter , Xinhui Pan , "Rafael J . Wysocki" , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , Pali =?utf-8?B?Um9ow6Fy?= , Marek =?utf-8?B?QmVow7pu?= , "Maciej W . Rozycki" , Manivannan Sadhasivam , "open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS" , "open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS" , open list , "open list:RADEON and AMDGPU DRM DRIVERS" , "open list:PCI SUBSYSTEM" , "open list:ACPI" Subject: Re: [PATCH v3 5/7] PCI: ACPI: Detect PCIe root ports that are used for tunneling Message-ID: <20231115104019.GY17433@black.fi.intel.com> References: <20231114200755.14911-1-mario.limonciello@amd.com> <20231114200755.14911-6-mario.limonciello@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231114200755.14911-6-mario.limonciello@amd.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 15 Nov 2023 02:41:03 -0800 (PST) Hi Mario, On Tue, Nov 14, 2023 at 02:07:53PM -0600, Mario Limonciello wrote: > USB4 routers support a feature called "PCIe tunneling". This > allows PCIe traffic to be transmitted over USB4 fabric. > > PCIe root ports that are used in this fashion can be discovered > by device specific data that specifies the USB4 router they are > connected to. For the PCI core, the specific connection information > doesn't matter, but it's interesting to know that this root port is > used for tunneling traffic. This will allow other decisions to be > made based upon it. > > Detect the `usb4-host-interface` _DSD and if it's found save it > into a new `is_virtual_link` bit in `struct pci_device`. While this is fine for the "first" tunneled link, this does not take into account possible other "virtual" links that lead to the endpoint in question. Typically for eGPU it only makes sense to plug it directly to the host but say there is a USB4 hub (with PCIe tunneling capabilities) in the middle. Now the link from the hub to the eGPU that is also "virtual" is not marked as such and the bandwidth calculations may not get what is expected. It should be possible to map the PCIe ports that go over USB4 links through router port operation "Get PCIe Downstream Entry Mapping" and for the Thunderbolt 3 there is the DROM entries (I believe Lukas has patches for this part already) but I guess it is outside of the scope of this series. Out of curiosity I tried to look in Windows documentation if there is such interface for GPUs as we have in Linux but could not find (which does not mean it does not exist, though).