Once the QP1 is enabled, RC QPs can be created by exchanging the CM MAD packets on QP1. See the “Communication Management” chapter in the InfiniBand Architecture Specification Volume 1, Annex A16 RoCE and Annex 17 RoCE V2 [Ref 1] for details on CM MAD packets. For creating any RC QP, the following steps need to be performed:
1. Allocate memory for queues (RQ, SQ, CQ), and program the respective base address registers.
° RQ base address is written to RQBAi register, SQ base address is written to SQBAi register and queue depths to QDEPTHi.
° CQ base address is written to CQBAi register.
° Configure the each RQ buffer size by writing to QPCONFi.
2. Pick up memory for both SQ completion doorbell and RQ write pointers from the pre-allocated doorbell memory pool as part of ERNIC initialization.
° SQ completion doorbell address to CQDBADDi register.
° RQ write pointer doorbell address to RQWPTRDBADDi register.
3. When the QP state transitions from RESET to RTS during the connection establishment, configure the following information:
a. Write remote host MAC address to MACDESADDLSBi and MACDESADDMSBi registers.
b. Configure DESTQPCONFi with destination QP ID.
c. Configure IP address to IPDESADDR1i - IPDESADDR4i if IPv6 is being used otherwise, write only IPDESADDR1i with IPv4 address. Configure the IP address version in the QPCONFi.
d. Configure send queue PSN by writing to SQPSNi.
e. Configure last receive queue PSN by writing to LSTRQREQi
f. Configure PMTU by writing to QPCONFi register.
g. Configure the following by writing to TIMEOUTCONFi register.
- Configure RNR retry count and RNR retry timeout
- Configure retry timeout and retry timeout
h. PD number that the QP is associated with is configured by writing to Protection Domain number register.