This source file includes following definitions.
- rdev_to_dev
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
34
35
36
37
38
39
40 #ifndef __BNXT_RE_H__
41 #define __BNXT_RE_H__
42 #define ROCE_DRV_MODULE_NAME "bnxt_re"
43
44 #define BNXT_RE_DESC "Broadcom NetXtreme-C/E RoCE Driver"
45 #define BNXT_RE_PAGE_SHIFT_4K (12)
46 #define BNXT_RE_PAGE_SHIFT_8K (13)
47 #define BNXT_RE_PAGE_SHIFT_64K (16)
48 #define BNXT_RE_PAGE_SHIFT_2M (21)
49 #define BNXT_RE_PAGE_SHIFT_8M (23)
50 #define BNXT_RE_PAGE_SHIFT_1G (30)
51
52 #define BNXT_RE_PAGE_SIZE_4K BIT(BNXT_RE_PAGE_SHIFT_4K)
53 #define BNXT_RE_PAGE_SIZE_8K BIT(BNXT_RE_PAGE_SHIFT_8K)
54 #define BNXT_RE_PAGE_SIZE_64K BIT(BNXT_RE_PAGE_SHIFT_64K)
55 #define BNXT_RE_PAGE_SIZE_2M BIT(BNXT_RE_PAGE_SHIFT_2M)
56 #define BNXT_RE_PAGE_SIZE_8M BIT(BNXT_RE_PAGE_SHIFT_8M)
57 #define BNXT_RE_PAGE_SIZE_1G BIT(BNXT_RE_PAGE_SHIFT_1G)
58
59 #define BNXT_RE_MAX_MR_SIZE_LOW BIT_ULL(BNXT_RE_PAGE_SHIFT_1G)
60 #define BNXT_RE_MAX_MR_SIZE_HIGH BIT_ULL(39)
61 #define BNXT_RE_MAX_MR_SIZE BNXT_RE_MAX_MR_SIZE_HIGH
62
63 #define BNXT_RE_MAX_QPC_COUNT (64 * 1024)
64 #define BNXT_RE_MAX_MRW_COUNT (64 * 1024)
65 #define BNXT_RE_MAX_SRQC_COUNT (64 * 1024)
66 #define BNXT_RE_MAX_CQ_COUNT (64 * 1024)
67 #define BNXT_RE_MAX_MRW_COUNT_64K (64 * 1024)
68 #define BNXT_RE_MAX_MRW_COUNT_256K (256 * 1024)
69
70
71 #define BNXT_RE_RESVD_MR_FOR_PF (32 * 1024)
72 #define BNXT_RE_MAX_GID_PER_VF 128
73
74
75
76
77
78
79 #define BNXT_RE_PCT_RSVD_FOR_PF 50
80
81 #define BNXT_RE_UD_QP_HW_STALL 0x400000
82
83 #define BNXT_RE_RQ_WQE_THRESHOLD 32
84
85
86
87
88
89
90 #define BNXT_RE_DEFAULT_ACK_DELAY 16
91
92 struct bnxt_re_work {
93 struct work_struct work;
94 unsigned long event;
95 struct bnxt_re_dev *rdev;
96 struct net_device *vlan_dev;
97 };
98
99 struct bnxt_re_sqp_entries {
100 struct bnxt_qplib_sge sge;
101 u64 wrid;
102
103 struct bnxt_qplib_cqe cqe;
104 struct bnxt_re_qp *qp1_qp;
105 };
106
107 #define BNXT_RE_MIN_MSIX 2
108 #define BNXT_RE_MAX_MSIX 9
109 #define BNXT_RE_AEQ_IDX 0
110 #define BNXT_RE_NQ_IDX 1
111
112 struct bnxt_re_dev {
113 struct ib_device ibdev;
114 struct list_head list;
115 unsigned long flags;
116 #define BNXT_RE_FLAG_NETDEV_REGISTERED 0
117 #define BNXT_RE_FLAG_IBDEV_REGISTERED 1
118 #define BNXT_RE_FLAG_GOT_MSIX 2
119 #define BNXT_RE_FLAG_HAVE_L2_REF 3
120 #define BNXT_RE_FLAG_RCFW_CHANNEL_EN 4
121 #define BNXT_RE_FLAG_QOS_WORK_REG 5
122 #define BNXT_RE_FLAG_RESOURCES_ALLOCATED 7
123 #define BNXT_RE_FLAG_RESOURCES_INITIALIZED 8
124 #define BNXT_RE_FLAG_ISSUE_ROCE_STATS 29
125 struct net_device *netdev;
126 unsigned int version, major, minor;
127 struct bnxt_qplib_chip_ctx chip_ctx;
128 struct bnxt_en_dev *en_dev;
129 struct bnxt_msix_entry msix_entries[BNXT_RE_MAX_MSIX];
130 int num_msix;
131
132 int id;
133
134 struct delayed_work worker;
135 u8 cur_prio_map;
136 u8 active_speed;
137 u8 active_width;
138
139
140 struct tasklet_struct nq_task;
141
142
143 struct bnxt_qplib_rcfw rcfw;
144
145
146 struct bnxt_qplib_nq nq[BNXT_RE_MAX_MSIX];
147
148
149 struct bnxt_qplib_dev_attr dev_attr;
150 struct bnxt_qplib_ctx qplib_ctx;
151 struct bnxt_qplib_res qplib_res;
152 struct bnxt_qplib_dpi dpi_privileged;
153
154 atomic_t qp_count;
155 struct mutex qp_lock;
156 struct list_head qp_list;
157
158 atomic_t cq_count;
159 atomic_t srq_count;
160 atomic_t mr_count;
161 atomic_t mw_count;
162 atomic_t sched_count;
163
164 u16 cosq[2];
165
166
167 u32 sqp_id;
168 struct bnxt_re_qp *qp1_sqp;
169 struct bnxt_re_ah *sqp_ah;
170 struct bnxt_re_sqp_entries sqp_tbl[1024];
171 atomic_t nq_alloc_cnt;
172 u32 is_virtfn;
173 u32 num_vfs;
174 struct bnxt_qplib_roce_stats stats;
175 };
176
177 #define to_bnxt_re_dev(ptr, member) \
178 container_of((ptr), struct bnxt_re_dev, member)
179
180 #define BNXT_RE_ROCE_V1_PACKET 0
181 #define BNXT_RE_ROCEV2_IPV4_PACKET 2
182 #define BNXT_RE_ROCEV2_IPV6_PACKET 3
183
184 static inline struct device *rdev_to_dev(struct bnxt_re_dev *rdev)
185 {
186 if (rdev)
187 return &rdev->ibdev.dev;
188 return NULL;
189 }
190
191 #endif