Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit feb7c1e3 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Doug Ledford
Browse files

IB: remove in-kernel support for memory windows



Remove the unused ib_allow_mw and ib_bind_mw functions, remove the
unused IB_WR_BIND_MW and IB_WC_BIND_MW opcodes and move ib_dealloc_mw
into the uverbs module.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarSagi Grimberg <sagig@mellanox.com>
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> [core]
Reviewed-by: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent b7d3e0a9
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@ Sleeping and interrupt context
    modify_ah
    query_ah
    destroy_ah
    bind_mw
    post_send
    post_recv
    poll_cq
@@ -31,7 +30,6 @@ Sleeping and interrupt context
    ib_modify_ah
    ib_query_ah
    ib_destroy_ah
    ib_bind_mw
    ib_post_send
    ib_post_recv
    ib_req_notify_cq
+2 −0
Original line number Diff line number Diff line
@@ -204,6 +204,8 @@ void ib_uverbs_event_handler(struct ib_event_handler *handler,
			     struct ib_event *event);
void ib_uverbs_dealloc_xrcd(struct ib_uverbs_device *dev, struct ib_xrcd *xrcd);

int uverbs_dealloc_mw(struct ib_mw *mw);

struct ib_uverbs_flow_spec {
	union {
		union {
+2 −2
Original line number Diff line number Diff line
@@ -1243,7 +1243,7 @@ ssize_t ib_uverbs_alloc_mw(struct ib_uverbs_file *file,
	idr_remove_uobj(&ib_uverbs_mw_idr, uobj);

err_unalloc:
	ib_dealloc_mw(mw);
	uverbs_dealloc_mw(mw);

err_put:
	put_pd_read(pd);
@@ -1272,7 +1272,7 @@ ssize_t ib_uverbs_dealloc_mw(struct ib_uverbs_file *file,

	mw = uobj->object;

	ret = ib_dealloc_mw(mw);
	ret = uverbs_dealloc_mw(mw);
	if (!ret)
		uobj->live = 0;

+12 −1
Original line number Diff line number Diff line
@@ -133,6 +133,17 @@ static int (*uverbs_ex_cmd_table[])(struct ib_uverbs_file *file,
static void ib_uverbs_add_one(struct ib_device *device);
static void ib_uverbs_remove_one(struct ib_device *device, void *client_data);

int uverbs_dealloc_mw(struct ib_mw *mw)
{
	struct ib_pd *pd = mw->pd;
	int ret;

	ret = mw->device->dealloc_mw(mw);
	if (!ret)
		atomic_dec(&pd->usecnt);
	return ret;
}

static void ib_uverbs_release_dev(struct kobject *kobj)
{
	struct ib_uverbs_device *dev =
@@ -224,7 +235,7 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file,
		struct ib_mw *mw = uobj->object;

		idr_remove_uobj(&ib_uverbs_mw_idr, uobj);
		ib_dealloc_mw(mw);
		uverbs_dealloc_mw(mw);
		kfree(uobj);
	}

+0 −36
Original line number Diff line number Diff line
@@ -1403,42 +1403,6 @@ struct ib_mr *ib_alloc_mr(struct ib_pd *pd,
}
EXPORT_SYMBOL(ib_alloc_mr);

/* Memory windows */

struct ib_mw *ib_alloc_mw(struct ib_pd *pd, enum ib_mw_type type)
{
	struct ib_mw *mw;

	if (!pd->device->alloc_mw)
		return ERR_PTR(-ENOSYS);

	mw = pd->device->alloc_mw(pd, type);
	if (!IS_ERR(mw)) {
		mw->device  = pd->device;
		mw->pd      = pd;
		mw->uobject = NULL;
		mw->type    = type;
		atomic_inc(&pd->usecnt);
	}

	return mw;
}
EXPORT_SYMBOL(ib_alloc_mw);

int ib_dealloc_mw(struct ib_mw *mw)
{
	struct ib_pd *pd;
	int ret;

	pd = mw->pd;
	ret = mw->device->dealloc_mw(mw);
	if (!ret)
		atomic_dec(&pd->usecnt);

	return ret;
}
EXPORT_SYMBOL(ib_dealloc_mw);

/* "Fast" memory regions */

struct ib_fmr *ib_alloc_fmr(struct ib_pd *pd,
Loading