Lines Matching refs:wc
462 enum ib_qp_type dest_qpt, struct ib_wc *wc, in mlx4_ib_send_to_slave() argument
497 ret = ib_get_cached_pkey(&dev->ib_dev, port, wc->pkey_index, &cached_pkey); in mlx4_ib_send_to_slave()
552 tun_mad->hdr.flags_src_qp = cpu_to_be32(wc->src_qp & 0xFFFFFF); in mlx4_ib_send_to_slave()
553 tun_mad->hdr.g_ml_path = (grh && (wc->wc_flags & IB_WC_GRH)) ? 0x80 : 0; in mlx4_ib_send_to_slave()
560 if (vlan != wc->vlan_id) in mlx4_ib_send_to_slave()
571 vlan = wc->vlan_id; in mlx4_ib_send_to_slave()
575 memcpy((char *)&tun_mad->hdr.mac_31_0, &(wc->smac[0]), 4); in mlx4_ib_send_to_slave()
576 memcpy((char *)&tun_mad->hdr.slid_mac_47_32, &(wc->smac[4]), 2); in mlx4_ib_send_to_slave()
578 tun_mad->hdr.sl_vid = cpu_to_be16(((u16)(wc->sl)) << 12); in mlx4_ib_send_to_slave()
579 tun_mad->hdr.slid_mac_47_32 = cpu_to_be16(wc->slid); in mlx4_ib_send_to_slave()
610 struct ib_wc *wc, struct ib_grh *grh, in mlx4_ib_demux_mad() argument
625 if (!(wc->wc_flags & IB_WC_GRH)) { in mlx4_ib_demux_mad()
646 err = mlx4_ib_send_to_slave(dev, slave, port, wc->qp->qp_type, wc, grh, mad); in mlx4_ib_demux_mad()
665 if (wc->wc_flags & IB_WC_GRH) { in mlx4_ib_demux_mad()
717 err = mlx4_ib_send_to_slave(dev, slave, port, wc->qp->qp_type, wc, grh, mad); in mlx4_ib_demux_mad()
1281 static void mlx4_ib_multiplex_mad(struct mlx4_ib_demux_pv_ctx *ctx, struct ib_wc *wc) in mlx4_ib_multiplex_mad() argument
1284 struct mlx4_ib_demux_pv_qp *tun_qp = &ctx->qp[MLX4_TUN_WRID_QPN(wc->wr_id)]; in mlx4_ib_multiplex_mad()
1285 int wr_ix = wc->wr_id & (MLX4_NUM_TUNNEL_BUFS - 1); in mlx4_ib_multiplex_mad()
1294 if (wc->src_qp < dev->dev->phys_caps.base_proxy_sqpn || in mlx4_ib_multiplex_mad()
1295 wc->src_qp >= dev->dev->phys_caps.base_proxy_sqpn + 8 * MLX4_MFUNC_MAX || in mlx4_ib_multiplex_mad()
1296 (wc->src_qp & 0x1) != ctx->port - 1 || in mlx4_ib_multiplex_mad()
1297 wc->src_qp & 0x4) { in mlx4_ib_multiplex_mad()
1298 mlx4_ib_warn(ctx->ib_dev, "can't multiplex bad sqp:%d\n", wc->src_qp); in mlx4_ib_multiplex_mad()
1301 slave = ((wc->src_qp & ~0x7) - dev->dev->phys_caps.base_proxy_sqpn) / 8; in mlx4_ib_multiplex_mad()
1304 "belongs to another slave\n", wc->src_qp); in mlx4_ib_multiplex_mad()
1383 is_proxy_qp0(dev, wc->src_qp, slave) ? in mlx4_ib_multiplex_mad()
1388 &ah_attr, wc->smac, &tunnel->mad); in mlx4_ib_multiplex_mad()
1517 struct ib_wc wc; in mlx4_ib_tunnel_comp_worker() local
1522 while (ib_poll_cq(ctx->cq, 1, &wc) == 1) { in mlx4_ib_tunnel_comp_worker()
1523 tun_qp = &ctx->qp[MLX4_TUN_WRID_QPN(wc.wr_id)]; in mlx4_ib_tunnel_comp_worker()
1524 if (wc.status == IB_WC_SUCCESS) { in mlx4_ib_tunnel_comp_worker()
1525 switch (wc.opcode) { in mlx4_ib_tunnel_comp_worker()
1527 mlx4_ib_multiplex_mad(ctx, &wc); in mlx4_ib_tunnel_comp_worker()
1529 wc.wr_id & in mlx4_ib_tunnel_comp_worker()
1533 "buf:%lld\n", wc.wr_id); in mlx4_ib_tunnel_comp_worker()
1538 wc.wr_id, wc.status); in mlx4_ib_tunnel_comp_worker()
1539 ib_destroy_ah(tun_qp->tx_ring[wc.wr_id & in mlx4_ib_tunnel_comp_worker()
1541 tun_qp->tx_ring[wc.wr_id & (MLX4_NUM_TUNNEL_BUFS - 1)].ah in mlx4_ib_tunnel_comp_worker()
1554 ctx->slave, wc.status, wc.wr_id); in mlx4_ib_tunnel_comp_worker()
1555 if (!MLX4_TUN_IS_RECV(wc.wr_id)) { in mlx4_ib_tunnel_comp_worker()
1556 ib_destroy_ah(tun_qp->tx_ring[wc.wr_id & in mlx4_ib_tunnel_comp_worker()
1558 tun_qp->tx_ring[wc.wr_id & (MLX4_NUM_TUNNEL_BUFS - 1)].ah in mlx4_ib_tunnel_comp_worker()
1681 struct ib_wc wc; in mlx4_ib_sqp_comp_worker() local
1688 while (mlx4_ib_poll_cq(ctx->cq, 1, &wc) == 1) { in mlx4_ib_sqp_comp_worker()
1689 sqp = &ctx->qp[MLX4_TUN_WRID_QPN(wc.wr_id)]; in mlx4_ib_sqp_comp_worker()
1690 if (wc.status == IB_WC_SUCCESS) { in mlx4_ib_sqp_comp_worker()
1691 switch (wc.opcode) { in mlx4_ib_sqp_comp_worker()
1693 ib_destroy_ah(sqp->tx_ring[wc.wr_id & in mlx4_ib_sqp_comp_worker()
1695 sqp->tx_ring[wc.wr_id & (MLX4_NUM_TUNNEL_BUFS - 1)].ah in mlx4_ib_sqp_comp_worker()
1703 (sqp->ring[wc.wr_id & in mlx4_ib_sqp_comp_worker()
1706 (sqp->ring[wc.wr_id & in mlx4_ib_sqp_comp_worker()
1708 mlx4_ib_demux_mad(ctx->ib_dev, ctx->port, &wc, grh, mad); in mlx4_ib_sqp_comp_worker()
1709 if (mlx4_ib_post_pv_qp_buf(ctx, sqp, wc.wr_id & in mlx4_ib_sqp_comp_worker()
1712 "buf:%lld\n", wc.wr_id); in mlx4_ib_sqp_comp_worker()
1721 ctx->slave, wc.status, wc.wr_id); in mlx4_ib_sqp_comp_worker()
1722 if (!MLX4_TUN_IS_RECV(wc.wr_id)) { in mlx4_ib_sqp_comp_worker()
1723 ib_destroy_ah(sqp->tx_ring[wc.wr_id & in mlx4_ib_sqp_comp_worker()
1725 sqp->tx_ring[wc.wr_id & (MLX4_NUM_TUNNEL_BUFS - 1)].ah in mlx4_ib_sqp_comp_worker()