summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_rxtx.h
diff options
context:
space:
mode:
authorShahaf Shuler <shahafs@mellanox.com>2019-03-10 10:28:02 +0200
committerThomas Monjalon <thomas@monjalon.net>2019-03-30 16:48:58 +0100
commit989e999d93052c57a2ff64c0a590fab517540215 (patch)
treede550abc7f17958b107c3af3eec724fa5e1339a5 /drivers/net/mlx5/mlx5_rxtx.h
parent0f132546a8743d7629924754390229306e0bd550 (diff)
downloaddpdk-989e999d93052c57a2ff64c0a590fab517540215.zip
dpdk-989e999d93052c57a2ff64c0a590fab517540215.tar.gz
dpdk-989e999d93052c57a2ff64c0a590fab517540215.tar.xz
net/mlx5: support PCI device DMA map and unmap
The implementation reuses the external memory registration work done by commit[1]. Note about representors: The current representor design will not work with those map and unmap functions. The reason is that for representors we have multiple IB devices share the same PCI function, so mapping will happen only on one of the representors and not all of them. While it is possible to implement such support, the IB representor design is going to be changed during DPDK19.05. The new design will have a single IB device for all representors, hence sharing of a single memory region between all representors will be possible. [1] commit 7e43a32ee060 ("net/mlx5: support externally allocated static memory") Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_rxtx.h')
-rw-r--r--drivers/net/mlx5/mlx5_rxtx.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index 53115dd..ced9945 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -28,6 +28,7 @@
#include <rte_atomic.h>
#include <rte_spinlock.h>
#include <rte_io.h>
+#include <rte_bus_pci.h>
#include "mlx5_utils.h"
#include "mlx5.h"
@@ -367,6 +368,10 @@ uint32_t mlx5_rx_addr2mr_bh(struct mlx5_rxq_data *rxq, uintptr_t addr);
uint32_t mlx5_tx_mb2mr_bh(struct mlx5_txq_data *txq, struct rte_mbuf *mb);
uint32_t mlx5_tx_update_ext_mp(struct mlx5_txq_data *txq, uintptr_t addr,
struct rte_mempool *mp);
+int mlx5_dma_map(struct rte_pci_device *pdev, void *addr, uint64_t iova,
+ size_t len);
+int mlx5_dma_unmap(struct rte_pci_device *pdev, void *addr, uint64_t iova,
+ size_t len);
/**
* Provide safe 64bit store operation to mlx5 UAR region for both 32bit and