mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
Merge branches 'cxgb4' and 'mlx5' into for-next
This commit is contained in:
commit
56c5333cfc
@ -675,7 +675,7 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev,
|
||||
int err;
|
||||
|
||||
uuari = &dev->mdev.priv.uuari;
|
||||
if (init_attr->create_flags & ~IB_QP_CREATE_SIGNATURE_EN)
|
||||
if (init_attr->create_flags & ~(IB_QP_CREATE_SIGNATURE_EN | IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK))
|
||||
return -EINVAL;
|
||||
|
||||
if (init_attr->qp_type == MLX5_IB_QPT_REG_UMR)
|
||||
|
@ -94,6 +94,11 @@ int mlx5_core_create_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr,
|
||||
write_lock_irq(&table->lock);
|
||||
err = radix_tree_insert(&table->tree, mlx5_base_mkey(mr->key), mr);
|
||||
write_unlock_irq(&table->lock);
|
||||
if (err) {
|
||||
mlx5_core_warn(dev, "failed radix tree insert of mr 0x%x, %d\n",
|
||||
mlx5_base_mkey(mr->key), err);
|
||||
mlx5_core_destroy_mkey(dev, mr);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
@ -104,12 +109,22 @@ int mlx5_core_destroy_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr)
|
||||
struct mlx5_mr_table *table = &dev->priv.mr_table;
|
||||
struct mlx5_destroy_mkey_mbox_in in;
|
||||
struct mlx5_destroy_mkey_mbox_out out;
|
||||
struct mlx5_core_mr *deleted_mr;
|
||||
unsigned long flags;
|
||||
int err;
|
||||
|
||||
memset(&in, 0, sizeof(in));
|
||||
memset(&out, 0, sizeof(out));
|
||||
|
||||
write_lock_irqsave(&table->lock, flags);
|
||||
deleted_mr = radix_tree_delete(&table->tree, mlx5_base_mkey(mr->key));
|
||||
write_unlock_irqrestore(&table->lock, flags);
|
||||
if (!deleted_mr) {
|
||||
mlx5_core_warn(dev, "failed radix tree delete of mr 0x%x\n",
|
||||
mlx5_base_mkey(mr->key));
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
in.hdr.opcode = cpu_to_be16(MLX5_CMD_OP_DESTROY_MKEY);
|
||||
in.mkey = cpu_to_be32(mlx5_mkey_to_idx(mr->key));
|
||||
err = mlx5_cmd_exec(dev, &in, sizeof(in), &out, sizeof(out));
|
||||
@ -119,10 +134,6 @@ int mlx5_core_destroy_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr)
|
||||
if (out.hdr.status)
|
||||
return mlx5_cmd_status_to_err(&out.hdr);
|
||||
|
||||
write_lock_irqsave(&table->lock, flags);
|
||||
radix_tree_delete(&table->tree, mlx5_base_mkey(mr->key));
|
||||
write_unlock_irqrestore(&table->lock, flags);
|
||||
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL(mlx5_core_destroy_mkey);
|
||||
|
Loading…
Reference in New Issue
Block a user