From: Roland Dreier <roland@topspin.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, openib-general@openib.org
Subject: [PATCH][13/27] IB/mthca: implement RDMA/atomic operations for mem-free mode
Date: Fri, 1 Apr 2005 12:49:53 -0800 [thread overview]
Message-ID: <2005411249.0FJpqa4lTtcUTWSU@topspin.com> (raw)
In-Reply-To: <2005411249.mBxBGEwdeob5Gy84@topspin.com>
Add code to support RDMA and atomic send work requests in mem-free mode.
Signed-off-by: Roland Dreier <roland@topspin.com>
--- linux-export.orig/drivers/infiniband/hw/mthca/mthca_qp.c 2005-04-01 12:38:21.580276194 -0800
+++ linux-export/drivers/infiniband/hw/mthca/mthca_qp.c 2005-04-01 12:38:25.023528759 -0800
@@ -1775,6 +1775,53 @@
size = sizeof (struct mthca_next_seg) / 16;
switch (qp->transport) {
+ case RC:
+ switch (wr->opcode) {
+ case IB_WR_ATOMIC_CMP_AND_SWP:
+ case IB_WR_ATOMIC_FETCH_AND_ADD:
+ ((struct mthca_raddr_seg *) wqe)->raddr =
+ cpu_to_be64(wr->wr.atomic.remote_addr);
+ ((struct mthca_raddr_seg *) wqe)->rkey =
+ cpu_to_be32(wr->wr.atomic.rkey);
+ ((struct mthca_raddr_seg *) wqe)->reserved = 0;
+
+ wqe += sizeof (struct mthca_raddr_seg);
+
+ if (wr->opcode == IB_WR_ATOMIC_CMP_AND_SWP) {
+ ((struct mthca_atomic_seg *) wqe)->swap_add =
+ cpu_to_be64(wr->wr.atomic.swap);
+ ((struct mthca_atomic_seg *) wqe)->compare =
+ cpu_to_be64(wr->wr.atomic.compare_add);
+ } else {
+ ((struct mthca_atomic_seg *) wqe)->swap_add =
+ cpu_to_be64(wr->wr.atomic.compare_add);
+ ((struct mthca_atomic_seg *) wqe)->compare = 0;
+ }
+
+ wqe += sizeof (struct mthca_atomic_seg);
+ size += sizeof (struct mthca_raddr_seg) / 16 +
+ sizeof (struct mthca_atomic_seg);
+ break;
+
+ case IB_WR_RDMA_WRITE:
+ case IB_WR_RDMA_WRITE_WITH_IMM:
+ case IB_WR_RDMA_READ:
+ ((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:
memcpy(((struct mthca_arbel_ud_seg *) wqe)->av,
to_mah(wr->wr.ud.ah)->av, MTHCA_AV_SIZE);
next prev parent reply other threads:[~2005-04-01 20:57 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-01 20:49 [PATCH][1/27] IB/mthca: map MPT/MTT context in " Roland Dreier
2005-04-01 20:49 ` [PATCH][2/27] IB/mthca: fill in more device query fields Roland Dreier
2005-04-01 20:49 ` [PATCH][3/27] IB/mthca: fix calculation of RDB shift Roland Dreier
2005-04-01 20:49 ` [PATCH][4/27] IB/mthca: fix posting sends with immediate data Roland Dreier
2005-04-01 20:49 ` [PATCH][5/27] IB/mthca: allow unaligned memory regions Roland Dreier
2005-04-01 20:49 ` [PATCH][6/27] IB/mthca: allocate correct number of doorbell pages Roland Dreier
2005-04-01 20:49 ` [PATCH][7/27] IB/mthca: clean up mthca_dereg_mr() Roland Dreier
2005-04-01 20:49 ` [PATCH][8/27] IB/mthca: fix MR allocation error path Roland Dreier
2005-04-01 20:49 ` [PATCH][9/27] IB/mthca: release mutex on doorbell alloc " Roland Dreier
2005-04-01 20:49 ` [PATCH][10/27] IB/mthca: print assigned IRQ when interrupt test fails Roland Dreier
2005-04-01 20:49 ` [PATCH][11/27] IB/mthca: only free doorbell records in mem-free mode Roland Dreier
2005-04-01 20:49 ` [PATCH][12/27] IB/mthca: fix format of CQ number for CQ events Roland Dreier
2005-04-01 20:49 ` Roland Dreier [this message]
2005-04-01 20:49 ` [PATCH][14/27] IB/mthca: fix MTT allocation in mem-free mode Roland Dreier
2005-04-01 20:49 ` [PATCH][15/27] IB/mthca: fill in opcode field for send completions Roland Dreier
2005-04-01 20:49 ` [PATCH][16/27] IB/mthca: allow address handle creation in interrupt context Roland Dreier
2005-04-01 20:49 ` [PATCH][17/27] IB/mthca: encapsulate MTT buddy allocator Roland Dreier
2005-04-01 20:49 ` [PATCH][18/27] IB/mthca: add SYNC_TPT firmware command Roland Dreier
2005-04-01 20:49 ` [PATCH][19/27] IB/mthca: add mthca_write64_raw() for writing to MTT table directly Roland Dreier
2005-04-01 20:49 ` [PATCH][20/27] IB/mthca: add mthca_table_find() function Roland Dreier
2005-04-01 20:49 ` [PATCH][21/27] IB/mthca: split MR key munging routines Roland Dreier
2005-04-01 20:49 ` [PATCH][22/27] IB/mthca: add fast memory region implementation Roland Dreier
2005-04-01 20:49 ` [PATCH][23/27] IB/mthca: tweaks to mthca_cmd.c Roland Dreier
2005-04-01 20:49 ` [PATCH][24/27] IB/mthca: encapsulate mem-free check into mthca_is_memfree() Roland Dreier
2005-04-01 20:49 ` [PATCH][25/27] IB/mthca: map context for RDMA responder in mem-free mode Roland Dreier
2005-04-01 20:49 ` [PATCH][26/27] IB/mthca: update receive queue initialization for new HCAs Roland Dreier
2005-04-01 20:49 ` [PATCH][27/27] IB/mthca: add support for new MT25204 HCA Roland Dreier
2005-04-01 22:06 ` [PATCH][26.5/27] Add MT25204 PCI IDs Roland Dreier
2005-04-08 0:10 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2005411249.0FJpqa4lTtcUTWSU@topspin.com \
--to=roland@topspin.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=openib-general@openib.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome