Skip to content

Loopback messages in RDMA

Contents

4.50 avg. rating (91% score) - 2 votes

What is a loopback message?

A loopback message is a message that was sent in an RDMA device, in a specific port from one QP to another/same QP on that device at the same port; the destination address of the address vector (in the QP or the AH) is equal to the address of the source port: LID and GID (if used).

If the used destination address attributes differ from the address of the source port, even if both ports belong to the same RDMA device - this message isn't considered a loopback message.

What will happen in a loopback message?

Unlike other protocols (for example, Ethernet), where the loopback of a message is handled by software (i.e., network stack), the device isn't aware of the existence of that message. In RDMA, the RDMA device processes all the Work Requests. It will fetch the Work Request, process it, fetch the needed data, and store it, ignoring the fact that this is a loopback message, and at the end, generate Work Completion(s) - if required.

So, what is the difference between loopback and non-loopback messages?

In loopback messages, packets won't be generated and won't appear at the port's physical link, and this has several effects:

  • Packet-sniffer outside this port won't see loopback messages.
  • Port counters won't be incremented for loopback messages (number of bytes + number of packets)
  • The RDMA device may ignore path attributes (MTU, source path bits, static rate). The SL can be used - this is implementation dependent.
  • The RDMA device may have optimization for handling loopback messages since they don't need to be partitioned into packets, create headers, calculate checksums, and validate them when received.

Usage for loopback messages

The software doesn't have to be aware that a message is a loopback message;

i.e., if a specific application has several processes running on several machines, part of them may run on the same machine, and it doesn't have to write different code for loopback messages. The RDMA protocol can handle it transparently.

Loopback messages can be a fast way to copy big chunks of data in the same machine (and even in the same process) asynchronicity. memcpy() is good, but DMA using a different engine than the CPU may be better, leaving the CPU to do other things...

Share Our Posts

Share this post through social bookmarks.

  • Delicious
  • Digg
  • Newsvine
  • RSS
  • StumbleUpon
  • Technorati

Comments

Tell us what do you think.

  1. Haodi Lu says: May 7, 2019

    Hi, sorry to ask an unrelated question. I'm going to modify the NIC driver code and have trouble finding the part of code that "consume" WQE and "create" CQE .
    I think it may relate to network part cause NIC need a network package to consume WQE, I guess.
    I was wondering if it is possible that you could point out that part code or which library and source file has that function.

    Thanks

    • Dotan Barak says: May 10, 2019

      Hi.

      This is device specific answer;
      the preparation of WQE is usually in "*qp.c" and parsing of CQE is usually in "*cq.c".

      The RDMA device itself is consuming the WQE and generating the CQE...

      Thanks
      Dotan

  2. Haodi Lu says: May 13, 2019

    Thanks for your help. And another problem is, assuming a situation that RDMA device must recognize whether a remote net package is RDMA SEND or RDMA read/write operation(creating cqe or not) when it comes to local NIC . I wonder whether the recognization process will involve the RDMA driver codes(which I can modify) or just work with RDMA hardware intrinsic function.
    I want to track remote host's RDMA write/read request but I find remote RDMA write/read won't create CQE at local host. So I want to find the modifiable code of recognization process (hoping you could tell me where the code is if it exist ).
    Thanks a lot.

    • Dotan Barak says: May 13, 2019

      Hi.

      Incoming messages are processed by the RDMA device;
      the driver is completely unaware to incoming RDMA Write/Read requests.

      Thanks
      Dotan

Add a Comment

This comment will be moderated; answer may be provided within 14 days.

Time limit is exhausted. Please reload CAPTCHA.