mlx5_ib_cq.c (331798) | mlx5_ib_cq.c (331807) |
---|---|
1/*- 2 * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 8 unchanged lines hidden (view full) --- 17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 * | 1/*- 2 * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 8 unchanged lines hidden (view full) --- 17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 * |
25 * $FreeBSD: stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c 331798 2018-03-30 18:50:42Z hselasky $ | 25 * $FreeBSD: stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c 331807 2018-03-30 19:13:17Z hselasky $ |
26 */ 27 28#include <linux/kref.h> 29#include <rdma/ib_umem.h> 30#include <rdma/ib_user_verbs.h> 31#include <rdma/ib_cache.h> 32#include "mlx5_ib.h" 33 --- 927 unchanged lines hidden (view full) --- 961 MLX5_SET(cqc, cqc, cqe_sz, cqe_sz_to_mlx_sz(cqe_size)); 962 MLX5_SET(cqc, cqc, log_cq_size, ilog2(entries)); 963 MLX5_SET(cqc, cqc, uar_page, index); 964 MLX5_SET(cqc, cqc, c_eqn, eqn); 965 MLX5_SET64(cqc, cqc, dbr_addr, cq->db.dma); 966 if (cq->create_flags & IB_CQ_FLAGS_IGNORE_OVERRUN) 967 MLX5_SET(cqc, cqc, oi, 1); 968 | 26 */ 27 28#include <linux/kref.h> 29#include <rdma/ib_umem.h> 30#include <rdma/ib_user_verbs.h> 31#include <rdma/ib_cache.h> 32#include "mlx5_ib.h" 33 --- 927 unchanged lines hidden (view full) --- 961 MLX5_SET(cqc, cqc, cqe_sz, cqe_sz_to_mlx_sz(cqe_size)); 962 MLX5_SET(cqc, cqc, log_cq_size, ilog2(entries)); 963 MLX5_SET(cqc, cqc, uar_page, index); 964 MLX5_SET(cqc, cqc, c_eqn, eqn); 965 MLX5_SET64(cqc, cqc, dbr_addr, cq->db.dma); 966 if (cq->create_flags & IB_CQ_FLAGS_IGNORE_OVERRUN) 967 MLX5_SET(cqc, cqc, oi, 1); 968 |
969 err = mlx5_core_create_cq(dev->mdev, &cq->mcq, 970 (struct mlx5_create_cq_mbox_in *)cqb, inlen); | 969 err = mlx5_core_create_cq(dev->mdev, &cq->mcq, cqb, inlen); |
971 if (err) 972 goto err_cqb; 973 974 mlx5_ib_dbg(dev, "cqn 0x%x\n", cq->mcq.cqn); 975 cq->mcq.irqn = irqn; 976 cq->mcq.comp = mlx5_ib_cq_comp; 977 cq->mcq.event = mlx5_ib_cq_event; 978 --- 328 unchanged lines hidden (view full) --- 1307 MLX5_SET(cqc, cqc, log_page_size, 1308 page_shift - MLX5_ADAPTER_PAGE_SHIFT); 1309 MLX5_SET(cqc, cqc, cqe_sz, cqe_sz_to_mlx_sz(cqe_size)); 1310 MLX5_SET(cqc, cqc, log_cq_size, ilog2(entries)); 1311 1312 MLX5_SET(modify_cq_in, in, op_mod, MLX5_CQ_OPMOD_RESIZE); 1313 MLX5_SET(modify_cq_in, in, cqn, cq->mcq.cqn); 1314 | 970 if (err) 971 goto err_cqb; 972 973 mlx5_ib_dbg(dev, "cqn 0x%x\n", cq->mcq.cqn); 974 cq->mcq.irqn = irqn; 975 cq->mcq.comp = mlx5_ib_cq_comp; 976 cq->mcq.event = mlx5_ib_cq_event; 977 --- 328 unchanged lines hidden (view full) --- 1306 MLX5_SET(cqc, cqc, log_page_size, 1307 page_shift - MLX5_ADAPTER_PAGE_SHIFT); 1308 MLX5_SET(cqc, cqc, cqe_sz, cqe_sz_to_mlx_sz(cqe_size)); 1309 MLX5_SET(cqc, cqc, log_cq_size, ilog2(entries)); 1310 1311 MLX5_SET(modify_cq_in, in, op_mod, MLX5_CQ_OPMOD_RESIZE); 1312 MLX5_SET(modify_cq_in, in, cqn, cq->mcq.cqn); 1313 |
1315 err = mlx5_core_modify_cq(dev->mdev, &cq->mcq, 1316 (struct mlx5_modify_cq_mbox_in *)in, inlen); | 1314 err = mlx5_core_modify_cq(dev->mdev, &cq->mcq, in, inlen); |
1317 if (err) 1318 goto ex_alloc; 1319 1320 if (udata) { 1321 cq->ibcq.cqe = entries - 1; 1322 ib_umem_release(cq->buf.umem); 1323 cq->buf.umem = cq->resize_umem; 1324 cq->resize_umem = NULL; --- 72 unchanged lines hidden --- | 1315 if (err) 1316 goto ex_alloc; 1317 1318 if (udata) { 1319 cq->ibcq.cqe = entries - 1; 1320 ib_umem_release(cq->buf.umem); 1321 cq->buf.umem = cq->resize_umem; 1322 cq->resize_umem = NULL; --- 72 unchanged lines hidden --- |