mad.c (90898850ec4e7b3ba0f9a35cc7169ff19ff367a6) mad.c (0a18cfe4f6d7dba135a04dc18633006ba5b51646)
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:

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

195 if (!dev->send_agent[port_num - 1][0])
196 return;
197
198 memset(&ah_attr, 0, sizeof ah_attr);
199 ah_attr.dlid = lid;
200 ah_attr.sl = sl;
201 ah_attr.port_num = port_num;
202
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:

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

195 if (!dev->send_agent[port_num - 1][0])
196 return;
197
198 memset(&ah_attr, 0, sizeof ah_attr);
199 ah_attr.dlid = lid;
200 ah_attr.sl = sl;
201 ah_attr.port_num = port_num;
202
203 new_ah = ib_create_ah(dev->send_agent[port_num - 1][0]->qp->pd,
204 &ah_attr);
203 new_ah = rdma_create_ah(dev->send_agent[port_num - 1][0]->qp->pd,
204 &ah_attr);
205 if (IS_ERR(new_ah))
206 return;
207
208 spin_lock_irqsave(&dev->sm_lock, flags);
209 if (dev->sm_ah[port_num - 1])
210 ib_destroy_ah(dev->sm_ah[port_num - 1]);
211 dev->sm_ah[port_num - 1] = new_ah;
212 spin_unlock_irqrestore(&dev->sm_lock, flags);

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

558 attr.port_num = port;
559 if (is_eth) {
560 union ib_gid sgid;
561
562 if (get_gids_from_l3_hdr(grh, &sgid, &attr.grh.dgid))
563 return -EINVAL;
564 attr.ah_flags = IB_AH_GRH;
565 }
205 if (IS_ERR(new_ah))
206 return;
207
208 spin_lock_irqsave(&dev->sm_lock, flags);
209 if (dev->sm_ah[port_num - 1])
210 ib_destroy_ah(dev->sm_ah[port_num - 1]);
211 dev->sm_ah[port_num - 1] = new_ah;
212 spin_unlock_irqrestore(&dev->sm_lock, flags);

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

558 attr.port_num = port;
559 if (is_eth) {
560 union ib_gid sgid;
561
562 if (get_gids_from_l3_hdr(grh, &sgid, &attr.grh.dgid))
563 return -EINVAL;
564 attr.ah_flags = IB_AH_GRH;
565 }
566 ah = ib_create_ah(tun_ctx->pd, &attr);
566 ah = rdma_create_ah(tun_ctx->pd, &attr);
567 if (IS_ERR(ah))
568 return -ENOMEM;
569
570 /* allocate tunnel tx buf after pass failure returns */
571 spin_lock(&tun_qp->tx_lock);
572 if (tun_qp->tx_ix_head - tun_qp->tx_ix_tail >=
573 (MLX4_NUM_TUNNEL_BUFS - 1))
574 ret = -EAGAIN;

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

1386 wire_pkey_ix = dev->pkeys.virt2phys_pkey[slave][port - 1][pkey_index];
1387 }
1388
1389 send_qp = sqp->qp;
1390
1391 /* create ah */
1392 sgid_index = attr->grh.sgid_index;
1393 attr->grh.sgid_index = 0;
567 if (IS_ERR(ah))
568 return -ENOMEM;
569
570 /* allocate tunnel tx buf after pass failure returns */
571 spin_lock(&tun_qp->tx_lock);
572 if (tun_qp->tx_ix_head - tun_qp->tx_ix_tail >=
573 (MLX4_NUM_TUNNEL_BUFS - 1))
574 ret = -EAGAIN;

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

1386 wire_pkey_ix = dev->pkeys.virt2phys_pkey[slave][port - 1][pkey_index];
1387 }
1388
1389 send_qp = sqp->qp;
1390
1391 /* create ah */
1392 sgid_index = attr->grh.sgid_index;
1393 attr->grh.sgid_index = 0;
1394 ah = ib_create_ah(sqp_ctx->pd, attr);
1394 ah = rdma_create_ah(sqp_ctx->pd, attr);
1395 if (IS_ERR(ah))
1396 return -ENOMEM;
1397 attr->grh.sgid_index = sgid_index;
1398 to_mah(ah)->av.ib.gid_index = sgid_index;
1399 /* get rid of force-loopback bit */
1400 to_mah(ah)->av.ib.port_pd &= cpu_to_be32(0x7FFFFFFF);
1401 spin_lock(&sqp->tx_lock);
1402 if (sqp->tx_ix_head - sqp->tx_ix_tail >=

--- 970 unchanged lines hidden ---
1395 if (IS_ERR(ah))
1396 return -ENOMEM;
1397 attr->grh.sgid_index = sgid_index;
1398 to_mah(ah)->av.ib.gid_index = sgid_index;
1399 /* get rid of force-loopback bit */
1400 to_mah(ah)->av.ib.port_pd &= cpu_to_be32(0x7FFFFFFF);
1401 spin_lock(&sqp->tx_lock);
1402 if (sqp->tx_ix_head - sqp->tx_ix_tail >=

--- 970 unchanged lines hidden ---