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

Commit d2ad9cc7 authored by Doug Ledford's avatar Doug Ledford
Browse files

Merge branches 'mlx4', 'mlx5' and 'ocrdma' into k.o/for-4.6

Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -1206,6 +1206,10 @@ static int cma_save_req_info(const struct ib_cm_event *ib_event,
		req->has_gid	= true;
		req->has_gid	= true;
		req->service_id	= req_param->primary_path->service_id;
		req->service_id	= req_param->primary_path->service_id;
		req->pkey	= be16_to_cpu(req_param->primary_path->pkey);
		req->pkey	= be16_to_cpu(req_param->primary_path->pkey);
		if (req->pkey != req_param->bth_pkey)
			pr_warn_ratelimited("RDMA CMA: got different BTH P_Key (0x%x) and primary path P_Key (0x%x)\n"
					    "RDMA CMA: in the future this may cause the request to be dropped\n",
					    req_param->bth_pkey, req->pkey);
		break;
		break;
	case IB_CM_SIDR_REQ_RECEIVED:
	case IB_CM_SIDR_REQ_RECEIVED:
		req->device	= sidr_param->listen_id->device;
		req->device	= sidr_param->listen_id->device;
@@ -1213,6 +1217,10 @@ static int cma_save_req_info(const struct ib_cm_event *ib_event,
		req->has_gid	= false;
		req->has_gid	= false;
		req->service_id	= sidr_param->service_id;
		req->service_id	= sidr_param->service_id;
		req->pkey	= sidr_param->pkey;
		req->pkey	= sidr_param->pkey;
		if (req->pkey != sidr_param->bth_pkey)
			pr_warn_ratelimited("RDMA CMA: got different BTH P_Key (0x%x) and SIDR request payload P_Key (0x%x)\n"
					    "RDMA CMA: in the future this may cause the request to be dropped\n",
					    sidr_param->bth_pkey, req->pkey);
		break;
		break;
	default:
	default:
		return -EINVAL;
		return -EINVAL;
+15 −1
Original line number Original line Diff line number Diff line
@@ -1174,6 +1174,7 @@ ssize_t ib_uverbs_alloc_mw(struct ib_uverbs_file *file,
	struct ib_uobject             *uobj;
	struct ib_uobject             *uobj;
	struct ib_pd                  *pd;
	struct ib_pd                  *pd;
	struct ib_mw                  *mw;
	struct ib_mw                  *mw;
	struct ib_udata		       udata;
	int                            ret;
	int                            ret;


	if (out_len < sizeof(resp))
	if (out_len < sizeof(resp))
@@ -1195,7 +1196,12 @@ ssize_t ib_uverbs_alloc_mw(struct ib_uverbs_file *file,
		goto err_free;
		goto err_free;
	}
	}


	mw = pd->device->alloc_mw(pd, cmd.mw_type);
	INIT_UDATA(&udata, buf + sizeof(cmd),
		   (unsigned long)cmd.response + sizeof(resp),
		   in_len - sizeof(cmd) - sizeof(struct ib_uverbs_cmd_hdr),
		   out_len - sizeof(resp));

	mw = pd->device->alloc_mw(pd, cmd.mw_type, &udata);
	if (IS_ERR(mw)) {
	if (IS_ERR(mw)) {
		ret = PTR_ERR(mw);
		ret = PTR_ERR(mw);
		goto err_put;
		goto err_put;
@@ -3086,6 +3092,14 @@ int ib_uverbs_ex_create_flow(struct ib_uverbs_file *file,
	     !capable(CAP_NET_ADMIN)) || !capable(CAP_NET_RAW))
	     !capable(CAP_NET_ADMIN)) || !capable(CAP_NET_RAW))
		return -EPERM;
		return -EPERM;


	if (cmd.flow_attr.flags >= IB_FLOW_ATTR_FLAGS_RESERVED)
		return -EINVAL;

	if ((cmd.flow_attr.flags & IB_FLOW_ATTR_FLAGS_DONT_TRAP) &&
	    ((cmd.flow_attr.type == IB_FLOW_ATTR_ALL_DEFAULT) ||
	     (cmd.flow_attr.type == IB_FLOW_ATTR_MC_DEFAULT)))
		return -EINVAL;

	if (cmd.flow_attr.num_of_specs > IB_FLOW_SPEC_SUPPORT_LAYERS)
	if (cmd.flow_attr.num_of_specs > IB_FLOW_SPEC_SUPPORT_LAYERS)
		return -EINVAL;
		return -EINVAL;


+2 −0
Original line number Original line Diff line number Diff line
@@ -1567,6 +1567,8 @@ EXPORT_SYMBOL(ib_check_mr_status);
 * - The last sg element is allowed to have length less than page_size.
 * - The last sg element is allowed to have length less than page_size.
 * - If sg_nents total byte length exceeds the mr max_num_sge * page_size
 * - If sg_nents total byte length exceeds the mr max_num_sge * page_size
 *   then only max_num_sg entries will be mapped.
 *   then only max_num_sg entries will be mapped.
 * - If the MR was allocated with type IB_MR_TYPE_SG_GAPS_REG, non of these
 *   constraints holds and the page_size argument is ignored.
 *
 *
 * Returns the number of sg elements that were mapped to the memory region.
 * Returns the number of sg elements that were mapped to the memory region.
 *
 *
+2 −1
Original line number Original line Diff line number Diff line
@@ -657,7 +657,8 @@ static struct ib_mr *iwch_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
	return ERR_PTR(err);
	return ERR_PTR(err);
}
}


static struct ib_mw *iwch_alloc_mw(struct ib_pd *pd, enum ib_mw_type type)
static struct ib_mw *iwch_alloc_mw(struct ib_pd *pd, enum ib_mw_type type,
				   struct ib_udata *udata)
{
{
	struct iwch_dev *rhp;
	struct iwch_dev *rhp;
	struct iwch_pd *php;
	struct iwch_pd *php;
+2 −1
Original line number Original line Diff line number Diff line
@@ -963,7 +963,8 @@ int c4iw_map_mr_sg(struct ib_mr *ibmr,
		   struct scatterlist *sg,
		   struct scatterlist *sg,
		   int sg_nents);
		   int sg_nents);
int c4iw_dealloc_mw(struct ib_mw *mw);
int c4iw_dealloc_mw(struct ib_mw *mw);
struct ib_mw *c4iw_alloc_mw(struct ib_pd *pd, enum ib_mw_type type);
struct ib_mw *c4iw_alloc_mw(struct ib_pd *pd, enum ib_mw_type type,
			    struct ib_udata *udata);
struct ib_mr *c4iw_reg_user_mr(struct ib_pd *pd, u64 start,
struct ib_mr *c4iw_reg_user_mr(struct ib_pd *pd, u64 start,
					   u64 length, u64 virt, int acc,
					   u64 length, u64 virt, int acc,
					   struct ib_udata *udata);
					   struct ib_udata *udata);
Loading