libibverbs: Add dmabuf fd field to struct ibv_buf Add an int dmabuf_fd field to struct ibv_buf so that providers can store the DMA-buf file descriptor directly in the common buffer abstraction. Signed-off-by: Jiri Pirko <jiri@nvidia.com>
diff --git a/libibverbs/driver.h b/libibverbs/driver.h index 45a0b1d..4d73194 100644 --- a/libibverbs/driver.h +++ b/libibverbs/driver.h
@@ -54,6 +54,7 @@ void *addr; size_t size; struct ibv_pd *pd; + int dmabuf_fd; }; static inline void ibv_buf_init(struct ibv_buf *buf, struct ibv_pd *pd, @@ -62,6 +63,14 @@ buf->pd = pd; buf->addr = addr; buf->size = size; + buf->dmabuf_fd = -1; +} + +static inline void ibv_buf_init_dmabuf(struct ibv_buf *buf, struct ibv_pd *pd, + void *addr, size_t size, int fd) +{ + ibv_buf_init(buf, pd, addr, size); + buf->dmabuf_fd = fd; } enum {