@@ -286,6 +286,10 @@ int mlx4_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,
break;
case IBV_QPT_UD:
+ ctrl->srcrb_flags |=
+ wr->send_flags & IBV_SEND_IP_CSUM ?
+ htonl(MLX4_WQE_CTRL_IP_CSUM |
+ MLX4_WQE_CTRL_TCP_UDP_CSUM) : 0;
set_datagram_seg(wqe, wr);
wqe += sizeof (struct mlx4_wqe_datagram_seg);
size += sizeof (struct mlx4_wqe_datagram_seg) / 16;
@@ -294,7 +298,12 @@ int mlx4_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,
case IBV_QPT_RAW_PACKET:
/* For raw eth, the MLX4_WQE_CTRL_SOLICIT flag is used
* to indicate that no icrc should be calculated */
- ctrl->srcrb_flags |= htonl(MLX4_WQE_CTRL_SOLICIT);
+ ctrl->srcrb_flags |=
+ wr->send_flags & IBV_SEND_IP_CSUM ?
+ htonl(MLX4_WQE_CTRL_IP_CSUM |
+ MLX4_WQE_CTRL_TCP_UDP_CSUM |
+ MLX4_WQE_CTRL_SOLICIT) :
+ htonl(MLX4_WQE_CTRL_SOLICIT);
break;
default:
@@ -41,6 +41,8 @@ enum {
MLX4_WQE_CTRL_FENCE = 1 << 6,
MLX4_WQE_CTRL_CQ_UPDATE = 3 << 2,
MLX4_WQE_CTRL_SOLICIT = 1 << 1,
+ MLX4_WQE_CTRL_IP_CSUM = 1 << 4,
+ MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5
};
enum {