Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2195336/?format=api
{ "id": 2195336, "url": "http://patchwork.ozlabs.org/api/patches/2195336/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260210194014.2147481-2-zhipingz@meta.com/", "project": { "id": 28, "url": "http://patchwork.ozlabs.org/api/projects/28/?format=api", "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": "<20260210194014.2147481-2-zhipingz@meta.com>", "list_archive_url": null, "date": "2026-02-10T19:39:54", "name": "[RFC,1/2] Vfio: add callback to get tph info for dmabuf", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "085b60894f64ffa4e5f80aaaeb5c5f2117e4d90a", "submitter": { "id": 92088, "url": "http://patchwork.ozlabs.org/api/people/92088/?format=api", "name": "Zhiping Zhang", "email": "zhipingz@meta.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260210194014.2147481-2-zhipingz@meta.com/mbox/", "series": [ { "id": 491732, "url": "http://patchwork.ozlabs.org/api/series/491732/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=491732", "date": "2026-02-10T19:39:53", "name": "Retrieve tph from dmabuf for PCIe P2P memory access", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/491732/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2195336/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2195336/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-pci+bounces-47116-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=FtJeKsLo;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-pci+bounces-47116-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=\"FtJeKsLo\"", "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 tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4f9XCr6N1fz1xvg\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 11 Feb 2026 06:47:52 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 67FB93042959\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 10 Feb 2026 19:47:43 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id EE4F632ED20;\n\tTue, 10 Feb 2026 19:47:40 +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 A11BE2528FD\n\tfor <linux-pci@vger.kernel.org>; Tue, 10 Feb 2026 19:47:39 +0000 (UTC)", "from pps.filterd (m0044010.ppops.net [127.0.0.1])\n\tby mx0a-00082601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 61AH2Jvr3309800\n\tfor <linux-pci@vger.kernel.org>; Tue, 10 Feb 2026 11:47:39 -0800", "from mail.thefacebook.com ([163.114.134.16])\n\tby mx0a-00082601.pphosted.com (PPS) with ESMTPS id 4c88qnjd9p-13\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)\n\tfor <linux-pci@vger.kernel.org>; Tue, 10 Feb 2026 11:47:38 -0800 (PST)", "from twshared41309.15.frc2.facebook.com (2620:10d:c085:208::f) by\n mail.thefacebook.com (2620:10d:c08b:78::c78f) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.2.2562.35; Tue, 10 Feb 2026 19:47:34 +0000", "by devbig259.ftw1.facebook.com (Postfix, from userid 664516)\n\tid 39B50102666BF; Tue, 10 Feb 2026 11:40:19 -0800 (PST)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1770752860; cv=none;\n b=KZRfzE0HebeLN5lKvYxSfCU1T9FVTPamry22CccSCWoFBGfXqp7QW3gMKYULrGVtWbJzDG008ch7W3zCcjv6jvudMC+EMANR9yZHcpnhsGVuRyNWPXT5ei6hgvcNd2d7r80SNJcqhk5TlrTGJ+Z67JRptR3AYUW9oJIvih3sJwk=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1770752860; c=relaxed/simple;\n\tbh=k6JJU6/Xv5Bve7ALmeRsOaz8DO0O0Gst3Ha4Joxtbys=;\n\th=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=aekYogt4ccc9u2TyA4cx3AnPoom33ohncaLBvvJasg7R/4QQbBDfFS68CZSFvi1nsZmSoFEhVEjKcGPVB5As5MHL3mJO1JiM3URMwLJQQtdvCauT3Vl8bpbSBWLrKDweQLyzXdTTVk5/U9VAojRFiDeqlH46uh65jueluP2xDvg=", "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=FtJeKsLo; 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:in-reply-to\n\t:message-id:mime-version:references:subject:to; s=s2048-2025-q2;\n\t bh=+Hrz8y6M1gcSbgUEcxq2AJOX4snqaTvaf+bpG7ruQ0Y=; b=FtJeKsLoEtSp\n\tdj2vTUbAcX6f2D/qj6GVpsTgNAvwdV471dpvaVruJsyLgn+ULh9a0nDLRpjvlElp\n\tILM3gxrPT1SftDVnZYi106OzP96mJgmNYVe/qISUULA5xbNDZunlAEn+JIYdPlQg\n\tu+PPXT6afKkTniJnj3atePFXQbZf6vvS8R+DR7TthZs0zFlWAJ6aM/zY6AQbo8JS\n\tsBDlip9d7LlqnSpq51cb3PGgRAQXfq76r5CqaBGOTVDYg2n8BYwBNi4rihRyn9GD\n\tWwYhUxNdpG3DvHpcWcbs65tY9mZzk1DHW5SvCWgsRB6GW0tlgMeqG2CIIkUA87D3\n\tZm9D4Jzzbg==", "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 1/2] Vfio: add callback to get tph info for dmabuf", "Date": "Tue, 10 Feb 2026 11:39:54 -0800", "Message-ID": "<20260210194014.2147481-2-zhipingz@meta.com>", "X-Mailer": "git-send-email 2.47.3", "In-Reply-To": "<20260210194014.2147481-1-zhipingz@meta.com>", "References": "<20260210194014.2147481-1-zhipingz@meta.com>", "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-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwMjEwMDE2MyBTYWx0ZWRfX93BiVv4odLXq\n 7Gyz4dOqsbhD/kXoBD8cI53FDQ8aJFRh2OEH/3XhXZekhFdWGcaiI/rIYB9XgcAR9I4NjWUJM+F\n gUd1NIBi22DmrD28OCbgCtepiUUprNn/KdqCLtuCnnETO4BNhC6VS98v3cgDgmVMUj4490vSm+A\n oYAk8XKfjQ9bSP4uHX3k7BYsbQlhHUenje6WBwiVGqtpe1N4Bd3IfqEq770l6FH7R4u0V2awVce\n KnRlnaeXewfK3keXutNlRCtsRHVu4/1nypzXdlIEe6oezDlbeHiHMPN6mxCb9U9VAo85okljWbH\n mfqIVkMKJ4/yrs1LiXis64ImTVW2CyVJTrfTeq52k7nYy8LT4RN0sxSh4c+oHFlTfI0P6Yy8Kjb\n eCwaV18Om698Qb//2xQ07becKribwzX1+mi2qbMDOt//6yZAxT2ULBGut4GuokEDBMxBNBjKXtf\n 91RH7TFyCxUefr25Yuw==", "X-Authority-Analysis": "v=2.4 cv=POkCOPqC c=1 sm=1 tr=0 ts=698b8b5a cx=c_pps\n a=CB4LiSf2rd0gKozIdrpkBw==:117 a=CB4LiSf2rd0gKozIdrpkBw==:17\n a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22\n a=GgsMoib0sEa3-_RKJdDe:22 a=VabnemYjAAAA:8 a=66hUaM2K5p8tY_kFZzUA:9\n a=gKebqoRLp9LExxC7YDUY:22", "X-Proofpoint-ORIG-GUID": "EU__gaovMivWEUBtjd_w7vq1a7GR8nKy", "X-Proofpoint-GUID": "EU__gaovMivWEUBtjd_w7vq1a7GR8nKy", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-02-10_03,2026-02-10_02,2025-10-01_01" }, "content": "This RFC patch adds a callback to get the tph info on DMA buffer exporters.\nThe tph info includes both the steering tag and the process hint (ph).\n\nSigned-off-by: Zhiping Zhang <zhipingz@meta.com>\n---\n drivers/vfio/pci/vfio_pci_dmabuf.c | 15 ++++++++++++++-\n include/linux/dma-buf.h | 30 ++++++++++++++++++++++++++++++\n include/uapi/linux/vfio.h | 2 ++\n 3 files changed, 46 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/vfio/pci/vfio_pci_dmabuf.c b/drivers/vfio/pci/vfio_pci_dmabuf.c\nindex d4d0f7d08c53..4da1a6cc306f 100644\n--- a/drivers/vfio/pci/vfio_pci_dmabuf.c\n+++ b/drivers/vfio/pci/vfio_pci_dmabuf.c\n@@ -17,6 +17,8 @@ struct vfio_pci_dma_buf {\n \tstruct dma_buf_phys_vec *phys_vec;\n \tstruct p2pdma_provider *provider;\n \tu32 nr_ranges;\n+\tu16 steering_tag;\n+\tu8 ph;\n \tu8 revoked : 1;\n };\n \n@@ -50,6 +52,15 @@ vfio_pci_dma_buf_map(struct dma_buf_attachment *attachment,\n \t\t\t\t priv->size, dir);\n }\n \n+static int vfio_pci_dma_buf_get_tph(struct dma_buf *dmabuf, u16 *steering_tag,\n+\t\t\t\t u8 *ph)\n+{\n+\tstruct vfio_pci_dma_buf *priv = dmabuf->priv;\n+\t*steering_tag = priv->steering_tag;\n+\t*ph = priv->ph;\n+\treturn 0;\n+}\n+\n static void vfio_pci_dma_buf_unmap(struct dma_buf_attachment *attachment,\n \t\t\t\t struct sg_table *sgt,\n \t\t\t\t enum dma_data_direction dir)\n@@ -78,6 +89,7 @@ static void vfio_pci_dma_buf_release(struct dma_buf *dmabuf)\n static const struct dma_buf_ops vfio_pci_dmabuf_ops = {\n \t.attach = vfio_pci_dma_buf_attach,\n \t.map_dma_buf = vfio_pci_dma_buf_map,\n+\t.get_tph = vfio_pci_dma_buf_get_tph,\n \t.unmap_dma_buf = vfio_pci_dma_buf_unmap,\n \t.release = vfio_pci_dma_buf_release,\n };\n@@ -274,7 +286,8 @@ int vfio_pci_core_feature_dma_buf(struct vfio_pci_core_device *vdev, u32 flags,\n \t\tret = PTR_ERR(priv->dmabuf);\n \t\tgoto err_dev_put;\n \t}\n-\n+\tpriv->steering_tag = get_dma_buf.steering_tag;\n+\tpriv->ph = get_dma_buf.ph;\n \t/* dma_buf_put() now frees priv */\n \tINIT_LIST_HEAD(&priv->dmabufs_elm);\n \tdown_write(&vdev->memory_lock);\ndiff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h\nindex 0bc492090237..466290c02ebf 100644\n--- a/include/linux/dma-buf.h\n+++ b/include/linux/dma-buf.h\n@@ -113,6 +113,36 @@ struct dma_buf_ops {\n \t */\n \tvoid (*unpin)(struct dma_buf_attachment *attach);\n \n+\t/**\n+\t * @get_tph:\n+\t *\n+\t * Get the TPH (TLP Processing Hints) for this DMA buffer.\n+\t *\n+\t * This callback allows DMA buffer exporters to provide TPH including\n+\t * both the steering tag and the process hints (ph), which can be used\n+\t * to optimize peer-to-peer (P2P) memory access. The TPH info is typically\n+\t * used in scenarios where:\n+\t * - A PCIe device (e.g., RDMA NIC) needs to access memory on another\n+\t * PCIe device (e.g., GPU),\n+\t * - The system supports TPH and can use steering tags / ph to optimize\n+\t * cache placement and memory access patterns,\n+\t * - The memory is exported via DMABUF for cross-device sharing.\n+\t *\n+\t * @dmabuf: [in] The DMA buffer for which to retrieve TPH\n+\t * @steering_tag: [out] Pointer to store the 16-bit TPH steering tag value\n+\t * @ph: [out] Pointer to store the 8-bit TPH processing-hint value\n+\t *\n+\t * Returns:\n+\t * * 0 - Success, steering tag stored in @tph\n+\t * * -EOPNOTSUPP - TPH steering tags not supported for this buffer\n+\t * * -EINVAL - Invalid parameters\n+\t *\n+\t * This callback is optional. If not implemented, the buffer does not\n+\t * support TPH.\n+\t *\n+\t */\n+\tint (*get_tph)(struct dma_buf *dmabuf, u16 *steering_tag, u8 *ph);\n+\n \t/**\n \t * @map_dma_buf:\n \t *\ndiff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h\nindex ac2329f24141..bff2f5f7e38d 100644\n--- a/include/uapi/linux/vfio.h\n+++ b/include/uapi/linux/vfio.h\n@@ -1501,6 +1501,8 @@ struct vfio_region_dma_range {\n struct vfio_device_feature_dma_buf {\n \t__u32\tregion_index;\n \t__u32\topen_flags;\n+\t__u16 steering_tag;\n+\t__u8 ph;\n \t__u32 flags;\n \t__u32 nr_ranges;\n \tstruct vfio_region_dma_range dma_ranges[] __counted_by(nr_ranges);\n", "prefixes": [ "RFC", "1/2" ] }