]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
rsocket: Dedicate a fixed number of SQEs for control messages
authorSean Hefty <sean.hefty@intel.com>
Thu, 17 Apr 2014 15:37:47 +0000 (08:37 -0700)
committerSean Hefty <sean.hefty@intel.com>
Wed, 30 Apr 2014 03:12:22 +0000 (20:12 -0700)
The number of SQEs allocated for control messages is set
to 1 of 2 constant values (either 4 or 2).  A default
value is used unless the size of the SQ is below a certain
threshold (16 entries).  This results in additional code
complexity, and it is highly unlikely that the SQ would
ever be allocated smaller than 16 entries.

Simplify the code to use a single constant value for the
number of SQEs allocated for control messages.  This will
also help in subsequent patches that will need to deal
with HCAs that do not support inline data.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/rsocket.c

index 7c5083cee85ce59e991cba8dd45c8c2e5960b9f7..ea18ba722c6a9169f6d6ba8c5f4e110a71a08da5 100644 (file)
@@ -59,6 +59,7 @@
 #define RS_OLAP_START_SIZE 2048
 #define RS_MAX_TRANSFER 65536
 #define RS_SNDLOWAT 2048
+#define RS_QP_MIN_SIZE 16
 #define RS_QP_MAX_SIZE 0xFFFE
 #define RS_QP_CTRL_SIZE 4
 #define RS_CONN_RETRIES 6
@@ -642,15 +643,13 @@ static void rs_set_qp_size(struct rsocket *rs)
 
        if (rs->sq_size > max_size)
                rs->sq_size = max_size;
-       else if (rs->sq_size < 4)
-               rs->sq_size = 4;
-       if (rs->sq_size <= (RS_QP_CTRL_SIZE << 2))
-               rs->ctrl_avail = 2;
+       else if (rs->sq_size < RS_QP_MIN_SIZE)
+               rs->sq_size = RS_QP_MIN_SIZE;
 
        if (rs->rq_size > max_size)
                rs->rq_size = max_size;
-       else if (rs->rq_size < 4)
-               rs->rq_size = 4;
+       else if (rs->rq_size < RS_QP_MIN_SIZE)
+               rs->rq_size = RS_QP_MIN_SIZE;
 }
 
 static void ds_set_qp_size(struct rsocket *rs)