{"id":2215643,"url":"http://patchwork.ozlabs.org/api/covers/2215643/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/cover/20260324234615.3731237-1-zhipingz@meta.com/","project":{"id":28,"url":"http://patchwork.ozlabs.org/api/projects/28/?format=json","name":"Linux PCI development","link_name":"linux-pci","list_id":"linux-pci.vger.kernel.org","list_email":"linux-pci@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260324234615.3731237-1-zhipingz@meta.com>","list_archive_url":null,"date":"2026-03-24T23:46:01","name":"[RFC,v2,0/2] Retrieve tph from dmabuf for PCIe P2P memory access","submitter":{"id":92088,"url":"http://patchwork.ozlabs.org/api/people/92088/?format=json","name":"Zhiping Zhang","email":"zhipingz@meta.com"},"mbox":"http://patchwork.ozlabs.org/project/linux-pci/cover/20260324234615.3731237-1-zhipingz@meta.com/mbox/","series":[{"id":497360,"url":"http://patchwork.ozlabs.org/api/series/497360/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/list/?series=497360","date":"2026-03-24T23:46:02","name":"Retrieve tph from dmabuf for PCIe P2P memory access","version":2,"mbox":"http://patchwork.ozlabs.org/series/497360/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/covers/2215643/comments/","headers":{"Return-Path":"\n <linux-pci+bounces-50998-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pci@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=meta.com header.i=@meta.com header.a=rsa-sha256\n header.s=s2048-2025-q2 header.b=CdOCU4Nn;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-50998-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=meta.com header.i=@meta.com\n header.b=\"CdOCU4Nn\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=67.231.145.42","smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=meta.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=meta.com"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fgRfN66PZz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 10:52:12 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id CC5DD30AD490\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 24 Mar 2026 23:52:06 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 0C9CB2E8B98;\n\tTue, 24 Mar 2026 23:52:06 +0000 (UTC)","from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com\n [67.231.145.42])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id BFE0E29D28F\n\tfor <linux-pci@vger.kernel.org>; Tue, 24 Mar 2026 23:52:04 +0000 (UTC)","from pps.filterd (m0109333.ppops.net [127.0.0.1])\n\tby mx0a-00082601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 62OLL7XT1433028\n\tfor <linux-pci@vger.kernel.org>; Tue, 24 Mar 2026 16:52:04 -0700","from maileast.thefacebook.com ([163.114.135.16])\n\tby mx0a-00082601.pphosted.com (PPS) with ESMTPS id 4d42eysha9-2\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)\n\tfor <linux-pci@vger.kernel.org>; Tue, 24 Mar 2026 16:52:04 -0700 (PDT)","from twshared22445.03.snb1.facebook.com (2620:10d:c0a8:1c::1b) by\n mail.thefacebook.com (2620:10d:c0a9:6f::237c) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.2.2562.35; Tue, 24 Mar 2026 23:51:52 +0000","by devbig259.ftw1.facebook.com (Postfix, from userid 664516)\n\tid B181C1D7CEBE; Tue, 24 Mar 2026 16:46:15 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774396325; cv=none;\n b=sH89sU74ubhoWMq9m1OLplMztC9uxN2os/cDW8HusqTZ7eDqulpiNLavtMj3doa3yUoeLTJcqFDV4FAoqCjkMlcDeFNi19zx2KPgFHaQ6PaeclQqy2KOh4q2QC9Barj1PklfN2N5lq3U+XFZtyMM0SMnAp0vugBc3LsA18I26JI=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774396325; c=relaxed/simple;\n\tbh=O5GME2cuVxChwrcJ1TC22wMeIZDwNl2gWemTSjB0vcc=;\n\th=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type;\n b=o0O16KyEXc1Vv1i/1UUeYhTuYrRzCydvf9qG+J40nUXVXmmbbs0TaYJgV/XWzHe/AIShZRB82TH0ik3rYz7lQWxNHAE9cRAUoLdoYhBSIceso/5FZedV2J6A/0a3skSMuP3Le19ZevWok7lJrhJFmoIHyXQq/GTTHyv/qYc9TPs=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=meta.com;\n spf=pass smtp.mailfrom=meta.com;\n dkim=pass (2048-bit key) header.d=meta.com header.i=@meta.com\n header.b=CdOCU4Nn; arc=none smtp.client-ip=67.231.145.42","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=cc\n\t:content-transfer-encoding:content-type:date:from:message-id\n\t:mime-version:subject:to; s=s2048-2025-q2; bh=GTcNfaIvTV9CCY4TmT\n\tn6enDItgoZyUnkmTMnvSeTAAU=; b=CdOCU4NndSVgN7zKgckJpgtavyWE3HGGBo\n\tw0ZNInhRdhfx+BxwqlhVlGDGV4taks4QDuIJG5B5A+TVmUmih4moBce6gRIXlZ9R\n\tnlH9QI+MQOc0sEbqFwRMi78q6Jcm8EBjfWkMgojEMU4v4knh7rmzpDMOFuTYMM9I\n\ttwBFxtrnbnnCymOojZFLr3UrKRg3mkhv4OTXwdFfcxJICeogrS5eANvzgjjMQkIK\n\t+q6K0fkL1zMPFCYURkJLNPtbHygVneLNgy7NjiP7l//Pdeo6bjqVxQ8YHTvLizIE\n\t6f+ZI5WJeroXRgpfiYSwBrWxyM6aZkfBjWmCXPKGF6TuYUXjuuzA==","From":"Zhiping Zhang <zhipingz@meta.com>","To":"Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,\n        Bjorn\n Helgaas <bhelgaas@google.com>, <linux-rdma@vger.kernel.org>,\n        <linux-pci@vger.kernel.org>, <netdev@vger.kernel.org>,\n        <dri-devel@lists.freedesktop.org>, Keith Busch <kbusch@kernel.org>,\n        Yochai\n Cohen <yochai@nvidia.com>, Yishai Hadas <yishaih@nvidia.com>","CC":"Bjorn Helgaas <helgaas@kernel.org>, Zhiping Zhang <zhipingz@meta.com>","Subject":"[RFC v2 0/2] Retrieve tph from dmabuf for PCIe P2P memory access","Date":"Tue, 24 Mar 2026 16:46:01 -0700","Message-ID":"<20260324234615.3731237-1-zhipingz@meta.com>","X-Mailer":"git-send-email 2.52.0","Precedence":"bulk","X-Mailing-List":"linux-pci@vger.kernel.org","List-Id":"<linux-pci.vger.kernel.org>","List-Subscribe":"<mailto:linux-pci+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pci+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","X-FB-Internal":"Safe","Content-Type":"text/plain","X-Authority-Analysis":"v=2.4 cv=adxsXBot c=1 sm=1 tr=0 ts=69c323a4 cx=c_pps\n a=MfjaFnPeirRr97d5FC5oHw==:117 a=MfjaFnPeirRr97d5FC5oHw==:17\n a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=7x6HtfJdh03M6CCDgxCd:22\n a=tpM8CJlwf7uhpglF1g9U:22 a=zJhtDeQ-gK41YlDc0VgA:9","X-Proofpoint-ORIG-GUID":"KSFq0-ZdOYQ7K4JkXczckkYuq-Gbkwi0","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwMzI0MDE4NCBTYWx0ZWRfX9PrOzKgR+ytk\n IjwxSNPxqQKPtuIb0yhvWBVqdU90BFk2YBNLgfRI1IJWdNlpuJRDgVS4gjpkI9nOD9tJJo5/eJR\n 6yggKRODyG3qiahcdf8HTr01Stjuop9Laz5NIEiuGqpIuN/n9xgHVYqiOMPWmXW448jR33IHzS1\n L1fqPHSXA/OeMOI96mmLe75DUunrhSLrLX40wkSes2drHyOvoHn7WhK5NqErKOGBQnkBbFjGdw+\n UoeGlxSZMyINdNpsfTnKnVNP7DU6C+i1Rkz42Eg7OqMtMxoENPRdIU6hXu58yZdPqHHhTbW1XKZ\n 2SVZwnnbWzpVuqr1xL59CDD8UA7TdV8HVCuMmFumRIGd6xaubY40D+CdlaFSZJ1cpD7yQRuTT0u\n 2IB3PfXfXi8vKzyUfjEguc/0qfwcFigDZUys24T40HUsuExRt9exmq4KjLHCvkT7E6yFc8NLWGT\n SK/kTqIc/tUC36VeU8Q==","X-Proofpoint-GUID":"KSFq0-ZdOYQ7K4JkXczckkYuq-Gbkwi0","X-Proofpoint-Virus-Version":"vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-03-24_04,2026-03-24_01,2025-10-01_01"},"content":"Currently, the steering tag can be used for a CPU on the motherboard; the\nACPI check is in place to query and obtain the supported tph settings. Here\nwe intend to use the tph info to improve RDMA NIC memory access on a vfio-based\naccelerator device via PCIe peer-to-peer. When an application registers a\nRDMA memory region with DMABUF for the RDMA NIC to access the device memory,\nthe tph info of the memory region can be retrieved and used to set the\nsteering tag / process hint (ph). Additional instructions or hints can be\npassed to the GPU or accelerator device for advanced memory operations,\nsuch as, read cache selection.\n\nNote this RFC is for the discussion on the direction and is not intended to be\na complete implementation. If no objection, we will convert it to a Patch set.\n\nChanges v1 -> v2:\n- Encode steering tag and ph in vfio_device_feature_dma_buf flags field\n  instead of adding new uapi struct fields, to preserve ABI compatibility\n- Fix subject prefixes: \"Vfio:\" -> \"vfio:\", \"RMDA MLX5:\" -> \"RDMA/mlx5:\"\n- Fix raw steering tag vs st_index mismatch: get_tph() now returns a raw\n  steering tag, and the mlx5 consumer converts it to an st_index via the\n  new mlx5_st_alloc_index_by_tag() API\n- Fix @tph doc typo to @steering_tag in dma-buf.h\n- Remove unused variable, fix parameter alignment, fix trailing semicolon\n\nZhiping Zhang (2):\n  vfio: add callback to get tph info for dmabuf\n  RDMA/mlx5: get tph for p2p access when registering dmabuf mr\n\n drivers/infiniband/hw/mlx5/mr.c               | 34 +++++++++++++++++++\n .../net/ethernet/mellanox/mlx5/core/lib/st.c  | 23 +++++++++----\n drivers/vfio/pci/vfio_pci_dmabuf.c            | 26 ++++++++++++--\n include/linux/dma-buf.h                       | 30 ++++++++++++++++\n include/linux/mlx5/driver.h                   |  7 ++++\n include/uapi/linux/vfio.h                     |  9 +++--\n 6 files changed, 118 insertions(+), 11 deletions(-)\n\n--\n2.52.0"}