Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 222796
b: refs/heads/master
c: e27535b
h: refs/heads/master
v: v3
  • Loading branch information
Eli Cohen authored and Roland Dreier committed Dec 1, 2010
1 parent e2b6529 commit 7856205
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 91a4d157d0c18bd18fd95f90b67cb10d11701cca
refs/heads/master: e27535b9c6e071d461be33b75a33047c9bb4c0ce
30 changes: 30 additions & 0 deletions trunk/drivers/infiniband/core/ud_header.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,36 @@ void ib_ud_header_init(int payload_bytes,
}
EXPORT_SYMBOL(ib_ud_header_init);

/**
* ib_lrh_header_pack - Pack LRH header struct into wire format
* @lrh:unpacked LRH header struct
* @buf:Buffer to pack into
*
* ib_lrh_header_pack() packs the LRH header structure @lrh into
* wire format in the buffer @buf.
*/
int ib_lrh_header_pack(struct ib_unpacked_lrh *lrh, void *buf)
{
ib_pack(lrh_table, ARRAY_SIZE(lrh_table), lrh, buf);
return 0;
}
EXPORT_SYMBOL(ib_lrh_header_pack);

/**
* ib_lrh_header_unpack - Unpack LRH structure from wire format
* @lrh:unpacked LRH header struct
* @buf:Buffer to pack into
*
* ib_lrh_header_unpack() unpacks the LRH header structure from
* wire format (in buf) into @lrh.
*/
int ib_lrh_header_unpack(void *buf, struct ib_unpacked_lrh *lrh)
{
ib_unpack(lrh_table, ARRAY_SIZE(lrh_table), buf, lrh);
return 0;
}
EXPORT_SYMBOL(ib_lrh_header_unpack);

/**
* ib_ud_header_pack - Pack UD header struct into wire format
* @header:UD header struct
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/infiniband/core/uverbs_marshall.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,18 @@ void ib_copy_ah_attr_to_user(struct ib_uverbs_ah_attr *dst,
dst->grh.sgid_index = src->grh.sgid_index;
dst->grh.hop_limit = src->grh.hop_limit;
dst->grh.traffic_class = src->grh.traffic_class;
memset(&dst->grh.reserved, 0, sizeof(dst->grh.reserved));
dst->dlid = src->dlid;
dst->sl = src->sl;
dst->src_path_bits = src->src_path_bits;
dst->static_rate = src->static_rate;
dst->is_global = src->ah_flags & IB_AH_GRH ? 1 : 0;
dst->port_num = src->port_num;
dst->reserved = 0;
}
EXPORT_SYMBOL(ib_copy_ah_attr_to_user);

void ib_copy_qp_attr_to_user(struct ib_uverbs_qp_attr *dst,
struct ib_qp_attr *src)
{
dst->qp_state = src->qp_state;
dst->cur_qp_state = src->cur_qp_state;
dst->path_mtu = src->path_mtu;
dst->path_mig_state = src->path_mig_state;
Expand Down Expand Up @@ -86,7 +83,6 @@ void ib_copy_qp_attr_to_user(struct ib_uverbs_qp_attr *dst,
dst->rnr_retry = src->rnr_retry;
dst->alt_port_num = src->alt_port_num;
dst->alt_timeout = src->alt_timeout;
memset(dst->reserved, 0, sizeof(dst->reserved));
}
EXPORT_SYMBOL(ib_copy_qp_attr_to_user);

Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/infiniband/hw/mlx4/qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1816,6 +1816,11 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
ctrl->fence_size = (wr->send_flags & IB_SEND_FENCE ?
MLX4_WQE_CTRL_FENCE : 0) | size;

if (be16_to_cpu(vlan) < 0x1000) {
ctrl->ins_vlan = 1 << 6;
ctrl->vlan_tag = vlan;
}

/*
* Make sure descriptor is fully written before
* setting ownership bit (because HW can start
Expand All @@ -1831,11 +1836,6 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
ctrl->owner_opcode = mlx4_ib_opcode[wr->opcode] |
(ind & qp->sq.wqe_cnt ? cpu_to_be32(1 << 31) : 0) | blh;

if (be16_to_cpu(vlan) < 0x1000) {
ctrl->ins_vlan = 1 << 6;
ctrl->vlan_tag = vlan;
}

stamp = ind + qp->sq_spare_wqes;
ind += DIV_ROUND_UP(size * 16, 1U << qp->sq.wqe_shift);

Expand Down

0 comments on commit 7856205

Please sign in to comment.