diff options
author | Benoît Ganne <bganne@cisco.com> | 2020-01-07 16:08:43 +0100 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2020-01-08 19:51:04 +0000 |
commit | d8c1ef925af5db085a7649076047eda48ac68404 (patch) | |
tree | dfe9a8a055370b362620ecc1e178334722953bab /src/plugins/rdma/device.c | |
parent | affc5f6d3d3c17eb8ae1cf7b04a1a1e638516ca4 (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/device.c')
-rw-r--r-- | src/plugins/rdma/device.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/plugins/rdma/device.c b/src/plugins/rdma/device.c index 70720e4df74..7316edbaa25 100644 --- a/src/plugins/rdma/device.c +++ b/src/plugins/rdma/device.c @@ -589,8 +589,8 @@ rdma_create_if (vlib_main_t * vm, rdma_create_if_args_t * args) u16 qid; int i; - args->rxq_size = args->rxq_size ? args->rxq_size : 2 * VLIB_FRAME_SIZE; - args->txq_size = args->txq_size ? args->txq_size : 2 * VLIB_FRAME_SIZE; + args->rxq_size = args->rxq_size ? args->rxq_size : 1024; + args->txq_size = args->txq_size ? args->txq_size : 1024; args->rxq_num = args->rxq_num ? args->rxq_num : 1; if (!is_pow2 (args->rxq_num)) @@ -611,6 +611,19 @@ rdma_create_if (vlib_main_t * vm, rdma_create_if_args_t * args) goto err0; } + switch (args->mode) + { + case RDMA_MODE_AUTO: + break; + case RDMA_MODE_IBV: + break; + case RDMA_MODE_DV: + args->rv = VNET_API_ERROR_INVALID_VALUE; + args->error = clib_error_return (0, "unsupported mode"); + goto err0; + break; + } + dev_list = ibv_get_device_list (&n_devs); if (n_devs == 0) { |