-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce RDMA transport (experimental)
Valkey Over RDMA[1] has been supported as experimental feature since Valkey 8.0. Support RDMA transport for the client side. RDMA is not a builtin feature, supported as module only, so we have to run test.sh with more argument @VALKEY_RDMA_MODULE and @VALKEY_RDMA_ADDR. An example to run test.sh: VALKEY_RDMA_MODULE=/path/to/valkey-rdma.so VALKEY_RDMA_ADDR=192.168.122.1 TEST_RDMA=1 ./test.sh ... Testing against RDMA connection (192.168.122.1:56379): #138 Is able to deliver commands: PASSED #139 Is a able to send commands verbatim: PASSED #140 %s String interpolation works: PASSED #141 %b String interpolation works: PASSED #142 Binary reply length is correct: PASSED #143 Can parse nil replies: PASSED #144 Can parse integer replies: PASSED #145 Can parse multi bulk replies: PASSED #146 Can handle nested multi bulk replies: PASSED #147 Send command by passing argc/argv: PASSED #148 Can pass NULL to valkeyGetReply: PASSED #149 RESP3 PUSH messages are handled out of band by default: PASSED #150 We can set a custom RESP3 PUSH handler: PASSED #151 We properly handle a NIL invalidation payload: PASSED #152 With no handler, PUSH replies come in-band: PASSED #153 With no PUSH handler, no replies are lost: PASSED #154 We set a default RESP3 handler for valkeyContext: PASSED #155 We don't set a default RESP3 push handler for valkeyAsyncContext: PASSED #156 Our VALKEY_OPT_NO_PUSH_AUTOFREE flag works: PASSED #157 We can use valkeyOptions to set a custom PUSH handler for valkeyContext: PASSED #158 We can use valkeyOptions to set a custom PUSH handler for valkeyAsyncContext: PASSED #159 We can use valkeyOptions to set privdata: PASSED #160 Our privdata destructor fires when we free the context: PASSED #161 Successfully completes a command when the timeout is not exceeded: PASSED #162 Does not return a reply when the command times out: SKIPPED #163 Reconnect properly reconnects after a timeout: PASSED #164 Reconnect properly uses owned parameters: PASSED #165 Returns I/O error when the connection is lost: PASSED #166 Returns I/O error on socket timeout: PASSED #167 Set error when an invalid timeout usec value is used during connect: PASSED #168 Set error when an invalid timeout sec value is used during connect: PASSED #169 Append format command: PASSED #170 Throughput: (1000x PING: 0.010s) (1000x LRANGE with 500 elements: 0.060s) (1000x INCRBY: 0.012s) (10000x PING (pipelined): 0.066s) (10000x LRANGE with 500 elements (pipelined): 0.523s) (10000x INCRBY (pipelined): 0.024s) ... Thanks to Michael Grunder for lots of review suggestions! Link[1]: valkey-io/valkey#477 Signed-off-by: zhenwei pi <[email protected]>
- Loading branch information
1 parent
5edae43
commit b58fe2f
Showing
9 changed files
with
1,206 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
|
||
/* | ||
* Copyright (c) 2021-2024 zhenwei pi <[email protected]> | ||
* | ||
* Valkey Over RDMA has been supported as experimental feature since Valkey-8.0. | ||
* It's also supported as an experimental feature by libvalkey, | ||
* It may be removed or changed in any version. | ||
* | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* * Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* * Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* * Neither the name of the copyright holder nor the names of its | ||
* contributors may be used to endorse or promote products derived | ||
* from this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#ifndef VALKEY_RDMA_H | ||
#define VALKEY_RDMA_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* Helper macros to initialize options for RDMA. | ||
* It's ok to reuse TCP options. | ||
*/ | ||
#define VALKEY_OPTIONS_SET_RDMA(opts, ip_, port_) do { \ | ||
(opts)->type = VALKEY_CONN_RDMA; \ | ||
(opts)->endpoint.tcp.ip = ip_; \ | ||
(opts)->endpoint.tcp.port = port_; \ | ||
} while(0) | ||
|
||
|
||
int valkeyInitiateRdma(void); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* VALKEY_RDMA_H */ |
Oops, something went wrong.