Skip to content

Commit a3cfdd3

Browse files
gurmichaelLeon Romanovsky
authored andcommitted
{IB,net}/mlx5: Move asynchronous mkey creation to mlx5_ib
As mlx5_ib is the only user of the mlx5_core_create_mkey_cb, move the logic inside mlx5_ib and cleanup the code in mlx5_core. Signed-off-by: Michael Guralnik <michaelgur@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
1 parent fc6a9f8 commit a3cfdd3

3 files changed

Lines changed: 6 additions & 28 deletions

File tree

  • drivers
    • infiniband/hw/mlx5
    • net/ethernet/mellanox/mlx5/core
  • include/linux/mlx5

‎drivers/infiniband/hw/mlx5/mr.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ mlx5_ib_create_mkey_cb(struct mlx5_ib_dev *dev,
8181
u32 *in, int inlen, u32 *out, int outlen,
8282
struct mlx5_async_work *context)
8383
{
84+
MLX5_SET(create_mkey_in, in, opcode, MLX5_CMD_OP_CREATE_MKEY);
8485
assign_mkey_variant(dev, mkey, in);
85-
return mlx5_core_create_mkey_cb(dev->mdev, mkey, async_ctx,
86-
in, inlen, out, outlen,
87-
create_mkey_callback, context);
86+
return mlx5_cmd_exec_cb(async_ctx, in, inlen, out, outlen,
87+
create_mkey_callback, context);
8888
}
8989

9090
static void clean_mr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr);

‎drivers/net/ethernet/mellanox/mlx5/core/mr.c‎

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,9 @@
3636
#include <linux/mlx5/cmd.h>
3737
#include "mlx5_core.h"
3838

39-
int mlx5_core_create_mkey_cb(struct mlx5_core_dev *dev,
40-
struct mlx5_core_mkey *mkey,
41-
struct mlx5_async_ctx *async_ctx, u32 *in,
42-
int inlen, u32 *out, int outlen,
43-
mlx5_async_cbk_t callback,
44-
struct mlx5_async_work *context)
39+
int mlx5_core_create_mkey(struct mlx5_core_dev *dev,
40+
struct mlx5_core_mkey *mkey,
41+
u32 *in, int inlen)
4542
{
4643
u32 lout[MLX5_ST_SZ_DW(create_mkey_out)] = {0};
4744
u32 mkey_index;
@@ -51,10 +48,6 @@ int mlx5_core_create_mkey_cb(struct mlx5_core_dev *dev,
5148

5249
MLX5_SET(create_mkey_in, in, opcode, MLX5_CMD_OP_CREATE_MKEY);
5350

54-
if (callback)
55-
return mlx5_cmd_exec_cb(async_ctx, in, inlen, out, outlen,
56-
callback, context);
57-
5851
err = mlx5_cmd_exec(dev, in, inlen, lout, sizeof(lout));
5952
if (err)
6053
return err;
@@ -70,15 +63,6 @@ int mlx5_core_create_mkey_cb(struct mlx5_core_dev *dev,
7063
mkey_index, key, mkey->key);
7164
return 0;
7265
}
73-
EXPORT_SYMBOL(mlx5_core_create_mkey_cb);
74-
75-
int mlx5_core_create_mkey(struct mlx5_core_dev *dev,
76-
struct mlx5_core_mkey *mkey,
77-
u32 *in, int inlen)
78-
{
79-
return mlx5_core_create_mkey_cb(dev, mkey, NULL, in, inlen,
80-
NULL, 0, NULL, NULL);
81-
}
8266
EXPORT_SYMBOL(mlx5_core_create_mkey);
8367

8468
int mlx5_core_destroy_mkey(struct mlx5_core_dev *dev,

‎include/linux/mlx5/driver.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -943,12 +943,6 @@ struct mlx5_cmd_mailbox *mlx5_alloc_cmd_mailbox_chain(struct mlx5_core_dev *dev,
943943
gfp_t flags, int npages);
944944
void mlx5_free_cmd_mailbox_chain(struct mlx5_core_dev *dev,
945945
struct mlx5_cmd_mailbox *head);
946-
int mlx5_core_create_mkey_cb(struct mlx5_core_dev *dev,
947-
struct mlx5_core_mkey *mkey,
948-
struct mlx5_async_ctx *async_ctx, u32 *in,
949-
int inlen, u32 *out, int outlen,
950-
mlx5_async_cbk_t callback,
951-
struct mlx5_async_work *context);
952946
int mlx5_core_create_mkey(struct mlx5_core_dev *dev,
953947
struct mlx5_core_mkey *mkey,
954948
u32 *in, int inlen);

0 commit comments

Comments
 (0)