[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen: add privcmd ioctl to get p2pdma_distance


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "Zhang, Julia" <Julia.Zhang@xxxxxxx>
  • From: "Zhang, Julia" <Julia.Zhang@xxxxxxx>
  • Date: Wed, 25 Dec 2024 10:23:11 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vXwxYgXhUXyibklzXUKFJjyQ15Y8tgPzIfP7eQWflyo=; b=XHYUkp9juUIvqNYMobcdOWg4SW87RFXQTnGMr++dqaT/Lc8BvVZS2kX8AkMWDgfo1WPYAPO6+WTJ57sJj4p918H5x/tgxlnJ/mhH6toK9V3UMAIDoI78LYyGVKPM5qVhlZ+50ojhvZiM+MVu7C276oR0kntowj2y0FwP9qCiMvI7ven3PZrKzuKe/Toa5QA3MxmORrYu+bBnkrVZ3xiQ0BnpPEwRBHHBrytSB7537pHVOwFTuYr6fbGaEtUOyMPhnt49RH/DH2YmDWg8VUpmdYd15h2Haz/xpmelhXss1FPF8OYJvoSEtQy4rwcl5/IM2uHfpXq0rHKZ6/rJ77upSw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DNw0ZdfBfNrssALkF9ip1krADmwOOPT/zhihKBc++Djo9G2mpVXyjY4QGWLvO6nm/3oTIrrDRAqxcLBq/vVGUKnvAG4VuZ3vb5EJ3lmX3Tp+2NHsGibDDBcp1Ix+1lfzoyEGNfpEEtQso29WTpK83u1g+k235JP3uofI2J2NGq/O9uljdRHIza0am+X0adzPojcNrBjeUXaX2bdumGtL4G5GMpSNtai6+TUYo8jxhvs+N+itLwKnIH+zeL7U6OMwr94H0SbGLbEURssya7Aw7/lWi8B+FYeo4H02RUUELNQuIqQf5AnvHOh6bZ9wBiwDruUZMkfK5yDcsTl2OQG5ag==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "Deucher, Alexander" <Alexander.Deucher@xxxxxxx>, "Koenig, Christian" <Christian.Koenig@xxxxxxx>, Xenia Ragiadakou <burzalodowa@xxxxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>, "Huang, Ray" <Ray.Huang@xxxxxxx>, "Penny, Zheng" <penny.zheng@xxxxxxx>, "Zhu, Lingshan" <Lingshan.Zhu@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, "Edgar E . Iglesias" <edgar.iglesias@xxxxxxxxx>, "Michael S . Tsirkin" <mst@xxxxxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Wed, 25 Dec 2024 10:23:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbSJdDNMdfRsD4vkSvz8Ngpfn4L7LdjBaAgAuOxQD//4svAIAB3fOA//+tJwCADTGaAA==
  • Thread-topic: [PATCH] xen: add privcmd ioctl to get p2pdma_distance


On 2024/12/17 16:53, Jan Beulich wrote:
> On 17.12.2024 06:53, Zhang, Julia wrote:
>>
>>
>> On 2024/12/16 17:19, Jan Beulich wrote:
>>> On 16.12.2024 09:18, Zhang, Julia wrote:
>>>> On 2024/12/9 15:47, Jan Beulich wrote:
>>>> On 07.12.2024 11:59, Julia Zhang wrote:
>>>
>>> Yet another formality, sorry: Please send plain text emails. You'll note 
>>> that what
>>> I said and why you said is indistinguishably intermixed below.
>>
>> Thanks for reminding.
>>
>>>
>>>> --- a/tools/include/xen-sys/Linux/privcmd.h
>>>>
>>>> +++ b/tools/include/xen-sys/Linux/privcmd.h
>>>>
>>>> @@ -110,6 +110,16 @@ typedef struct privcmd_map_hva_to_gpfns {
>>>>
>>>>      int add_mapping;
>>>>
>>>>    } privcmd_map_hva_to_gpfns_t;
>>>>
>>>>
>>>>
>>>> +typedef struct privcmd_p2pdma_distance {
>>>>
>>>> +  __u32 provider_bus;
>>>>
>>>> +  __u32 provider_slot;
>>>>
>>>> +  __u32 provider_func;
>>>>
>>>> +  __u32 client_bus;
>>>>
>>>> +  __u32 client_slot;
>>>>
>>>> +  __u32 client_func;
>>>>
>>>> +  __u32 distance;
>>>>
>>>> +} privcmd_p2pdma_distance_t;
>>>>
>>>>
>>>>
>>>> "Distance" typically is a symmetric thing. Why the asymmetry here? And
>>>>
>>>> why __u32 when __u8 will be fine for most fields? And where's the segment
>>>>
>>>> part of the device coordinates? Finally, with it being merely stub
>>>>
>>>> implementations that you add here, all details on where the needed info
>>>>
>>>> is to come from are missing.
>>>>
>>>> "Distance" is p2pdma-distance between two PCI devices, it's calculated in 
>>>> kernel driver.I don't get why it's symmetric?
>>>
>>> Distance from A to B is usually the same as that from B to A. But yes,
>>> not necessarily always (thinking of e.g. rings). Yet still I'm unclear
>>> about the distinction between provide and client.
>>
>> Provider - A driver which provides or publishes P2P resources.
>> Client - A driver which makes use of a resource.
>>
>> In our case, we want to use passthrough dGPU render data, and virtio
>> iGPU display data. So dGPU need to import display buffer of iGPU. iGPU
>> is provider and dGPU is client.
> 
> Right, but: Is this arrangement relevant for the new ioctl? Aren't
> you simply after the distance between two devices, of which your
> provider/client model is merely a special case?

The logic of this ioctl about provider/client is totally followed 
pci_p2pdma_distance() of kernel. So I think our case is not a special case.

Julia
> 
> Jan

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.