[ewg] [PATCH] IB/libmlx4: Add RAW_ETH QP support

Moni Shoua monis at Voltaire.COM
Wed Feb 2 07:34:59 PST 2011


Add support for RAW_ETH QP. Also, consider the flag IBV_SEND_IP_CSUM in send
operation.

Signed-off-by: Aleksey Senin <alekseys at voltaire.com>
Reviewed-by:   Moni Shoua  <monis at voltaire.com>

--
diff --git a/src/qp.c b/src/qp.c
index 4322513..d850b1c 100644
--- a/src/qp.c
+++ b/src/qp.c
@@ -229,6 +229,8 @@ int mlx4_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,
 			 htonl(MLX4_WQE_CTRL_CQ_UPDATE) : 0) |
 			(wr->send_flags & IBV_SEND_SOLICITED ?
 			 htonl(MLX4_WQE_CTRL_SOLICIT) : 0)   |
+			(wr->send_flags & IBV_SEND_IP_CSUM ?
+			 htonl(MLX4_WQE_CTRL_IP_CSUM) : 0)   |
 			qp->sq_signal_bits;
 
 		if (wr->opcode == IBV_WR_SEND_WITH_IMM ||
@@ -284,6 +286,10 @@ int mlx4_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,
 			size += sizeof (struct mlx4_wqe_datagram_seg) / 16;
 			break;
 
+		case IBV_QPT_RAW_ETH:
+			/* For raw eth, the MLX4_WQE_CTRL_SOLICIT flag is used
+			 * to indicate that no icrc should be calculated */
+			ctrl->xrcrb_flags |= htonl(MLX4_WQE_CTRL_SOLICIT);
 		default:
 			break;
 		}
diff --git a/src/wqe.h b/src/wqe.h
index fa2f8ac..edd3da1 100644
--- a/src/wqe.h
+++ b/src/wqe.h
@@ -41,6 +41,7 @@ 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	= 3 << 4,
 };
 
 enum {



More information about the ewg mailing list