From: sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH librdmacm 2/4] rsocket: Dedicate a fixed number of SQEs for control messages
Date: Fri, 18 Apr 2014 14:55:41 -0700 [thread overview]
Message-ID: <1397858143-22402-2-git-send-email-sean.hefty@intel.com> (raw)
In-Reply-To: <1397858143-22402-1-git-send-email-sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
From: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
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-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
src/rsocket.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/rsocket.c b/src/rsocket.c
index 7c5083c..ea18ba7 100644
--- a/src/rsocket.c
+++ b/src/rsocket.c
@@ -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)
--
1.7.3
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-04-18 21:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-18 21:55 [PATCH librdmacm 1/4] rsocket: Check max inline data after creating QP sean.hefty-ral2JQCrhuEAvxtiuMwx3w
[not found] ` <1397858143-22402-1-git-send-email-sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-04-18 21:55 ` sean.hefty-ral2JQCrhuEAvxtiuMwx3w [this message]
2014-04-18 21:55 ` [PATCH librdmacm 3/4] rsocket: Modify when control messages are available sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2014-04-18 21:55 ` [PATCH librdmacm 4/4] rsocket: Relax requirement for minimal inline data sean.hefty-ral2JQCrhuEAvxtiuMwx3w
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1397858143-22402-2-git-send-email-sean.hefty@intel.com \
--to=sean.hefty-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox