From e86f55798ca7bc8f7fe22dd48c9d9f52c1bb029a Mon Sep 17 00:00:00 2001 From: Amir Shehata Date: Fri, 5 Jan 2018 12:22:45 -0800 Subject: [PATCH] LU-10459 lnd: throttle tx based on queue depth Throttle the transmits based on the negotiated conn queue depth to ensure we keep the number of outstanding transmits below the negotiated queue depth. Test-Parameters: trivial Signed-off-by: Amir Shehata Change-Id: I27190364904d6c79c0cd6d382228f8b8d2b11ba0 Reviewed-on: https://review.whamcloud.com/30751 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- lnet/klnds/o2iblnd/o2iblnd_cb.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lnet/klnds/o2iblnd/o2iblnd_cb.c b/lnet/klnds/o2iblnd/o2iblnd_cb.c index 96c9bf5..f71a12e 100644 --- a/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -848,7 +848,14 @@ __must_hold(&conn->ibc_lock) LASSERT(conn->ibc_outstanding_credits <= conn->ibc_queue_depth); LASSERT(conn->ibc_credits >= 0); LASSERT(conn->ibc_credits <= conn->ibc_queue_depth); - LASSERT(conn->ibc_nsends_posted <= conn->ibc_queue_depth); + + if (conn->ibc_nsends_posted == + conn->ibc_queue_depth) { + /* tx completions outstanding... */ + CDEBUG(D_NET, "%s: posted enough\n", + libcfs_nid2str(peer_ni->ibp_nid)); + return -EAGAIN; + } if (credit != 0 && conn->ibc_credits == 0) { /* no credits */ CDEBUG(D_NET, "%s: no credits\n", -- 1.8.3.1