drivers/infiniband/sw/rxe/rxe_verbs.c

Source file repositories/reference/linux-study-clean/drivers/infiniband/sw/rxe/rxe_verbs.c

File Facts

System
Linux kernel
Corpus path
drivers/infiniband/sw/rxe/rxe_verbs.c
Extension
.c
Size
34983 bytes
Lines
1553
Domain
Driver Families
Bucket
drivers/infiniband
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if (err) {
			err = -EFAULT;
			rxe_dbg_ah(ah, "unable to copy to user\n");
			goto err_cleanup;
		}
	} else if (ah->is_user) {
		/* only if old user provider */
		ah->ah_num = 0;
	}

	rxe_init_av(init_attr->ah_attr, &ah->av);
	rxe_finalize(ah);

	return 0;

err_cleanup:
	cleanup_err = rxe_cleanup(ah);
	if (cleanup_err)
		rxe_err_ah(ah, "cleanup failed, err = %d\n", cleanup_err);
err_out:
	rxe_err_ah(ah, "returned err = %d\n", err);
	return err;
}

static int rxe_modify_ah(struct ib_ah *ibah, struct rdma_ah_attr *attr)
{
	struct rxe_ah *ah = to_rah(ibah);
	int err;

	err = rxe_ah_chk_attr(ah, attr);
	if (err) {
		rxe_dbg_ah(ah, "bad attr\n");
		goto err_out;
	}

	rxe_init_av(attr, &ah->av);

	return 0;

err_out:
	rxe_err_ah(ah, "returned err = %d\n", err);
	return err;
}

static int rxe_query_ah(struct ib_ah *ibah, struct rdma_ah_attr *attr)
{
	struct rxe_ah *ah = to_rah(ibah);

	memset(attr, 0, sizeof(*attr));
	attr->type = ibah->type;
	rxe_av_to_attr(&ah->av, attr);

	return 0;
}

static int rxe_destroy_ah(struct ib_ah *ibah, u32 flags)
{
	struct rxe_ah *ah = to_rah(ibah);
	int err;

	err = rxe_cleanup_ah(ah, flags & RDMA_DESTROY_AH_SLEEPABLE);
	if (err)
		rxe_err_ah(ah, "cleanup failed, err = %d\n", err);

	return 0;
}

/* srq */
static int rxe_create_srq(struct ib_srq *ibsrq, struct ib_srq_init_attr *init,
			  struct ib_udata *udata)
{
	struct rxe_dev *rxe = to_rdev(ibsrq->device);
	struct rxe_pd *pd = to_rpd(ibsrq->pd);
	struct rxe_srq *srq = to_rsrq(ibsrq);
	struct rxe_create_srq_resp __user *uresp = NULL;
	int err, cleanup_err;

	if (udata) {
		if (udata->outlen < sizeof(*uresp)) {
			err = -EINVAL;
			rxe_err_dev(rxe, "malformed udata\n");
			goto err_out;
		}
		uresp = udata->outbuf;
	}

	if (init->srq_type != IB_SRQT_BASIC) {
		err = -EOPNOTSUPP;
		rxe_dbg_dev(rxe, "srq type = %d, not supported\n",
				init->srq_type);

Annotation

Implementation Notes