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#ifndef __TRANSOBJ_H__
34#define __TRANSOBJ_H__
35
36#include <linux/mlx5/driver.h>
37
38int mlx5_core_alloc_transport_domain(struct mlx5_core_dev *dev, u32 *tdn);
39void mlx5_core_dealloc_transport_domain(struct mlx5_core_dev *dev, u32 tdn);
40int mlx5_core_create_rq(struct mlx5_core_dev *dev, u32 *in, int inlen,
41 u32 *rqn);
42int mlx5_core_modify_rq(struct mlx5_core_dev *dev, u32 rqn, u32 *in, int inlen);
43void mlx5_core_destroy_rq(struct mlx5_core_dev *dev, u32 rqn);
44int mlx5_core_query_rq(struct mlx5_core_dev *dev, u32 rqn, u32 *out);
45int mlx5_core_create_sq(struct mlx5_core_dev *dev, u32 *in, int inlen,
46 u32 *sqn);
47int mlx5_core_modify_sq(struct mlx5_core_dev *dev, u32 sqn, u32 *in, int inlen);
48void mlx5_core_destroy_sq(struct mlx5_core_dev *dev, u32 sqn);
49int mlx5_core_query_sq(struct mlx5_core_dev *dev, u32 sqn, u32 *out);
50int mlx5_core_query_sq_state(struct mlx5_core_dev *dev, u32 sqn, u8 *state);
51int mlx5_core_create_tir(struct mlx5_core_dev *dev, u32 *in, int inlen,
52 u32 *tirn);
53int mlx5_core_modify_tir(struct mlx5_core_dev *dev, u32 tirn, u32 *in,
54 int inlen);
55void mlx5_core_destroy_tir(struct mlx5_core_dev *dev, u32 tirn);
56int mlx5_core_create_tis(struct mlx5_core_dev *dev, u32 *in, int inlen,
57 u32 *tisn);
58int mlx5_core_modify_tis(struct mlx5_core_dev *dev, u32 tisn, u32 *in,
59 int inlen);
60void mlx5_core_destroy_tis(struct mlx5_core_dev *dev, u32 tisn);
61int mlx5_core_create_rmp(struct mlx5_core_dev *dev, u32 *in, int inlen,
62 u32 *rmpn);
63int mlx5_core_modify_rmp(struct mlx5_core_dev *dev, u32 *in, int inlen);
64int mlx5_core_destroy_rmp(struct mlx5_core_dev *dev, u32 rmpn);
65int mlx5_core_query_rmp(struct mlx5_core_dev *dev, u32 rmpn, u32 *out);
66int mlx5_core_arm_rmp(struct mlx5_core_dev *dev, u32 rmpn, u16 lwm);
67int mlx5_core_create_xsrq(struct mlx5_core_dev *dev, u32 *in, int inlen,
68 u32 *rmpn);
69int mlx5_core_destroy_xsrq(struct mlx5_core_dev *dev, u32 rmpn);
70int mlx5_core_arm_xsrq(struct mlx5_core_dev *dev, u32 rmpn, u16 lwm);
71
72int mlx5_core_create_rqt(struct mlx5_core_dev *dev, u32 *in, int inlen,
73 u32 *rqtn);
74int mlx5_core_modify_rqt(struct mlx5_core_dev *dev, u32 rqtn, u32 *in,
75 int inlen);
76void mlx5_core_destroy_rqt(struct mlx5_core_dev *dev, u32 rqtn);
77
78struct mlx5_hairpin_params {
79 u8 log_data_size;
80 u8 log_num_packets;
81 u16 q_counter;
82 int num_channels;
83};
84
85struct mlx5_hairpin {
86 struct mlx5_core_dev *func_mdev;
87 struct mlx5_core_dev *peer_mdev;
88
89 int num_channels;
90
91 u32 *rqn;
92 u32 *sqn;
93
94 bool peer_gone;
95};
96
97struct mlx5_hairpin *
98mlx5_core_hairpin_create(struct mlx5_core_dev *func_mdev,
99 struct mlx5_core_dev *peer_mdev,
100 struct mlx5_hairpin_params *params);
101
102void mlx5_core_hairpin_destroy(struct mlx5_hairpin *pair);
103#endif
104