Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util: Add barriers support for LoongArch #1035

Merged
merged 1 commit into from
Aug 2, 2021

Conversation

cnmushiba
Copy link
Contributor

Add barriers support for LoongArch architecture(a new RISC architecture).

@@ -96,6 +96,8 @@
#define udma_to_device_barrier() asm volatile("dsb st" ::: "memory");
#elif defined(__sparc__) || defined(__s390x__)
#define udma_to_device_barrier() asm volatile("" ::: "memory")
#elif defined(__loongarch__)
#define udma_to_device_barrier() asm volatile("dbar 0" ::: "memory");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh-oh. The macros should not have trailing semicolon in its expansion; this was neglected in previous reviews but got caught by upstream CI. You should remove the semicolons like in the previous block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed, thanks.

@rleon
Copy link
Member

rleon commented Jul 20, 2021

  1. Please don't use empty commit messages.
  2. Does rdma-core even work on MIPS?

Add barriers support for LoongArch architecture

Signed-off-by: wangguofeng <wangguofeng@loongson.cn>
Reviewed-by: WANG Xuerui <git@xen0n.name>
Reviewed-by: Na Zhang <zhangna@loongson.cn>
Reviewed-by: Yaliang Zhu <zhuyaliang@loongson.cn>
@cnmushiba
Copy link
Contributor Author

cnmushiba commented Jul 20, 2021

  1. Please don't use empty commit messages.

thanks.

  1. Does rdma-core even work on MIPS?

May not work.

@rleon
Copy link
Member

rleon commented Jul 21, 2021

  1. Does rdma-core even work on MIPS?

May not work.

It is far from "may not work". I didn't hear from anyone that he/she used RDMA stack on MIPS arch.
RDMA HW is supported on x86, ARM and PowerPC machines, while rdma-core never compiled on other platforms.

So the question is what HW that part of rdma-core and upstream kernel really works on MIPS?

@cnmushiba
Copy link
Contributor Author

It is far from "may not work". I didn't hear from anyone that he/she used RDMA stack on MIPS arch.

LoongArch is not MIPS, it is a new RISC architecture(such as aarch64, riscv).

Here is some information about LoongArch.

RDMA HW is supported on x86, ARM and PowerPC machines, while rdma-core never compiled on other platforms.

We have the Mellanox ib cards. We need its some benchmark data. Users will also use it in the future. The card info as follow:

04:00.0 InfiniBand: Mellanox Technologies MT26428 [ConnectX VPI PCIe 2.0 5GT/s - IB QDR / 10GigE] (rev b0)

Our kernel(development version) already supported mlx4_ib.ko. We also need some other userspaces software, such as ib_write_bw, ib_send_bw and so on. These software need libmlx4.so, librdmacm.so, libibumad.so.3, libibverbs.so, etc. Compile libmlx4.so needs that adding barriers support for LoongArch architecture. Because of

CHECK_C_SOURCE_COMPILES("                                                                                                                                                                                            
#include \"${CMAKE_CURRENT_SOURCE_DIR}/util/udma_barrier.h\"                                                                                                                                                         
 int main(int argc,const char *argv[]) {return 0;}"                                                                                                                                                                  
  HAVE_COHERENT_DMA)

Mlx4 does also need barrier support in LoongArch architecture.

We've also got the benchmark data on Mellanox ib cards.

@rleon
Copy link
Member

rleon commented Jul 21, 2021

Ohh, great.

I read about it https://www.tomshardware.com/news/loongson-technology-develops-its-own-cpu-instruction-set-architecture and they talked about MIPS

@rleon rleon merged commit 071c10a into linux-rdma:master Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants