The IOV interconnect is a virtual interconnect between an SRIOV
physical function (PF) and its virtual functions (VFs). In order
for negotiation (or match) to succeed, the exporter is expected
to be a VF while the importer is expected to be the PF.

Cc: Jason Gunthorpe <[email protected]>
Cc: Christian Koenig <[email protected]>
Cc: Sumit Semwal <[email protected]>
Cc: Thomas Hellström <[email protected]>
Cc: Simona Vetter <[email protected]>
Signed-off-by: Vivek Kasireddy <[email protected]>
---
 include/linux/dma-buf-interconnect.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/include/linux/dma-buf-interconnect.h 
b/include/linux/dma-buf-interconnect.h
index a72f65ed4806..b569dcab86ce 100644
--- a/include/linux/dma-buf-interconnect.h
+++ b/include/linux/dma-buf-interconnect.h
@@ -3,8 +3,17 @@
 #ifndef __DMA_BUF_INTERCONNECT_H__
 #define __DMA_BUF_INTERCONNECT_H__
 
+#include <linux/pci.h>
 #include <linux/xarray.h>
 
+#define CREATE_IOV_INTERCONNECT(pdev, bar) {           \
+       &(const struct dma_buf_iov_interconnect) {      \
+               .base.type = DMA_BUF_INTERCONNECT_IOV,  \
+               .pdev = (pdev),                         \
+               .bar = (bar),                           \
+       }.base                                          \
+}
+
 struct dma_buf_attachment;
 
 struct dma_buf_ranges {
@@ -14,6 +23,7 @@ struct dma_buf_ranges {
 
 enum dma_buf_interconnect_type {
        DMA_BUF_INTERCONNECT_NONE = 0,
+       DMA_BUF_INTERCONNECT_IOV,
 };
 
 struct dma_buf_interconnect {
@@ -24,6 +34,12 @@ struct dma_buf_interconnect_match {
        const struct dma_buf_interconnect *interconnect;
 };
 
+struct dma_buf_iov_interconnect {
+       struct dma_buf_interconnect base;
+       struct pci_dev *pdev;
+       unsigned int bar;
+};
+
 struct dma_buf_interconnect_ops {
        int (*map_interconnect)(struct dma_buf_attachment *attach,
                                struct dma_buf_ranges *ranges);
-- 
2.50.1

Reply via email to