Subject: Re: [RFC v2 1/2] vfio: add callback to get tph info for dmabuf

From: Leon Romanovsky <[email-masked]>
Date: Tue, 31 Mar 2026 16:29:42 +0300

On Tue, Mar 31, 2026 at 07:00:07AM -0600, Keith Busch wrote:
> On Tue, Mar 31, 2026 at 11:37:58AM +0300, Leon Romanovsky wrote:
> > On Thu, Mar 26, 2026 at 04:41:11PM -0600, Keith Busch wrote:
> > > 
> > > 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.
> > 
> > He needs to add before flex array. This struct is submitted by the user
> > and kernel can easily calculate the position of that array.
> 
> No, you can't just do that. Existing applications would break when they
> compile against the updated kernel header. They don't know about this
> new "tph" supplied flag, but they'll all accidently use the new
> dma_ranges offset. 

So we need to always pass TPH flag and treat 0 as do-nothing-field.

Thanks