diff options
author | Matt Caswell <matt@openssl.org> | 2016-01-12 14:52:35 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-03-07 21:39:27 +0000 |
commit | 94777c9c86a2b2ea2726c49d6c8f61078558beba (patch) | |
tree | a0c4cc27b76e5e4044bdb34c21dd1f298af8094d /ssl/record/record.h | |
parent | 2f2c9caa727d7d2a5ce4bfb8266e019546ce77df (diff) |
Implement read pipeline support in libssl
Read pipelining is controlled in a slightly different way than with write
pipelining. While reading we are constrained by the number of records that
the peer (and the network) can provide to us in one go. The more records
we can get in one go the more opportunity we have to parallelise the
processing.
There are two parameters that affect this:
* The number of pipelines that we are willing to process in one go. This is
controlled by max_pipelines (as for write pipelining)
* The size of our read buffer. A subsequent commit will provide an API for
adjusting the size of the buffer.
Another requirement for this to work is that "read_ahead" must be set. The
read_ahead parameter will attempt to read as much data into our read buffer
as the network can provide. Without this set, data is read into the read
buffer on demand. Setting the max_pipelines parameter to a value greater
than 1 will automatically also turn read_ahead on.
Finally, the read pipelining as currently implemented will only parallelise
the processing of application data records. This would only make a
difference for renegotiation so is unlikely to have a significant impact.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'ssl/record/record.h')
-rw-r--r-- | ssl/record/record.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ssl/record/record.h b/ssl/record/record.h index 6105dedd44..bf3ffa3cfd 100644 --- a/ssl/record/record.h +++ b/ssl/record/record.h @@ -253,13 +253,16 @@ typedef struct record_layer_st { /* where we are when reading */ int rstate; + /* How many pipelines can be used to read data */ + unsigned int numrpipes; + /* How many pipelines can be used to write data */ unsigned int numwpipes; /* read IO goes into here */ SSL3_BUFFER rbuf; /* write IO goes into here */ SSL3_BUFFER wbuf[SSL_MAX_PIPELINES]; /* each decoded record goes in here */ - SSL3_RECORD rrec; + SSL3_RECORD rrec[SSL_MAX_PIPELINES]; /* goes out from here */ SSL3_RECORD wrec; |