mad.c (2ac5e38ea4203852d6e99edd3cf11f044b0a409f) mad.c (b090c4e3a07c33ffdf95fb7601551b38fc2a4bbb)
1/*
2 * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
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:

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

197
198 memset(&ah_attr, 0, sizeof ah_attr);
199 ah_attr.type = rdma_ah_find_type(&dev->ib_dev, port_num);
200 rdma_ah_set_dlid(&ah_attr, lid);
201 rdma_ah_set_sl(&ah_attr, sl);
202 rdma_ah_set_port_num(&ah_attr, port_num);
203
204 new_ah = rdma_create_ah(dev->send_agent[port_num - 1][0]->qp->pd,
1/*
2 * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
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:

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

197
198 memset(&ah_attr, 0, sizeof ah_attr);
199 ah_attr.type = rdma_ah_find_type(&dev->ib_dev, port_num);
200 rdma_ah_set_dlid(&ah_attr, lid);
201 rdma_ah_set_sl(&ah_attr, sl);
202 rdma_ah_set_port_num(&ah_attr, port_num);
203
204 new_ah = rdma_create_ah(dev->send_agent[port_num - 1][0]->qp->pd,
205 &ah_attr);
205 &ah_attr, 0);
206 if (IS_ERR(new_ah))
207 return;
208
209 spin_lock_irqsave(&dev->sm_lock, flags);
210 if (dev->sm_ah[port_num - 1])
211 rdma_destroy_ah(dev->sm_ah[port_num - 1]);
212 dev->sm_ah[port_num - 1] = new_ah;
213 spin_unlock_irqrestore(&dev->sm_lock, flags);

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

562 if (is_eth) {
563 union ib_gid sgid;
564 union ib_gid dgid;
565
566 if (get_gids_from_l3_hdr(grh, &sgid, &dgid))
567 return -EINVAL;
568 rdma_ah_set_grh(&attr, &dgid, 0, 0, 0, 0);
569 }
206 if (IS_ERR(new_ah))
207 return;
208
209 spin_lock_irqsave(&dev->sm_lock, flags);
210 if (dev->sm_ah[port_num - 1])
211 rdma_destroy_ah(dev->sm_ah[port_num - 1]);
212 dev->sm_ah[port_num - 1] = new_ah;
213 spin_unlock_irqrestore(&dev->sm_lock, flags);

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

562 if (is_eth) {
563 union ib_gid sgid;
564 union ib_gid dgid;
565
566 if (get_gids_from_l3_hdr(grh, &sgid, &dgid))
567 return -EINVAL;
568 rdma_ah_set_grh(&attr, &dgid, 0, 0, 0, 0);
569 }
570 ah = rdma_create_ah(tun_ctx->pd, &attr);
570 ah = rdma_create_ah(tun_ctx->pd, &attr, 0);
571 if (IS_ERR(ah))
572 return -ENOMEM;
573
574 /* allocate tunnel tx buf after pass failure returns */
575 spin_lock(&tun_qp->tx_lock);
576 if (tun_qp->tx_ix_head - tun_qp->tx_ix_tail >=
577 (MLX4_NUM_TUNNEL_BUFS - 1))
578 ret = -EAGAIN;

--- 1795 unchanged lines hidden ---
571 if (IS_ERR(ah))
572 return -ENOMEM;
573
574 /* allocate tunnel tx buf after pass failure returns */
575 spin_lock(&tun_qp->tx_lock);
576 if (tun_qp->tx_ix_head - tun_qp->tx_ix_tail >=
577 (MLX4_NUM_TUNNEL_BUFS - 1))
578 ret = -EAGAIN;

--- 1795 unchanged lines hidden ---