summaryrefslogtreecommitdiffstats
path: root/src/plugins/rdma/test_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/rdma/test_api.c')
-rw-r--r--src/plugins/rdma/test_api.c48
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)