diff options
Diffstat (limited to 'net/rds/rdma.c')
-rw-r--r-- | net/rds/rdma.c | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/net/rds/rdma.c b/net/rds/rdma.c index 48781fe4431c..48064673fc76 100644 --- a/net/rds/rdma.c +++ b/net/rds/rdma.c | |||
@@ -738,13 +738,34 @@ int rds_cmsg_atomic(struct rds_sock *rs, struct rds_message *rm, | |||
738 | 738 | ||
739 | args = CMSG_DATA(cmsg); | 739 | args = CMSG_DATA(cmsg); |
740 | 740 | ||
741 | if (cmsg->cmsg_type == RDS_CMSG_ATOMIC_CSWP) { | 741 | /* Nonmasked & masked cmsg ops converted to masked hw ops */ |
742 | rm->atomic.op_type = RDS_ATOMIC_TYPE_CSWP; | 742 | switch (cmsg->cmsg_type) { |
743 | rm->atomic.op_swap_add = args->cswp.swap; | 743 | case RDS_CMSG_ATOMIC_FADD: |
744 | rm->atomic.op_compare = args->cswp.compare; | 744 | rm->atomic.op_type = RDS_ATOMIC_TYPE_FADD; |
745 | } else { | 745 | rm->atomic.op_m_fadd.add = args->fadd.add; |
746 | rm->atomic.op_m_fadd.nocarry_mask = 0; | ||
747 | break; | ||
748 | case RDS_CMSG_MASKED_ATOMIC_FADD: | ||
746 | rm->atomic.op_type = RDS_ATOMIC_TYPE_FADD; | 749 | rm->atomic.op_type = RDS_ATOMIC_TYPE_FADD; |
747 | rm->atomic.op_swap_add = args->fadd.add; | 750 | rm->atomic.op_m_fadd.add = args->m_fadd.add; |
751 | rm->atomic.op_m_fadd.nocarry_mask = args->m_fadd.nocarry_mask; | ||
752 | break; | ||
753 | case RDS_CMSG_ATOMIC_CSWP: | ||
754 | rm->atomic.op_type = RDS_ATOMIC_TYPE_CSWP; | ||
755 | rm->atomic.op_m_cswp.compare = args->cswp.compare; | ||
756 | rm->atomic.op_m_cswp.swap = args->cswp.swap; | ||
757 | rm->atomic.op_m_cswp.compare_mask = ~0; | ||
758 | rm->atomic.op_m_cswp.swap_mask = ~0; | ||
759 | break; | ||
760 | case RDS_CMSG_MASKED_ATOMIC_CSWP: | ||
761 | rm->atomic.op_type = RDS_ATOMIC_TYPE_CSWP; | ||
762 | rm->atomic.op_m_cswp.compare = args->m_cswp.compare; | ||
763 | rm->atomic.op_m_cswp.swap = args->m_cswp.swap; | ||
764 | rm->atomic.op_m_cswp.compare_mask = args->m_cswp.compare_mask; | ||
765 | rm->atomic.op_m_cswp.swap_mask = args->m_cswp.swap_mask; | ||
766 | break; | ||
767 | default: | ||
768 | BUG(); /* should never happen */ | ||
748 | } | 769 | } |
749 | 770 | ||
750 | rm->atomic.op_notify = !!(args->flags & RDS_RDMA_NOTIFY_ME); | 771 | rm->atomic.op_notify = !!(args->flags & RDS_RDMA_NOTIFY_ME); |