Lines Matching +full:ddr +full:- +full:config
14 * - Redistributions of source code must retain the above
18 * - Redistributions in binary form must reproduce the above
33 #include <config.h>
44 #include "mlx4-abi.h"
59 HCA(MELLANOX, 0x634a), /* MT25408 "Hermon" DDR */
61 HCA(MELLANOX, 0x6732), /* MT25408 "Hermon" DDR PCIe gen2 */
65 HCA(MELLANOX, 0x6372), /* MT25458 ConnectX EN 10GBASE-T 10GigE */
66 HCA(MELLANOX, 0x675a), /* MT25458 ConnectX EN 10GBASE-T+Gen2 10GigE */
70 HCA(MELLANOX, 0x1002), /* MT25400 Family [ConnectX-2 Virtual Function] */
71 HCA(MELLANOX, 0x1003), /* MT27500 Family [ConnectX-3] */
72 HCA(MELLANOX, 0x1004), /* MT27500 Family [ConnectX-3 Virtual Function] */
127 hca_clock_page = mmap(NULL, mdev->page_size, in mlx4_map_internal_clock()
128 PROT_READ, MAP_SHARED, ibv_ctx->cmd_fd, in mlx4_map_internal_clock()
129 mdev->page_size * 3); in mlx4_map_internal_clock()
135 return -1; in mlx4_map_internal_clock()
138 context->hca_core_clock = hca_clock_page + in mlx4_map_internal_clock()
139 (context->core_clock.offset & (mdev->page_size - 1)); in mlx4_map_internal_clock()
153 struct mlx4_device *dev = to_mdev(&v_device->device); in mlx4_init_context()
161 ibv_ctx->cmd_fd = cmd_fd; in mlx4_init_context()
163 if (dev->abi_version <= MLX4_UVERBS_NO_DEV_CAPS_ABI_VERSION) { in mlx4_init_context()
168 context->num_qps = resp_v3.qp_tab_size; in mlx4_init_context()
170 context->cqe_size = sizeof (struct mlx4_cqe); in mlx4_init_context()
176 context->num_qps = resp.qp_tab_size; in mlx4_init_context()
179 context->cqe_size = resp.cqe_size; in mlx4_init_context()
181 context->cqe_size = sizeof (struct mlx4_cqe); in mlx4_init_context()
184 context->qp_table_shift = ffs(context->num_qps) - 1 - MLX4_QP_TABLE_BITS; in mlx4_init_context()
185 context->qp_table_mask = (1 << context->qp_table_shift) - 1; in mlx4_init_context()
187 context->port_query_cache[i].valid = 0; in mlx4_init_context()
189 ret = pthread_mutex_init(&context->qp_table_mutex, NULL); in mlx4_init_context()
193 context->qp_table[i].refcnt = 0; in mlx4_init_context()
196 context->db_list[i] = NULL; in mlx4_init_context()
198 ret = mlx4_init_xsrq_table(&context->xsrq_table, context->num_qps); in mlx4_init_context()
202 ret = pthread_mutex_init(&context->db_list_mutex, NULL); in mlx4_init_context()
206 context->uar = mmap(NULL, dev->page_size, PROT_WRITE, in mlx4_init_context()
208 if (context->uar == MAP_FAILED) in mlx4_init_context()
212 context->bf_page = mmap(NULL, dev->page_size, in mlx4_init_context()
214 dev->page_size); in mlx4_init_context()
215 if (context->bf_page == MAP_FAILED) { in mlx4_init_context()
218 context->bf_page = NULL; in mlx4_init_context()
219 context->bf_buf_size = 0; in mlx4_init_context()
221 context->bf_buf_size = bf_reg_size / 2; in mlx4_init_context()
222 context->bf_offset = 0; in mlx4_init_context()
223 ret = pthread_spin_init(&context->bf_lock, PTHREAD_PROCESS_PRIVATE); in mlx4_init_context()
228 context->bf_page = NULL; in mlx4_init_context()
229 context->bf_buf_size = 0; in mlx4_init_context()
232 ret = pthread_spin_init(&context->uar_lock, PTHREAD_PROCESS_PRIVATE); in mlx4_init_context()
235 ibv_ctx->ops = mlx4_ctx_ops; in mlx4_init_context()
237 context->hca_core_clock = NULL; in mlx4_init_context()
241 context->max_qp_wr = dev_attrs.orig_attr.max_qp_wr; in mlx4_init_context()
242 context->max_sge = dev_attrs.orig_attr.max_sge; in mlx4_init_context()
243 if (context->core_clock.offset_valid) in mlx4_init_context()
247 verbs_ctx->has_comp_mask = VERBS_CONTEXT_XRCD | VERBS_CONTEXT_SRQ | in mlx4_init_context()
264 if (context->bf_buf_size) in mlx4_init_context()
265 pthread_spin_destroy(&context->bf_lock); in mlx4_init_context()
267 pthread_mutex_destroy(&context->db_list_mutex); in mlx4_init_context()
269 mlx4_cleanup_xsrq_table(&context->xsrq_table); in mlx4_init_context()
271 pthread_mutex_destroy(&context->qp_table_mutex); in mlx4_init_context()
281 pthread_mutex_destroy(&context->qp_table_mutex); in mlx4_uninit_context()
282 mlx4_cleanup_xsrq_table(&context->xsrq_table); in mlx4_uninit_context()
283 pthread_mutex_destroy(&context->db_list_mutex); in mlx4_uninit_context()
284 pthread_spin_destroy(&context->bf_lock); in mlx4_uninit_context()
285 pthread_spin_destroy(&context->uar_lock); in mlx4_uninit_context()
287 munmap(context->uar, to_mdev(&v_device->device)->page_size); in mlx4_uninit_context()
288 if (context->bf_page) in mlx4_uninit_context()
289 munmap(context->bf_page, to_mdev(&v_device->device)->page_size); in mlx4_uninit_context()
290 if (context->hca_core_clock) in mlx4_uninit_context()
291 munmap(context->hca_core_clock - context->core_clock.offset, in mlx4_uninit_context()
292 to_mdev(&v_device->device)->page_size); in mlx4_uninit_context()
342 dev->page_size = sysconf(_SC_PAGESIZE); in mlx4_driver_init()
343 dev->abi_version = abi_version; in mlx4_driver_init()
345 dev->verbs_dev.ops = &mlx4_dev_ops; in mlx4_driver_init()
346 dev->verbs_dev.sz = sizeof(*dev); in mlx4_driver_init()
347 dev->verbs_dev.size_of_context = in mlx4_driver_init()
348 sizeof(struct mlx4_context) - sizeof(struct ibv_context); in mlx4_driver_init()
350 return &dev->verbs_dev; in mlx4_driver_init()