verbs.c (cbd32a1c56e36fedaa93a727699188bd3e6e6f67) verbs.c (72a7720fca37fec0daf295923f17ac5d88a613e1)
1/* QLogic qedr NIC Driver
2 * Copyright (c) 2015-2016 QLogic Corporation
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 207 unchanged lines hidden (view full) ---

216 return -EINVAL;
217 }
218
219 rdma_port = dev->ops->rdma_query_port(dev->rdma_ctx);
220
221 /* *attr being zeroed by the caller, avoid zeroing it here */
222 if (rdma_port->port_state == QED_RDMA_PORT_UP) {
223 attr->state = IB_PORT_ACTIVE;
1/* QLogic qedr NIC Driver
2 * Copyright (c) 2015-2016 QLogic Corporation
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 207 unchanged lines hidden (view full) ---

216 return -EINVAL;
217 }
218
219 rdma_port = dev->ops->rdma_query_port(dev->rdma_ctx);
220
221 /* *attr being zeroed by the caller, avoid zeroing it here */
222 if (rdma_port->port_state == QED_RDMA_PORT_UP) {
223 attr->state = IB_PORT_ACTIVE;
224 attr->phys_state = 5;
224 attr->phys_state = IB_PORT_PHYS_STATE_LINK_UP;
225 } else {
226 attr->state = IB_PORT_DOWN;
225 } else {
226 attr->state = IB_PORT_DOWN;
227 attr->phys_state = 3;
227 attr->phys_state = IB_PORT_PHYS_STATE_DISABLED;
228 }
229 attr->max_mtu = IB_MTU_4096;
230 attr->active_mtu = iboe_get_mtu(dev->ndev->mtu);
231 attr->lid = 0;
232 attr->lmc = 0;
233 attr->sm_lid = 0;
234 attr->sm_sl = 0;
235 attr->ip_gids = true;

--- 2210 unchanged lines hidden (view full) ---

2446}
2447
2448int qedr_destroy_qp(struct ib_qp *ibqp, struct ib_udata *udata)
2449{
2450 struct qedr_qp *qp = get_qedr_qp(ibqp);
2451 struct qedr_dev *dev = qp->dev;
2452 struct ib_qp_attr attr;
2453 int attr_mask = 0;
228 }
229 attr->max_mtu = IB_MTU_4096;
230 attr->active_mtu = iboe_get_mtu(dev->ndev->mtu);
231 attr->lid = 0;
232 attr->lmc = 0;
233 attr->sm_lid = 0;
234 attr->sm_sl = 0;
235 attr->ip_gids = true;

--- 2210 unchanged lines hidden (view full) ---

2446}
2447
2448int qedr_destroy_qp(struct ib_qp *ibqp, struct ib_udata *udata)
2449{
2450 struct qedr_qp *qp = get_qedr_qp(ibqp);
2451 struct qedr_dev *dev = qp->dev;
2452 struct ib_qp_attr attr;
2453 int attr_mask = 0;
2454 int rc = 0;
2455
2456 DP_DEBUG(dev, QEDR_MSG_QP, "destroy qp: destroying %p, qp type=%d\n",
2457 qp, qp->qp_type);
2458
2459 if (rdma_protocol_roce(&dev->ibdev, 1)) {
2460 if ((qp->state != QED_ROCE_QP_STATE_RESET) &&
2461 (qp->state != QED_ROCE_QP_STATE_ERR) &&
2462 (qp->state != QED_ROCE_QP_STATE_INIT)) {

--- 28 unchanged lines hidden (view full) ---

2491
2492 qedr_free_qp_resources(dev, qp, udata);
2493
2494 if (atomic_dec_and_test(&qp->refcnt) &&
2495 rdma_protocol_iwarp(&dev->ibdev, 1)) {
2496 xa_erase_irq(&dev->qps, qp->qp_id);
2497 kfree(qp);
2498 }
2454
2455 DP_DEBUG(dev, QEDR_MSG_QP, "destroy qp: destroying %p, qp type=%d\n",
2456 qp, qp->qp_type);
2457
2458 if (rdma_protocol_roce(&dev->ibdev, 1)) {
2459 if ((qp->state != QED_ROCE_QP_STATE_RESET) &&
2460 (qp->state != QED_ROCE_QP_STATE_ERR) &&
2461 (qp->state != QED_ROCE_QP_STATE_INIT)) {

--- 28 unchanged lines hidden (view full) ---

2490
2491 qedr_free_qp_resources(dev, qp, udata);
2492
2493 if (atomic_dec_and_test(&qp->refcnt) &&
2494 rdma_protocol_iwarp(&dev->ibdev, 1)) {
2495 xa_erase_irq(&dev->qps, qp->qp_id);
2496 kfree(qp);
2497 }
2499 return rc;
2498 return 0;
2500}
2501
2502int qedr_create_ah(struct ib_ah *ibah, struct rdma_ah_attr *attr, u32 flags,
2503 struct ib_udata *udata)
2504{
2505 struct qedr_ah *ah = get_qedr_ah(ibah);
2506
2507 rdma_copy_ah_attr(&ah->attr, attr);

--- 1618 unchanged lines hidden ---
2499}
2500
2501int qedr_create_ah(struct ib_ah *ibah, struct rdma_ah_attr *attr, u32 flags,
2502 struct ib_udata *udata)
2503{
2504 struct qedr_ah *ah = get_qedr_ah(ibah);
2505
2506 rdma_copy_ah_attr(&ah->attr, attr);

--- 1618 unchanged lines hidden ---