Lines Matching refs:qpn
49 void mlx4_qp_event(struct mlx4_dev *dev, u32 qpn, int event_type) in mlx4_qp_event() argument
56 qp = __mlx4_qp_lookup(dev, qpn); in mlx4_qp_event()
63 mlx4_dbg(dev, "Async event for none existent QP %08x\n", qpn); in mlx4_qp_event()
79 *proxy_qp0 = qp->qpn >= pf_proxy_offset && qp->qpn <= pf_proxy_offset + 1; in is_master_qp0()
81 *real_qp0 = qp->qpn >= dev->phys_caps.base_sqpn && in is_master_qp0()
82 qp->qpn <= dev->phys_caps.base_sqpn + 1; in is_master_qp0()
145 ret = mlx4_cmd(dev, 0, qp->qpn, 2, in __mlx4_qp_modify()
150 port = (qp->qpn & 1) + 1; in __mlx4_qp_modify()
174 cpu_to_be16(mlx4_qp_roce_entropy(dev, qp->qpn)); in __mlx4_qp_modify()
180 cpu_to_be32(qp->qpn); in __mlx4_qp_modify()
183 qp->qpn | (!!sqd_event << 31), in __mlx4_qp_modify()
188 port = (qp->qpn & 1) + 1; in __mlx4_qp_modify()
308 int __mlx4_qp_alloc_icm(struct mlx4_dev *dev, int qpn) in __mlx4_qp_alloc_icm() argument
314 err = mlx4_table_get(dev, &qp_table->qp_table, qpn); in __mlx4_qp_alloc_icm()
318 err = mlx4_table_get(dev, &qp_table->auxc_table, qpn); in __mlx4_qp_alloc_icm()
322 err = mlx4_table_get(dev, &qp_table->altc_table, qpn); in __mlx4_qp_alloc_icm()
326 err = mlx4_table_get(dev, &qp_table->rdmarc_table, qpn); in __mlx4_qp_alloc_icm()
330 err = mlx4_table_get(dev, &qp_table->cmpt_table, qpn); in __mlx4_qp_alloc_icm()
337 mlx4_table_put(dev, &qp_table->rdmarc_table, qpn); in __mlx4_qp_alloc_icm()
340 mlx4_table_put(dev, &qp_table->altc_table, qpn); in __mlx4_qp_alloc_icm()
343 mlx4_table_put(dev, &qp_table->auxc_table, qpn); in __mlx4_qp_alloc_icm()
346 mlx4_table_put(dev, &qp_table->qp_table, qpn); in __mlx4_qp_alloc_icm()
352 static int mlx4_qp_alloc_icm(struct mlx4_dev *dev, int qpn) in mlx4_qp_alloc_icm() argument
357 set_param_l(¶m, qpn); in mlx4_qp_alloc_icm()
362 return __mlx4_qp_alloc_icm(dev, qpn); in mlx4_qp_alloc_icm()
365 void __mlx4_qp_free_icm(struct mlx4_dev *dev, int qpn) in __mlx4_qp_free_icm() argument
370 mlx4_table_put(dev, &qp_table->cmpt_table, qpn); in __mlx4_qp_free_icm()
371 mlx4_table_put(dev, &qp_table->rdmarc_table, qpn); in __mlx4_qp_free_icm()
372 mlx4_table_put(dev, &qp_table->altc_table, qpn); in __mlx4_qp_free_icm()
373 mlx4_table_put(dev, &qp_table->auxc_table, qpn); in __mlx4_qp_free_icm()
374 mlx4_table_put(dev, &qp_table->qp_table, qpn); in __mlx4_qp_free_icm()
377 static void mlx4_qp_free_icm(struct mlx4_dev *dev, int qpn) in mlx4_qp_free_icm() argument
382 set_param_l(&in_param, qpn); in mlx4_qp_free_icm()
386 mlx4_warn(dev, "Failed to free icm of qp:%d\n", qpn); in mlx4_qp_free_icm()
388 __mlx4_qp_free_icm(dev, qpn); in mlx4_qp_free_icm()
391 struct mlx4_qp *mlx4_qp_lookup(struct mlx4_dev *dev, u32 qpn) in mlx4_qp_lookup() argument
398 qp = __mlx4_qp_lookup(dev, qpn); in mlx4_qp_lookup()
404 int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp) in mlx4_qp_alloc() argument
410 if (!qpn) in mlx4_qp_alloc()
413 qp->qpn = qpn; in mlx4_qp_alloc()
415 err = mlx4_qp_alloc_icm(dev, qpn); in mlx4_qp_alloc()
420 err = radix_tree_insert(&dev->qp_table_tree, qp->qpn & in mlx4_qp_alloc()
432 mlx4_qp_free_icm(dev, qpn); in mlx4_qp_alloc()
438 int mlx4_update_qp(struct mlx4_dev *dev, u32 qpn, in mlx4_update_qp() argument
504 err = mlx4_cmd(dev, mailbox->dma, qpn & 0xffffff, 0, in mlx4_update_qp()
519 radix_tree_delete(&dev->qp_table_tree, qp->qpn & (dev->caps.num_qps - 1)); in mlx4_qp_remove()
530 mlx4_qp_free_icm(dev, qp->qpn); in mlx4_qp_free()
903 err = mlx4_cmd_box(dev, 0, mailbox->dma, qp->qpn, 0, in mlx4_qp_query()
947 u16 mlx4_qp_roce_entropy(struct mlx4_dev *dev, u32 qpn) in mlx4_qp_roce_entropy() argument
953 qp.qpn = qpn; in mlx4_qp_roce_entropy()
958 u16 folded_src = folded_qp(qpn); in mlx4_qp_roce_entropy()
960 return (dest_qpn != qpn) ? in mlx4_qp_roce_entropy()