[PATCH] IB/mthca: Enable unreliable connected transport

Add support for unreliable connected (UC) transport to mthca driver:
 - Add attributes for UC to modify QP table.
 - Add support for posting UC work requests.

Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Roland Dreier 2005-06-27 14:36:42 -07:00 committed by Linus Torvalds
parent 34a4a753d1
commit 9e6970b5e9
1 changed files with 78 additions and 1 deletions

View File

@ -357,6 +357,9 @@ static const struct {
[UD] = (IB_QP_PKEY_INDEX | [UD] = (IB_QP_PKEY_INDEX |
IB_QP_PORT | IB_QP_PORT |
IB_QP_QKEY), IB_QP_QKEY),
[UC] = (IB_QP_PKEY_INDEX |
IB_QP_PORT |
IB_QP_ACCESS_FLAGS),
[RC] = (IB_QP_PKEY_INDEX | [RC] = (IB_QP_PKEY_INDEX |
IB_QP_PORT | IB_QP_PORT |
IB_QP_ACCESS_FLAGS), IB_QP_ACCESS_FLAGS),
@ -378,6 +381,9 @@ static const struct {
[UD] = (IB_QP_PKEY_INDEX | [UD] = (IB_QP_PKEY_INDEX |
IB_QP_PORT | IB_QP_PORT |
IB_QP_QKEY), IB_QP_QKEY),
[UC] = (IB_QP_PKEY_INDEX |
IB_QP_PORT |
IB_QP_ACCESS_FLAGS),
[RC] = (IB_QP_PKEY_INDEX | [RC] = (IB_QP_PKEY_INDEX |
IB_QP_PORT | IB_QP_PORT |
IB_QP_ACCESS_FLAGS), IB_QP_ACCESS_FLAGS),
@ -388,6 +394,11 @@ static const struct {
[IB_QPS_RTR] = { [IB_QPS_RTR] = {
.trans = MTHCA_TRANS_INIT2RTR, .trans = MTHCA_TRANS_INIT2RTR,
.req_param = { .req_param = {
[UC] = (IB_QP_AV |
IB_QP_PATH_MTU |
IB_QP_DEST_QPN |
IB_QP_RQ_PSN |
IB_QP_MAX_DEST_RD_ATOMIC),
[RC] = (IB_QP_AV | [RC] = (IB_QP_AV |
IB_QP_PATH_MTU | IB_QP_PATH_MTU |
IB_QP_DEST_QPN | IB_QP_DEST_QPN |
@ -398,6 +409,9 @@ static const struct {
.opt_param = { .opt_param = {
[UD] = (IB_QP_PKEY_INDEX | [UD] = (IB_QP_PKEY_INDEX |
IB_QP_QKEY), IB_QP_QKEY),
[UC] = (IB_QP_ALT_PATH |
IB_QP_ACCESS_FLAGS |
IB_QP_PKEY_INDEX),
[RC] = (IB_QP_ALT_PATH | [RC] = (IB_QP_ALT_PATH |
IB_QP_ACCESS_FLAGS | IB_QP_ACCESS_FLAGS |
IB_QP_PKEY_INDEX), IB_QP_PKEY_INDEX),
@ -413,6 +427,8 @@ static const struct {
.trans = MTHCA_TRANS_RTR2RTS, .trans = MTHCA_TRANS_RTR2RTS,
.req_param = { .req_param = {
[UD] = IB_QP_SQ_PSN, [UD] = IB_QP_SQ_PSN,
[UC] = (IB_QP_SQ_PSN |
IB_QP_MAX_QP_RD_ATOMIC),
[RC] = (IB_QP_TIMEOUT | [RC] = (IB_QP_TIMEOUT |
IB_QP_RETRY_CNT | IB_QP_RETRY_CNT |
IB_QP_RNR_RETRY | IB_QP_RNR_RETRY |
@ -423,6 +439,11 @@ static const struct {
.opt_param = { .opt_param = {
[UD] = (IB_QP_CUR_STATE | [UD] = (IB_QP_CUR_STATE |
IB_QP_QKEY), IB_QP_QKEY),
[UC] = (IB_QP_CUR_STATE |
IB_QP_ALT_PATH |
IB_QP_ACCESS_FLAGS |
IB_QP_PKEY_INDEX |
IB_QP_PATH_MIG_STATE),
[RC] = (IB_QP_CUR_STATE | [RC] = (IB_QP_CUR_STATE |
IB_QP_ALT_PATH | IB_QP_ALT_PATH |
IB_QP_ACCESS_FLAGS | IB_QP_ACCESS_FLAGS |
@ -442,6 +463,9 @@ static const struct {
.opt_param = { .opt_param = {
[UD] = (IB_QP_CUR_STATE | [UD] = (IB_QP_CUR_STATE |
IB_QP_QKEY), IB_QP_QKEY),
[UC] = (IB_QP_ACCESS_FLAGS |
IB_QP_ALT_PATH |
IB_QP_PATH_MIG_STATE),
[RC] = (IB_QP_ACCESS_FLAGS | [RC] = (IB_QP_ACCESS_FLAGS |
IB_QP_ALT_PATH | IB_QP_ALT_PATH |
IB_QP_PATH_MIG_STATE | IB_QP_PATH_MIG_STATE |
@ -462,6 +486,10 @@ static const struct {
.opt_param = { .opt_param = {
[UD] = (IB_QP_CUR_STATE | [UD] = (IB_QP_CUR_STATE |
IB_QP_QKEY), IB_QP_QKEY),
[UC] = (IB_QP_CUR_STATE |
IB_QP_ALT_PATH |
IB_QP_ACCESS_FLAGS |
IB_QP_PATH_MIG_STATE),
[RC] = (IB_QP_CUR_STATE | [RC] = (IB_QP_CUR_STATE |
IB_QP_ALT_PATH | IB_QP_ALT_PATH |
IB_QP_ACCESS_FLAGS | IB_QP_ACCESS_FLAGS |
@ -476,6 +504,14 @@ static const struct {
.opt_param = { .opt_param = {
[UD] = (IB_QP_PKEY_INDEX | [UD] = (IB_QP_PKEY_INDEX |
IB_QP_QKEY), IB_QP_QKEY),
[UC] = (IB_QP_AV |
IB_QP_MAX_QP_RD_ATOMIC |
IB_QP_MAX_DEST_RD_ATOMIC |
IB_QP_CUR_STATE |
IB_QP_ALT_PATH |
IB_QP_ACCESS_FLAGS |
IB_QP_PKEY_INDEX |
IB_QP_PATH_MIG_STATE),
[RC] = (IB_QP_AV | [RC] = (IB_QP_AV |
IB_QP_TIMEOUT | IB_QP_TIMEOUT |
IB_QP_RETRY_CNT | IB_QP_RETRY_CNT |
@ -501,6 +537,7 @@ static const struct {
.opt_param = { .opt_param = {
[UD] = (IB_QP_CUR_STATE | [UD] = (IB_QP_CUR_STATE |
IB_QP_QKEY), IB_QP_QKEY),
[UC] = (IB_QP_CUR_STATE),
[RC] = (IB_QP_CUR_STATE | [RC] = (IB_QP_CUR_STATE |
IB_QP_MIN_RNR_TIMER), IB_QP_MIN_RNR_TIMER),
[MLX] = (IB_QP_CUR_STATE | [MLX] = (IB_QP_CUR_STATE |
@ -1530,6 +1567,26 @@ int mthca_tavor_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
break; break;
case UC:
switch (wr->opcode) {
case IB_WR_RDMA_WRITE:
case IB_WR_RDMA_WRITE_WITH_IMM:
((struct mthca_raddr_seg *) wqe)->raddr =
cpu_to_be64(wr->wr.rdma.remote_addr);
((struct mthca_raddr_seg *) wqe)->rkey =
cpu_to_be32(wr->wr.rdma.rkey);
((struct mthca_raddr_seg *) wqe)->reserved = 0;
wqe += sizeof (struct mthca_raddr_seg);
size += sizeof (struct mthca_raddr_seg) / 16;
break;
default:
/* No extra segments required for sends */
break;
}
break;
case UD: case UD:
((struct mthca_tavor_ud_seg *) wqe)->lkey = ((struct mthca_tavor_ud_seg *) wqe)->lkey =
cpu_to_be32(to_mah(wr->wr.ud.ah)->key); cpu_to_be32(to_mah(wr->wr.ud.ah)->key);
@ -1815,9 +1872,29 @@ int mthca_arbel_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
sizeof (struct mthca_atomic_seg); sizeof (struct mthca_atomic_seg);
break; break;
case IB_WR_RDMA_READ:
case IB_WR_RDMA_WRITE:
case IB_WR_RDMA_WRITE_WITH_IMM:
((struct mthca_raddr_seg *) wqe)->raddr =
cpu_to_be64(wr->wr.rdma.remote_addr);
((struct mthca_raddr_seg *) wqe)->rkey =
cpu_to_be32(wr->wr.rdma.rkey);
((struct mthca_raddr_seg *) wqe)->reserved = 0;
wqe += sizeof (struct mthca_raddr_seg);
size += sizeof (struct mthca_raddr_seg) / 16;
break;
default:
/* No extra segments required for sends */
break;
}
break;
case UC:
switch (wr->opcode) {
case IB_WR_RDMA_WRITE: case IB_WR_RDMA_WRITE:
case IB_WR_RDMA_WRITE_WITH_IMM: case IB_WR_RDMA_WRITE_WITH_IMM:
case IB_WR_RDMA_READ:
((struct mthca_raddr_seg *) wqe)->raddr = ((struct mthca_raddr_seg *) wqe)->raddr =
cpu_to_be64(wr->wr.rdma.remote_addr); cpu_to_be64(wr->wr.rdma.remote_addr);
((struct mthca_raddr_seg *) wqe)->rkey = ((struct mthca_raddr_seg *) wqe)->rkey =