Lines Matching refs:wc
456 enum ib_qp_type dest_qpt, struct ib_wc *wc, in mlx4_ib_send_to_slave() argument
492 ret = ib_get_cached_pkey(&dev->ib_dev, port, wc->pkey_index, &cached_pkey); in mlx4_ib_send_to_slave()
547 tun_mad->hdr.flags_src_qp = cpu_to_be32(wc->src_qp & 0xFFFFFF); in mlx4_ib_send_to_slave()
548 tun_mad->hdr.g_ml_path = (grh && (wc->wc_flags & IB_WC_GRH)) ? 0x80 : 0; in mlx4_ib_send_to_slave()
555 if (vlan != wc->vlan_id) in mlx4_ib_send_to_slave()
566 vlan = wc->vlan_id; in mlx4_ib_send_to_slave()
570 memcpy((char *)&tun_mad->hdr.mac_31_0, &(wc->smac[0]), 4); in mlx4_ib_send_to_slave()
571 memcpy((char *)&tun_mad->hdr.slid_mac_47_32, &(wc->smac[4]), 2); in mlx4_ib_send_to_slave()
573 tun_mad->hdr.sl_vid = cpu_to_be16(((u16)(wc->sl)) << 12); in mlx4_ib_send_to_slave()
574 tun_mad->hdr.slid_mac_47_32 = cpu_to_be16(wc->slid); in mlx4_ib_send_to_slave()
605 struct ib_wc *wc, struct ib_grh *grh, in mlx4_ib_demux_mad() argument
620 if (!(wc->wc_flags & IB_WC_GRH)) { in mlx4_ib_demux_mad()
641 err = mlx4_ib_send_to_slave(dev, slave, port, wc->qp->qp_type, wc, grh, mad); in mlx4_ib_demux_mad()
660 if (wc->wc_flags & IB_WC_GRH) { in mlx4_ib_demux_mad()
712 err = mlx4_ib_send_to_slave(dev, slave, port, wc->qp->qp_type, wc, grh, mad); in mlx4_ib_demux_mad()
1303 static void mlx4_ib_multiplex_mad(struct mlx4_ib_demux_pv_ctx *ctx, struct ib_wc *wc) in mlx4_ib_multiplex_mad() argument
1306 struct mlx4_ib_demux_pv_qp *tun_qp = &ctx->qp[MLX4_TUN_WRID_QPN(wc->wr_id)]; in mlx4_ib_multiplex_mad()
1307 int wr_ix = wc->wr_id & (MLX4_NUM_TUNNEL_BUFS - 1); in mlx4_ib_multiplex_mad()
1317 if (wc->src_qp < dev->dev->phys_caps.base_proxy_sqpn || in mlx4_ib_multiplex_mad()
1318 wc->src_qp >= dev->dev->phys_caps.base_proxy_sqpn + 8 * MLX4_MFUNC_MAX || in mlx4_ib_multiplex_mad()
1319 (wc->src_qp & 0x1) != ctx->port - 1 || in mlx4_ib_multiplex_mad()
1320 wc->src_qp & 0x4) { in mlx4_ib_multiplex_mad()
1321 mlx4_ib_warn(ctx->ib_dev, "can't multiplex bad sqp:%d\n", wc->src_qp); in mlx4_ib_multiplex_mad()
1324 slave = ((wc->src_qp & ~0x7) - dev->dev->phys_caps.base_proxy_sqpn) / 8; in mlx4_ib_multiplex_mad()
1327 "belongs to another slave\n", wc->src_qp); in mlx4_ib_multiplex_mad()
1409 is_proxy_qp0(dev, wc->src_qp, slave) ? in mlx4_ib_multiplex_mad()
1414 &ah_attr, wc->smac, vlan_id, &tunnel->mad); in mlx4_ib_multiplex_mad()
1552 struct ib_wc wc; in mlx4_ib_tunnel_comp_worker() local
1557 while (ib_poll_cq(ctx->cq, 1, &wc) == 1) { in mlx4_ib_tunnel_comp_worker()
1558 tun_qp = &ctx->qp[MLX4_TUN_WRID_QPN(wc.wr_id)]; in mlx4_ib_tunnel_comp_worker()
1559 if (wc.status == IB_WC_SUCCESS) { in mlx4_ib_tunnel_comp_worker()
1560 switch (wc.opcode) { in mlx4_ib_tunnel_comp_worker()
1562 mlx4_ib_multiplex_mad(ctx, &wc); in mlx4_ib_tunnel_comp_worker()
1564 wc.wr_id & in mlx4_ib_tunnel_comp_worker()
1568 "buf:%lld\n", wc.wr_id); in mlx4_ib_tunnel_comp_worker()
1573 wc.wr_id, wc.status); in mlx4_ib_tunnel_comp_worker()
1574 ib_destroy_ah(tun_qp->tx_ring[wc.wr_id & in mlx4_ib_tunnel_comp_worker()
1576 tun_qp->tx_ring[wc.wr_id & (MLX4_NUM_TUNNEL_BUFS - 1)].ah in mlx4_ib_tunnel_comp_worker()
1589 ctx->slave, wc.status, wc.wr_id); in mlx4_ib_tunnel_comp_worker()
1590 if (!MLX4_TUN_IS_RECV(wc.wr_id)) { in mlx4_ib_tunnel_comp_worker()
1591 ib_destroy_ah(tun_qp->tx_ring[wc.wr_id & in mlx4_ib_tunnel_comp_worker()
1593 tun_qp->tx_ring[wc.wr_id & (MLX4_NUM_TUNNEL_BUFS - 1)].ah in mlx4_ib_tunnel_comp_worker()
1716 struct ib_wc wc; in mlx4_ib_sqp_comp_worker() local
1723 while (mlx4_ib_poll_cq(ctx->cq, 1, &wc) == 1) { in mlx4_ib_sqp_comp_worker()
1724 sqp = &ctx->qp[MLX4_TUN_WRID_QPN(wc.wr_id)]; in mlx4_ib_sqp_comp_worker()
1725 if (wc.status == IB_WC_SUCCESS) { in mlx4_ib_sqp_comp_worker()
1726 switch (wc.opcode) { in mlx4_ib_sqp_comp_worker()
1728 ib_destroy_ah(sqp->tx_ring[wc.wr_id & in mlx4_ib_sqp_comp_worker()
1730 sqp->tx_ring[wc.wr_id & (MLX4_NUM_TUNNEL_BUFS - 1)].ah in mlx4_ib_sqp_comp_worker()
1738 (sqp->ring[wc.wr_id & in mlx4_ib_sqp_comp_worker()
1741 (sqp->ring[wc.wr_id & in mlx4_ib_sqp_comp_worker()
1743 mlx4_ib_demux_mad(ctx->ib_dev, ctx->port, &wc, grh, mad); in mlx4_ib_sqp_comp_worker()
1744 if (mlx4_ib_post_pv_qp_buf(ctx, sqp, wc.wr_id & in mlx4_ib_sqp_comp_worker()
1747 "buf:%lld\n", wc.wr_id); in mlx4_ib_sqp_comp_worker()
1756 ctx->slave, wc.status, wc.wr_id); in mlx4_ib_sqp_comp_worker()
1757 if (!MLX4_TUN_IS_RECV(wc.wr_id)) { in mlx4_ib_sqp_comp_worker()
1758 ib_destroy_ah(sqp->tx_ring[wc.wr_id & in mlx4_ib_sqp_comp_worker()
1760 sqp->tx_ring[wc.wr_id & (MLX4_NUM_TUNNEL_BUFS - 1)].ah in mlx4_ib_sqp_comp_worker()