summaryrefslogtreecommitdiffstats
path: root/src/plugins/rdma/test_api.c
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-01-07 16:08:43 +0100
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-01-08 19:51:04 +0000
commitd8c1ef925af5db085a7649076047eda48ac68404 (patch)
treedfe9a8a055370b362620ecc1e178334722953bab /src/plugins/rdma/test_api.c
parentaffc5f6d3d3c17eb8ae1cf7b04a1a1e638516ca4 (diff)
rdma: api: prepare support for direct verb
Prepare rdma interface creation API for direct verb support: - add new optional 'mode' parameters to select between ibverb or direct verb backend (optional, default to 'auto') - set default value for rxq_num (1), rxq_size (1024) and txq_size (1024) so they are now optional - bump default create value for rxq_size and txq_size to 1024 if unset (0) so they are coherent with default values above Type: feature Change-Id: Id9eae2b8eb0baaf34a0fcd55da6ad09515f57a93 Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins/rdma/test_api.c')
-rw-r--r--src/plugins/rdma/test_api.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/rdma/test_api.c b/src/plugins/rdma/test_api.c
index cfd65c029c2..19c35920b7b 100644
--- a/src/plugins/rdma/test_api.c
+++ b/src/plugins/rdma/test_api.c
@@ -43,6 +43,21 @@ typedef struct
rdma_test_main_t rdma_test_main;
+static vl_api_rdma_mode_t
+api_rdma_mode (rdma_mode_t mode)
+{
+ switch (mode)
+ {
+ case RDMA_MODE_AUTO:
+ return RDMA_API_MODE_AUTO;
+ case RDMA_MODE_IBV:
+ return RDMA_API_MODE_IBV;
+ case RDMA_MODE_DV:
+ return RDMA_API_MODE_DV;
+ }
+ return ~0;
+}
+
/* rdma create API */
static int
api_rdma_create (vat_main_t * vam)
@@ -64,6 +79,7 @@ api_rdma_create (vat_main_t * vam)
mp->rxq_num = clib_host_to_net_u16 (args.rxq_num);
mp->rxq_size = clib_host_to_net_u16 (args.rxq_size);
mp->txq_size = clib_host_to_net_u16 (args.txq_size);
+ mp->mode = api_rdma_mode (args.mode);
S (mp);
W (ret);