Queue Depth and Credit Management Logic

 

 

Comments on Alexy's changes

Recently Alexy submitted the following patch:

https://review.whamcloud.com/#/c/28850

This changes the IBLND_SEND_WRS as follows:

# original code
#define IBLND_SEND_WRS(c)	\
	((c->ibc_max_frags + 1) * kiblnd_concurrent_sends(c->ibc_version, \
							  c->ibc_peer->ibp_ni))
 
# modified code
#define IBLND_SEND_WRS(c)	\
	((c->ibc_max_frags + 1) * c->ibc_queue_depth)

The assumption that's being made here is that it is enough to set the init_qp_attr→cap.max_send_wr to the negotiated number of fragments * the queue depth. This is the wrong assumption, since the WRS are actually consumed per fragment you're sending over, not per ib_post_send(). This might work for fastreg or FMR because they only have one fragment. And with the latest changes for FMR that is no longer true.

However, we still need to support the global memory region case, where we can have up to 256 fragments to send over and we can send up to kiblnd_concurrent_send() at the same time, therefore if we make the change as noted above, we'll end up overflowing the Work Request Queue pretty quickly.

Furthermore, the change in kiblnd_create_conn() to reduce both the init_qp_attr→cap.max_send_wr and init_qp_attr→cap.max_recv_wr is problematic because we end up reducing a negotiated value. This will cause a disconnect between the negotiated value and what will be used for the queue pair being created. Both peers can use a different value for their side of the queue pair. I'm unsure what impact that'll have, or if we open ourselves to corner cases we have not considered.

Conclusion

Some of Alexy's patches are useful, but the above patch and https://review.whamcloud.com/#/c/28851/5 are problematic because of the reasons I outlined below

Tasks