Whamcloud - gitweb
LU-10459 lnd: throttle tx based on queue depth 51/30751/3
authorAmir Shehata <amir.shehata@intel.com>
Fri, 5 Jan 2018 20:22:45 +0000 (12:22 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 19 Jan 2018 19:09:55 +0000 (19:09 +0000)
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 <amir.shehata@intel.com>
Change-Id: I27190364904d6c79c0cd6d382228f8b8d2b11ba0
Reviewed-on: https://review.whamcloud.com/30751
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lnet/klnds/o2iblnd/o2iblnd_cb.c

index 96c9bf5..f71a12e 100644 (file)
@@ -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",