Select the types of activity you want to include in your feed.
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: IB/mlx4: Fix data corruption triggered by wrong headroom marking order
···12111211 dseg->qkey = cpu_to_be32(wr->wr.ud.remote_qkey);12121212}1213121312141214-static void set_data_seg(struct mlx4_wqe_data_seg *dseg,12151215- struct ib_sge *sg)12141214+static void set_mlx_icrc_seg(void *dseg)12161215{12171217- dseg->byte_count = cpu_to_be32(sg->length);12161216+ u32 *t = dseg;12171217+ struct mlx4_wqe_inline_seg *iseg = dseg;12181218+12191219+ t[1] = 0;12201220+12211221+ /*12221222+ * Need a barrier here before writing the byte_count field to12231223+ * make sure that all the data is visible before the12241224+ * byte_count field is set. Otherwise, if the segment begins12251225+ * a new cacheline, the HCA prefetcher could grab the 64-byte12261226+ * chunk and get a valid (!= * 0xffffffff) byte count but12271227+ * stale data, and end up sending the wrong data.12281228+ */12291229+ wmb();12301230+12311231+ iseg->byte_count = cpu_to_be32((1 << 31) | 4);12321232+}12331233+12341234+static void set_data_seg(struct mlx4_wqe_data_seg *dseg, struct ib_sge *sg)12351235+{12181236 dseg->lkey = cpu_to_be32(sg->lkey);12191237 dseg->addr = cpu_to_be64(sg->addr);12381238+12391239+ /*12401240+ * Need a barrier here before writing the byte_count field to12411241+ * make sure that all the data is visible before the12421242+ * byte_count field is set. Otherwise, if the segment begins12431243+ * a new cacheline, the HCA prefetcher could grab the 64-byte12441244+ * chunk and get a valid (!= * 0xffffffff) byte count but12451245+ * stale data, and end up sending the wrong data.12461246+ */12471247+ wmb();12481248+12491249+ dseg->byte_count = cpu_to_be32(sg->length);12201250}1221125112221252int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,···12551225 struct mlx4_ib_qp *qp = to_mqp(ibqp);12561226 void *wqe;12571227 struct mlx4_wqe_ctrl_seg *ctrl;12281228+ struct mlx4_wqe_data_seg *dseg;12581229 unsigned long flags;12591230 int nreq;12601231 int err = 0;···13551324 break;13561325 }1357132613581358- for (i = 0; i < wr->num_sge; ++i) {13591359- set_data_seg(wqe, wr->sg_list + i);13271327+ /*13281328+ * Write data segments in reverse order, so as to13291329+ * overwrite cacheline stamp last within each13301330+ * cacheline. This avoids issues with WQE13311331+ * prefetching.13321332+ */1360133313611361- wqe += sizeof (struct mlx4_wqe_data_seg);13621362- size += sizeof (struct mlx4_wqe_data_seg) / 16;13631363- }13341334+ dseg = wqe;13351335+ dseg += wr->num_sge - 1;13361336+ size += wr->num_sge * (sizeof (struct mlx4_wqe_data_seg) / 16);1364133713651338 /* Add one more inline data segment for ICRC for MLX sends */13661366- if (qp->ibqp.qp_type == IB_QPT_SMI || qp->ibqp.qp_type == IB_QPT_GSI) {13671367- ((struct mlx4_wqe_inline_seg *) wqe)->byte_count =13681368- cpu_to_be32((1 << 31) | 4);13691369- ((u32 *) wqe)[1] = 0;13701370- wqe += sizeof (struct mlx4_wqe_data_seg);13391339+ if (unlikely(qp->ibqp.qp_type == IB_QPT_SMI ||13401340+ qp->ibqp.qp_type == IB_QPT_GSI)) {13411341+ set_mlx_icrc_seg(dseg + 1);13711342 size += sizeof (struct mlx4_wqe_data_seg) / 16;13721343 }13441344+13451345+ for (i = wr->num_sge - 1; i >= 0; --i, --dseg)13461346+ set_data_seg(dseg, wr->sg_list + i);1373134713741348 ctrl->fence_size = (wr->send_flags & IB_SEND_FENCE ?13751349 MLX4_WQE_CTRL_FENCE : 0) | size;