From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3E94610AB822 for ; Thu, 26 Mar 2026 22:41:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A71BA10E51B; Thu, 26 Mar 2026 22:41:19 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="PsnTFjOZ"; dkim-atps=neutral Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 081E710E51B for ; Thu, 26 Mar 2026 22:41:18 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 3F48B60054; Thu, 26 Mar 2026 22:41:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F329C116C6; Thu, 26 Mar 2026 22:41:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774564873; bh=O9RE3qPQOrONRsorAVN2XwchrtUcoeQXGzvczDsoM0I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PsnTFjOZKBZWQ4+ymH6V5CbVtPOKgtB7APar8wQbMHAL324LaZ3YA1lEqUplGxxJM 7gowm/jZDTt4f9FAUW6Sei6Jhgt0w6JS9eeWENbE6MagiwxaAYVHC0tb/Z6vqwqwSw zjuFISZZNCdmocM8GAFf1hQDyceBOcpfyTHl+zMcCmQNOiHamfaY0Q78xxZpPA5hn4 aiLf0dU4cUcJmDQ7Aa0y2Ho8lDqdhnV16Fk4Xb2dg9gInBLlHG60kzH3DVFNztBTte zSlHh29e3e8PT/Nc7LWEzjm8oOGVmmTtEeGptW1/E5KVeXER+QTapM/Q/1Z2wScHex nsy13cDBr1Vcg== Date: Thu, 26 Mar 2026 16:41:11 -0600 From: Keith Busch To: Leon Romanovsky Cc: Zhiping Zhang , Jason Gunthorpe , Bjorn Helgaas , linux-rdma@vger.kernel.org, linux-pci@vger.kernel.org, netdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Yochai Cohen , Yishai Hadas , Bjorn Helgaas Subject: Re: [RFC v2 1/2] vfio: add callback to get tph info for dmabuf Message-ID: References: <20260324234615.3731237-1-zhipingz@meta.com> <20260324234615.3731237-2-zhipingz@meta.com> <20260325082534.GN814676@unreal> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260325082534.GN814676@unreal> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed, Mar 25, 2026 at 10:25:34AM +0200, Leon Romanovsky wrote: > On Tue, Mar 24, 2026 at 04:46:02PM -0700, Zhiping Zhang wrote: > > struct vfio_device_feature_dma_buf { > > __u32 region_index; > > __u32 open_flags; > > - __u32 flags; > > - __u32 nr_ranges; > > + __u32 flags; > > +#define VFIO_DMABUF_FL_TPH (1U << 0) /* TPH info is present */ > > +#define VFIO_DMABUF_TPH_PH_SHIFT 1 /* bits 1-2: PH (2-bit) */ > > +#define VFIO_DMABUF_TPH_PH_MASK 0x6U > > +#define VFIO_DMABUF_TPH_ST_SHIFT 16 /* bits 16-31: steering tag */ > > +#define VFIO_DMABUF_TPH_ST_MASK 0xffff0000U > > This extension of flags is basically kills future extension of this > struct for anything that includes TPH. > > Add new > enum vfio_device_feature_dma_buf_flags { > VFIO_DMABUF_FL_TPH = 1 << 0 > } > > > + __u32 nr_ranges; > > add your "__u16 steering_tag" and "__u8 ph" fields here. You're suggesting that Ziping append the new fields to the end of this struct? I don't think we can modify the layout of a uapi. If we can't carve the space for this out of the existing unused flags field, I think we'd have to introduce a new vfio device feature that basically copies VFIO_DEVICE_FEATURE_DMA_BUF with the extra hints fields. > > struct vfio_region_dma_range dma_ranges[] __counted_by(nr_ranges); > > };