]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branches 'cma', 'cxgb3', 'cxgb4', 'misc', 'nes', 'netlink', 'srp' and 'uverbs...
authorRoland Dreier <roland@purestorage.com>
Wed, 25 May 2011 20:47:20 +0000 (13:47 -0700)
committerRoland Dreier <roland@purestorage.com>
Wed, 25 May 2011 20:47:20 +0000 (13:47 -0700)
1  2  3  4  5  6  7 
drivers/infiniband/core/ucma.c

index 3170899dab014df32d3a859e6f07dacbc91d924e,b3fa798525b2a1d8d3df793f41fe255eacf676dd,b3fa798525b2a1d8d3df793f41fe255eacf676dd,b3fa798525b2a1d8d3df793f41fe255eacf676dd,7109d5d23ba5be849d62dfc7ad7971c65aa6b788,b3fa798525b2a1d8d3df793f41fe255eacf676dd,b3fa798525b2a1d8d3df793f41fe255eacf676dd..71be5eebd683a52605096ecf7745ee0d93af758d
        return ret;
       }
       
---- --static ssize_t ucma_create_id(struct ucma_file *file,
---- --                         const char __user *inbuf,
---- --                         int in_len, int out_len)
++++ ++static int ucma_get_qp_type(struct rdma_ucm_create_id *cmd, enum ib_qp_type *qp_type)
++++ ++{
++++ ++ switch (cmd->ps) {
++++ ++ case RDMA_PS_TCP:
++++ ++         *qp_type = IB_QPT_RC;
++++ ++         return 0;
++++ ++ case RDMA_PS_UDP:
++++ ++ case RDMA_PS_IPOIB:
++++ ++         *qp_type = IB_QPT_UD;
++++ ++         return 0;
++++ ++ default:
++++ ++         return -EINVAL;
++++ ++ }
++++ ++}
++++ ++
++++ ++static ssize_t ucma_create_id(struct ucma_file *file, const char __user *inbuf,
++++ ++                       int in_len, int out_len)
       {
        struct rdma_ucm_create_id cmd;
        struct rdma_ucm_create_id_resp resp;
        struct ucma_context *ctx;
++++ ++ enum ib_qp_type qp_type;
        int ret;
       
        if (out_len < sizeof(resp))
        if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
                return -EFAULT;
       
++++ ++ ret = ucma_get_qp_type(&cmd, &qp_type);
++++ ++ if (ret)
++++ ++         return ret;
++++ ++
        mutex_lock(&file->mut);
        ctx = ucma_alloc_ctx(file);
        mutex_unlock(&file->mut);
                return -ENOMEM;
       
        ctx->uid = cmd.uid;
---- -- ctx->cm_id = rdma_create_id(ucma_event_handler, ctx, cmd.ps);
++++ ++ ctx->cm_id = rdma_create_id(ucma_event_handler, ctx, cmd.ps, qp_type);
        if (IS_ERR(ctx->cm_id)) {
                ret = PTR_ERR(ctx->cm_id);
                goto err1;
@@@@@@@@ -1338,11 -1338,9 -1338,9 -1338,9 -1357,9 -1338,9 -1338,9 +1357,11 @@@@@@@@ static const struct file_operations ucm
       };
       
       static struct miscdevice ucma_misc = {
 ------ .minor  = MISC_DYNAMIC_MINOR,
 ------ .name   = "rdma_cm",
 ------ .fops   = &ucma_fops,
 ++++++ .minor          = MISC_DYNAMIC_MINOR,
 ++++++ .name           = "rdma_cm",
 ++++++ .nodename       = "infiniband/rdma_cm",
 ++++++ .mode           = 0666,
 ++++++ .fops           = &ucma_fops,
       };
       
       static ssize_t show_abi_version(struct device *dev,