This source file includes following definitions.
- mlx5_core_attach_mcg
- mlx5_core_detach_mcg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 #include <linux/kernel.h>
34 #include <linux/module.h>
35 #include <linux/mlx5/driver.h>
36 #include <linux/mlx5/cmd.h>
37 #include <rdma/ib_verbs.h>
38 #include "mlx5_core.h"
39
40 int mlx5_core_attach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn)
41 {
42 u32 out[MLX5_ST_SZ_DW(attach_to_mcg_out)] = {0};
43 u32 in[MLX5_ST_SZ_DW(attach_to_mcg_in)] = {0};
44 void *gid;
45
46 MLX5_SET(attach_to_mcg_in, in, opcode, MLX5_CMD_OP_ATTACH_TO_MCG);
47 MLX5_SET(attach_to_mcg_in, in, qpn, qpn);
48 gid = MLX5_ADDR_OF(attach_to_mcg_in, in, multicast_gid);
49 memcpy(gid, mgid, sizeof(*mgid));
50 return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
51 }
52 EXPORT_SYMBOL(mlx5_core_attach_mcg);
53
54 int mlx5_core_detach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn)
55 {
56 u32 out[MLX5_ST_SZ_DW(detach_from_mcg_out)] = {0};
57 u32 in[MLX5_ST_SZ_DW(detach_from_mcg_in)] = {0};
58 void *gid;
59
60 MLX5_SET(detach_from_mcg_in, in, opcode, MLX5_CMD_OP_DETACH_FROM_MCG);
61 MLX5_SET(detach_from_mcg_in, in, qpn, qpn);
62 gid = MLX5_ADDR_OF(detach_from_mcg_in, in, multicast_gid);
63 memcpy(gid, mgid, sizeof(*mgid));
64 return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
65 }
66 EXPORT_SYMBOL(mlx5_core_detach_mcg);