}
EXPORT_SYMBOL(ib_umem_dmabuf_get);
-static void
-ib_umem_dmabuf_unsupported_move_notify(struct dma_buf_attachment *attach)
-{
- struct ib_umem_dmabuf *umem_dmabuf = attach->importer_priv;
-
- ibdev_warn_ratelimited(umem_dmabuf->umem.ibdev,
- "Invalidate callback should not be called when memory is pinned\n");
-}
-
static struct dma_buf_attach_ops ib_umem_dmabuf_attach_pinned_ops = {
.allow_peer2peer = true,
- .move_notify = ib_umem_dmabuf_unsupported_move_notify,
};
- struct ib_umem_dmabuf *
- ib_umem_dmabuf_get_pinned_with_dma_device(struct ib_device *device,
- struct device *dma_device,
- unsigned long offset, size_t size,
- int fd, int access)
+ static void ib_umem_dmabuf_revoke_locked(struct dma_buf_attachment *attach)
+ {
+ struct ib_umem_dmabuf *umem_dmabuf = attach->importer_priv;
+
+ dma_resv_assert_held(attach->dmabuf->resv);
+
+ if (umem_dmabuf->revoked)
+ return;
+
+ if (umem_dmabuf->pinned_revoke)
+ umem_dmabuf->pinned_revoke(umem_dmabuf->private);
+
+ ib_umem_dmabuf_unmap_pages(umem_dmabuf);
+ if (umem_dmabuf->pinned) {
+ dma_buf_unpin(umem_dmabuf->attach);
+ umem_dmabuf->pinned = 0;
+ }
+ umem_dmabuf->revoked = 1;
+ }
+
+ static struct dma_buf_attach_ops ib_umem_dmabuf_attach_pinned_revocable_ops = {
+ .allow_peer2peer = true,
- .move_notify = ib_umem_dmabuf_revoke_locked,
++ .invalidate_mappings = ib_umem_dmabuf_revoke_locked,
+ };
+
+ static struct ib_umem_dmabuf *
+ ib_umem_dmabuf_get_pinned_and_lock(struct ib_device *device,
+ struct device *dma_device,
+ unsigned long offset,
+ size_t size, int fd, int access,
+ const struct dma_buf_attach_ops *ops)
{
struct ib_umem_dmabuf *umem_dmabuf;
int err;
#include "data_direct.h"
#include "dmah.h"
- enum {
- MAX_PENDING_REG_MR = 8,
- };
-#define MLX5_UMR_ALIGN 2048
--
- #define MLX5_MR_CACHE_PERSISTENT_ENTRY_MIN_DESCS 4
+ static int mkey_max_umr_order(struct mlx5_ib_dev *dev)
+ {
+ if (MLX5_CAP_GEN(dev->mdev, umr_extended_translation_offset))
+ return MLX5_MAX_UMR_EXTENDED_SHIFT;
+ return MLX5_MAX_UMR_SHIFT;
+ }
- static void
- create_mkey_callback(int status, struct mlx5_async_work *context);
static struct mlx5_ib_mr *reg_create(struct ib_pd *pd, struct ib_umem *umem,
u64 iova, int access_flags,
unsigned long page_size, bool populate,
memcpy(&fl6.daddr, daddr, sizeof(*daddr));
fl6.flowi6_proto = IPPROTO_UDP;
- ndst = ip6_dst_lookup_flow(sock_net(recv_sockets.sk6->sk),
- recv_sockets.sk6->sk, &fl6,
- NULL);
- ndst = ipv6_stub->ipv6_dst_lookup_flow(net,
- rxe_ns_pernet_sk6(net), &fl6,
- NULL);
++ ndst = ip6_dst_lookup_flow(net, rxe_ns_pernet_sk6(net), &fl6, NULL);
if (IS_ERR(ndst)) {
rxe_dbg_qp(qp, "no route to %pI6\n", daddr);
return NULL;