From: Jason Gunthorpe Date: Thu, 16 Aug 2018 19:08:18 +0000 (-0600) Subject: Merge tag 'v4.18' into rdma.git for-next X-Git-Tag: v4.19~309^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=89982f7ccee2fcd8fea7936b81eec6defbf0f131;p=platform%2Fkernel%2Flinux-rpi.git Merge tag 'v4.18' into rdma.git for-next Resolve merge conflicts from the -rc cycle against the rdma.git tree: Conflicts: drivers/infiniband/core/uverbs_cmd.c - New ifs added to ib_uverbs_ex_create_flow in -rc and for-next - Merge removal of file->ucontext in for-next with new code in -rc drivers/infiniband/core/uverbs_main.c - for-next removed code from ib_uverbs_write() that was modified in for-rc Signed-off-by: Jason Gunthorpe --- 89982f7ccee2fcd8fea7936b81eec6defbf0f131 diff --cc drivers/infiniband/core/uverbs_cmd.c index 465b4d9,583d3a1..a21d521 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@@ -3419,11 -3537,10 +3468,11 @@@ int ib_uverbs_ex_create_flow(struct ib_ struct ib_flow_attr *flow_attr; struct ib_qp *qp; struct ib_uflow_resources *uflow_res; + struct ib_uverbs_flow_spec_hdr *kern_spec; int err = 0; - void *kern_spec; void *ib_spec; int i; + struct ib_device *ib_dev; if (ucore->inlen < sizeof(cmd)) return -EINVAL; @@@ -3491,11 -3608,11 +3540,16 @@@ goto err_uobj; } + if (qp->qp_type != IB_QPT_UD && qp->qp_type != IB_QPT_RAW_PACKET) { + err = -EINVAL; + goto err_put; + } + + if (!qp->device->create_flow) { + err = -EOPNOTSUPP; + goto err_put; + } + flow_attr = kzalloc(struct_size(flow_attr, flows, cmd.flow_attr.num_of_specs), GFP_KERNEL); if (!flow_attr) { @@@ -3515,13 -3632,15 +3569,15 @@@ flow_attr->flags = kern_flow_attr->flags; flow_attr->size = sizeof(*flow_attr); - kern_spec = kern_flow_attr + 1; + kern_spec = kern_flow_attr->flow_specs; ib_spec = flow_attr + 1; for (i = 0; i < flow_attr->num_of_specs && - cmd.flow_attr.size > offsetof(struct ib_uverbs_flow_spec, reserved) && - cmd.flow_attr.size >= - ((struct ib_uverbs_flow_spec *)kern_spec)->size; i++) { - err = kern_spec_to_ib_spec(file, kern_spec, ib_spec, uflow_res); + cmd.flow_attr.size >= sizeof(*kern_spec) && + cmd.flow_attr.size >= kern_spec->size; + i++) { + err = kern_spec_to_ib_spec( - file->ucontext, (struct ib_uverbs_flow_spec *)kern_spec, ++ file, (struct ib_uverbs_flow_spec *)kern_spec, + ib_spec, uflow_res); if (err) goto err_free;