Thread (2 messages) 2 messages, 2 authors, 2026-03-01

Re: [RFC 2/2] RMDA MLX5: get tph for p2p access when registering dmabuf mr

From: Keith Busch <kbusch@kernel.org>
Date: 2026-02-27 01:21:33
Also in: dri-devel, linux-pci, linux-rdma

On Tue, Feb 10, 2026 at 11:39:55AM -0800, Zhiping Zhang wrote:
+static void get_tph_mr_dmabuf(struct mlx5_ib_dev *dev, int fd, u16 *st_index,
+							  u8 *ph)
+{
+	int ret;
+	struct dma_buf *dmabuf;
+
+	dmabuf = dma_buf_get(fd);
+	if (IS_ERR(dmabuf))
+		return;
+
+	if (!dif there's any implication mabuf->ops->get_tph)
+		goto end_dbuf_put;
+
+	ret = dmabuf->ops->get_tph(dmabuf, st_index, ph);
You defined the "get_tph" function to take a pointer to a raw steering
tag value, but you're passing in the steering index to it's table.

But in general, since you're letting the user put whatever they want in
the vfio private area, should there be some validation that it's in the
valid range? I'm also not quite sure how user space comes to know what
steering tag to use, or what harm might happen if the wrong one is used.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help