[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>
  • From: "Zhang, Julia" <Julia.Zhang@xxxxxxx>
  • Date: Tue, 17 Dec 2024 05:53:16 +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=kQjo+foXW4GrxqAlNn9I1avTjrdIPXkP5vixCW4C/ro=; b=IcHUGO/vJHOUVJYpUvyRJ4zmzXwjbxhEy/QXpvi/SWpTZtX8b1NsTow0YjA2d8DyoFqsD2Y2sewbz78pk/Dt1AZ+tglSTgOjmxZH/HHvOCYVHPKZRdP+ofWX3+m93pA8rX9ZY6muclmjWRaSOoQEdJ8HqCyN5IE8AaklY0BXx7mlesHROk1+o6J1Ha0vEhKXmuVSDHizdlMYHb36Zlr4vHrDw4/If/NmyaAj95AXhn5WpoqBG4EVisOQPIeEYcDvrN3Vcq/uk4fEfo6a+b3ILSmFDsYjAsV4Fy6xDhzGBuiY6BOzZvFnQA+8bqOnzTiELHl9pKzVij+M6ftw70SGwA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=g6n+44GswTyA57dJlTcX/rn8/lKqzQ0SEOEdkJ12GVdwb/PFFgUKXbuQZjJ0yiggG5nqXOryrZo6ZOoP+gUHqXF5WgbQPSww3Q/lZJS73xoA2/JF43yolg9kcKWHK6PCEIYjSiTKiO0vJTg2dP9MjaNlXHauGtRkyNUetU8X7WWUUiGI8xEjVAFc2pF9MGPFImC9Zaxs50vHu6uZYhkTbT8OI218wwucQbhpeFx38JeG6Jks1weZHD/5FDnOgdxAcSwrMa5wvX/dQpyLlBaCHA+AmkwjIfr2wtqCh6zyrQluvIYDp0kSqhJ0zTOQF1LNjqTzrqXvxnjpJBHyxWupWw==
  • 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: Tue, 17 Dec 2024 05:53:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbSJdDNMdfRsD4vkSvz8Ngpfn4L7LdjBaAgAuOxQD//4svAIAB3fOA
  • Thread-topic: [PATCH] xen: add privcmd ioctl to get p2pdma_distance


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.

> 
>> I will use change __u32 to __u8.
>>
>> By the segment part of the device coordinates, do you mean the domain number 
>> of the device?
> 
> Some call it domain, yes. Since domain has an important-ish different
> meaning in Xen, we prefer segment though.
> 

I see, I will add this info in the struct.

>> All the needed info(virtual bus/slot/function numbers) are from guest VM, 
>> QEMU convert them to real physical info of two devices.
>>
>> Do you mean that I should add more details in commit message or comment?
> 
> Perhaps. Or have the patch be more complete, in the sense of not only
> putting in place stubs, thus actually making visible how the data is
> produced / used.
> 

Sure, I will try to add more details.

Julia

> Jan

 


Rackspace

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