aboutsummaryrefslogtreecommitdiffstats
path: root/net/rds/ib_send.c
diff options
context:
space:
mode:
authorAndy Grover <andy.grover@oracle.com>2010-08-25 08:51:28 -0400
committerAndy Grover <andy.grover@oracle.com>2010-09-08 21:16:51 -0400
commit20c72bd5f5f902e5a8745d51573699605bf8d21c (patch)
tree6df337e07d423a0859ab92f25525570e134baba1 /net/rds/ib_send.c
parent59f740a6aeb2cde2f79fe0df38262d4c1ef35cd8 (diff)
RDS: Implement masked atomic operations
Add two CMSGs for masked versions of cswp and fadd. args struct modified to use a union for different atomic op type's arguments. Change IB to do masked atomic ops. Atomic op type in rds_message similarly unionized. Signed-off-by: Andy Grover <andy.grover@oracle.com>
Diffstat (limited to 'net/rds/ib_send.c')
-rw-r--r--net/rds/ib_send.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c
index 808544aebb7..71f373c421b 100644
--- a/net/rds/ib_send.c
+++ b/net/rds/ib_send.c
@@ -807,13 +807,17 @@ int rds_ib_xmit_atomic(struct rds_connection *conn, struct rm_atomic_op *op)
807 send->s_queued = jiffies; 807 send->s_queued = jiffies;
808 808
809 if (op->op_type == RDS_ATOMIC_TYPE_CSWP) { 809 if (op->op_type == RDS_ATOMIC_TYPE_CSWP) {
810 send->s_wr.opcode = IB_WR_ATOMIC_CMP_AND_SWP; 810 send->s_wr.opcode = IB_WR_MASKED_ATOMIC_CMP_AND_SWP;
811 send->s_wr.wr.atomic.compare_add = op->op_compare; 811 send->s_wr.wr.atomic.compare_add = op->op_m_cswp.compare;
812 send->s_wr.wr.atomic.swap = op->op_swap_add; 812 send->s_wr.wr.atomic.swap = op->op_m_cswp.swap;
813 send->s_wr.wr.atomic.compare_add_mask = op->op_m_cswp.compare_mask;
814 send->s_wr.wr.atomic.swap_mask = op->op_m_cswp.swap_mask;
813 } else { /* FADD */ 815 } else { /* FADD */
814 send->s_wr.opcode = IB_WR_ATOMIC_FETCH_AND_ADD; 816 send->s_wr.opcode = IB_WR_MASKED_ATOMIC_FETCH_AND_ADD;
815 send->s_wr.wr.atomic.compare_add = op->op_swap_add; 817 send->s_wr.wr.atomic.compare_add = op->op_m_fadd.add;
816 send->s_wr.wr.atomic.swap = 0; 818 send->s_wr.wr.atomic.swap = 0;
819 send->s_wr.wr.atomic.compare_add_mask = op->op_m_fadd.nocarry_mask;
820 send->s_wr.wr.atomic.swap_mask = 0;
817 } 821 }
818 nr_sig = rds_ib_set_wr_signal_state(ic, send, op->op_notify); 822 nr_sig = rds_ib_set_wr_signal_state(ic, send, op->op_notify);
819 send->s_wr.num_sge = 1; 823 send->s_wr.num_sge = 1;