DAPL support on s390x platform
Subsystems (2)
cover DAPL support on s390x platform
This patch series contains the changes to user space libraries required to provide support for the DAPL API on s390x platform. The corresponding kernel patch is on the features branch of linux-s390 for the next merge window.
The current implementation of Infiniband verbs uses mapped memory areas to directly access the device UAR and Blueflame pages, which are located in the PCI I/O memory, from user space. On the s390x platform the PCI I/O memory can be accessed only using special privileged CPU instructions that cannot be used directly in user space programs. This restricts the usage of mapped memory areas to access the PCI I/O memory on s390x platform. There are 2 patches for the DAPL API libibverbs and libmlx4 user space components in this patch series. The patches for the perftest and dapl packages are not included into this series because those changes have been already applied to corresponding packages by the maintainers.
[PATCH 1/2] libibverbs: add support for the s390x plaform This patch contains the changes to the libibverbs user space library to provide support of the s390x platform. [PATCH 2/2] libmlx4: add support for the s390x platform
This patch contains the changes to the libmlx4 user space library intended to provide the PCI I/O memory access on the s390x platform. The direct access to mapped memory areas is replaced by appropriate system call invocation.
All maintainers have stated general agreement with the patches previously, this is to provide a clean and up-to-date patch set for consideration for inclusion.
Alexey Ishchuk (2):
libibverbs: add s390x platform support
libmlx4: add s390x platform support
Signature · 6 lines
1.8.5.5 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1416392239-10282-1-git-send-email-aishchuk-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org
PATCH 1/2 libibverbs: add support for the s390x platform
This patch adds the required platform specific code to allow execution of the libibverbs functions on the s390x platform.
--- include/infiniband/arch.h | 7 +++++++ 1 file changed, 7 insertions(+)
include/infiniband/arch.h +7 -0
@@ -115,6 +115,13 @@ static inline uint64_t ntohll(uint64_t x#define wmb () mb()#define wc_wmb () wmb() +#elif defined(__s390x__) + +#define mb () { asm volatile("" : : : "memory"); }/* for s390x */ +#define rmb () mb()/* for s390x */ +#define wmb () mb()/* for s390x */ +#define wc_wmb () wmb()/* for s390x */ +#else #warning No architecture specific defines found. Using generic implementation.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/2 libmlx4: add support for the s390x platform
In reply to a message not in the archiveSince, s390x platform requires execution of privileged CPU instructions to work with PCI I/O memory, the PCI I/O memory cannot be directly accessed from the userspace programs via the mapped memory areas. The current implementation of the Inifiniband verbs uses mapped memory areas to write data to device UAR and Blueflame page to initiate the I/O operations, these verbs currently cannot be used on the s390x platfrom without modification.
This patch contains the changes to the libmlx4 userspace Mellanox device driver library required to provide support for the DAPL API on the s390x platform. The original code that directly used mapped memory areas to access the PCI I/O memory of the Mellanox networking device is replaced with the new system call invocation for writing the data to mapped memory areas.
--- Makefile.am | 2 src/doorbell.h | 8 ++- src/mlx4.h | 2 src/mmio.h | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/qp.c | 17 -------- 5 files changed, 125 insertions(+), 19 deletions(-)
Makefile.am +1 -1
@@ -12,7 +12,7 @@ src_libmlx4_la_LDFLAGS = -avoid-version mlx4confdir = $(sysconfdir)/libibverbs.d mlx4conf_DATA = mlx4.driver -EXTRA_DIST = src/doorbell.h src/mlx4.h src/mlx4-abi.h src/wqe.h \ +EXTRA_DIST = src/doorbell.h src/mlx4.h src/mlx4-abi.h src/wqe.h src/mmio.h \ src/mlx4.map libmlx4.spec.in mlx4.driver dist-hook: libmlx4.spec
src/doorbell.h +5 -3
@@ -33,6 +33,8 @@#ifndef DOORBELL_H #define DOORBELL_H +#include "mmio.h" +#if SIZEOF_LONG ==8 #if __BYTE_ORDER == __LITTLE_ENDIAN
@@ -45,7 +47,7 @@static inline void mlx4_write64 (uint32_t val[2 ],struct mlx4_context *ctx,int offset) { - *(volatile uint64_t *) (ctx->uar + offset) =MLX4_PAIR_TO_64 (val); +mmio_writeq ((unsigned long )(ctx->uar + offset),MLX4_PAIR_TO_64 (val)); }#else
@@ -53,8 +55,8 @@ static inline void mlx4_write64(uint32_tstatic inline void mlx4_write64 (uint32_t val[2 ],struct mlx4_context *ctx,int offset) {pthread_spin_lock (&ctx->uar_lock); - *(volatile uint32_t *) (ctx->uar + offset) = val[0 ]; - *(volatile uint32_t *) (ctx->uar + offset +4 ) = val[1 ]; +mmio_writel ((unsigned long )(ctx->uar + offset), val[0 ]); +mmio_writel ((unsigned long )(ctx->uar + offset +4 ), val[1 ]);pthread_spin_unlock (&ctx->uar_lock); }
src/mlx4.h +2 -0
@@ -74,6 +74,8 @@#define wc_wmb () asm volatile("sfence" ::: "memory")#elif defined(__ia64__)#define wc_wmb () asm volatile("fwb" ::: "memory") +#elif defined(__s390x__) +#define wc_wmb { asm volatile("" : : : "memory") }#else #define wc_wmb () wmb()#endif
src/mmio.h new file +115 -0
115 lines not on this page · raw message
src/qp.c +2 -15
@@ -173,20 +173,6 @@ static void set_data_seg(struct mlx4_wqe dseg->byte_count =htonl (sg->length); } -/* -* Avoid using memcpy() to copy to BlueFlame page, since memcpy() -* implementations may use move-string-buffer assembler instructions, -* which do not guarantee order of copying. -*/ -static void mlx4_bf_copy (unsigned long *dst,unsigned long *src,unsigned bytecnt) -{ -while (bytecnt >0 ) { - *dst++ = *src++; - *dst++ = *src++; - bytecnt -=2 *sizeof (long ); - } -} -int mlx4_post_send (struct ibv_qp *ibqp,struct ibv_send_wr *wr,struct ibv_send_wr **bad_wr) {
@@ -434,7 +420,8 @@ out:*/ wmb (); - *(uint32_t *) (ctx->uar +MLX4_SEND_DOORBELL ) = qp->doorbell_qpn; +mmio_writel ((unsigned long )(ctx->uar +MLX4_SEND_DOORBELL ), + qp->doorbell_qpn); }if (nreq)
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html