diff options
author | Mohammed Hawari <mohammed@hawari.fr> | 2020-10-27 17:42:32 +0100 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2020-11-13 16:58:18 +0000 |
commit | 798267aaa218b99daab4860fd630b9d4bb744c0d (patch) | |
tree | b7a628146d4858b9ae4a232ecd9f501085eed976 /src/plugins/rdma/test_api.c | |
parent | b8e129314aaf43a40e9bf15947578181cc53d675 (diff) |
rdma: implement multiseg rx without striding rq
Change-Id: I623617ad3c80610805dd3cf2a5f371e6677f4844
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: improvement
Diffstat (limited to 'src/plugins/rdma/test_api.c')
-rw-r--r-- | src/plugins/rdma/test_api.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/plugins/rdma/test_api.c b/src/plugins/rdma/test_api.c index 19c35920b7b..ff5dec1ad95 100644 --- a/src/plugins/rdma/test_api.c +++ b/src/plugins/rdma/test_api.c @@ -87,6 +87,36 @@ api_rdma_create (vat_main_t * vam) return ret; } +static int +api_rdma_create_v2 (vat_main_t * vam) +{ + vl_api_rdma_create_v2_t *mp; + rdma_create_if_args_t args; + int ret; + + if (!unformat_user (vam->input, unformat_rdma_create_if_args, &args)) + { + clib_warning ("unknown input `%U'", format_unformat_error, vam->input); + return -99; + } + + M (RDMA_CREATE_V2, mp); + + snprintf ((char *) mp->host_if, sizeof (mp->host_if), "%s", args.ifname); + snprintf ((char *) mp->name, sizeof (mp->name), "%s", args.name); + 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); + mp->no_multi_seg = args.no_multi_seg; + mp->max_pktlen = clib_host_to_net_u16 (args.max_pktlen); + + S (mp); + W (ret); + + return ret; +} + /* rdma-create reply handler */ static void vl_api_rdma_create_reply_t_handler (vl_api_rdma_create_reply_t * mp) @@ -105,6 +135,24 @@ vl_api_rdma_create_reply_t_handler (vl_api_rdma_create_reply_t * mp) vam->regenerate_interface_table = 1; } +/* rdma-create reply handler */ +static void +vl_api_rdma_create_v2_reply_t_handler (vl_api_rdma_create_v2_reply_t * mp) +{ + vat_main_t *vam = rdma_test_main.vat_main; + i32 retval = ntohl (mp->retval); + + if (retval == 0) + { + fformat (vam->ofp, "created rdma with sw_if_index %d\n", + ntohl (mp->sw_if_index)); + } + + vam->retval = retval; + vam->result_ready = 1; + vam->regenerate_interface_table = 1; +} + /* rdma delete API */ static int api_rdma_delete (vat_main_t * vam) |