[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>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: "Zhang, Julia" <Julia.Zhang@xxxxxxx>
  • Date: Mon, 16 Dec 2024 08:18:29 +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=645zXlLl0I1RyA5pElv0FV4s04T3SIqtsw3PIadqNrs=; b=p0WAzr8ysK2hIVNRuCVgX8MlOz7N3Z7h3VJVz1ftFEvkMPLvJSQtPtjs7VO2uJUgoRwHlDPoOWtc8Pyd6XvmnXXlgGf4/3Bkm8jBdUJ4IERXQG79lJ4eBpy+4mCNZXLIvIDS+jIk7fABrllzg8EZc6iqx83vSFhUsNz2DwA8oQQ+k1TneKiNdnSeOJJOqbTFzD6SEKOaR8t5jUbwzWpgROIALIQXSJo4Z9c1BKnwLRzoJS5f8t8EttJikRsYicCP1ML8vSN8uNNvkrWVnJg/jL+jcr+pEAcFb7QgYmKya10Z3k10VmQejeoHuauL3xnE9Eh0V/BBn8cM5FVy4ApdCw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QF/CwT3OS/uzWTNW0e2AiZaHGDRKBAb6SoOU3SPZ5usa3Ajnw3o2kD/MzCPQ33g0eQd1WrjgJohlPMC4rN1LBr6revDrvSzswZ92zs18GqtUoUtDUrBhCZdnZGiZpN/slZ/yZqN8HbV5LtpR4yFYSnGM59fmxszEa7pL1gPRw9wFNsE/DbeSrRfpbR4D1AXyVPRhcnfW6hg8vA0305L5gZMv8bWi/+RXJunCTKV95dLsfVfOWf89zJff/hylhiaoDekYdHqbZzdiR0QXyVlEH2go8fBK9YZtQNTdMnKXWe7AIQ9qnoHZSq8J/uJC+u5RfG3GLhLUwHKmLrTITYMIWA==
  • 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>
  • Delivery-date: Mon, 16 Dec 2024 08:18:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbSJdDNMdfRsD4vkSvz8Ngpfn4L7LdjBaAgAuOxQA=
  • Thread-topic: [PATCH] xen: add privcmd ioctl to get p2pdma_distance

 

On 2024/12/9 15:47, Jan Beulich wrote:

On 07.12.2024 11:59, Julia Zhang wrote:
To implement dGPU prime feature, virtgpu driver need to get
p2pdma_distance of two GPU from host side.
 
This adds a new privcmd ioctl to get the real p2pdma_distance of two pci
devices in the host with pci notations sent from guest side.
 
Signed-off-by: Julia Zhang <julia.zhang@xxxxxxx>
 
First - correcting Anthony's email address. He's no longer at Citrix/Cloud.

Thank you for reminding me and correcting it.

 
 
Second, please send patches To: the list, with maintainers on Cc:. (Stefano,
as this isn't the first such issue, can you please try to spread the
knowledge of this across people starting to contribute?) Personally I'd
question the length of the Cc: list of this submission, though. Plus - along
with Roger I was on the To: list here despite not even being maintainer of
any of the files touched.

Sorry for bothering you and I will modify the lists next time. Thanks for reviewing this patch.

 
 
--- 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?

I will use change __u32 to __u8.

By the segment part of the device coordinates, do you mean the domain number of the device?

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?

Julia

 
 
Jan

 


Rackspace

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