aboutsummaryrefslogtreecommitdiffstats
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.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/plugins/rdma/test_api.c b/src/plugins/rdma/test_api.c
index e9d5fcaad98..4ec4d3bf345 100644
--- a/src/plugins/rdma/test_api.c
+++ b/src/plugins/rdma/test_api.c
@@ -189,6 +189,41 @@ api_rdma_create_v3 (vat_main_t *vam)
return ret;
}
+static int
+api_rdma_create_v4 (vat_main_t *vam)
+{
+ vl_api_rdma_create_v4_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_V4, mp);
+
+ snprintf ((char *) mp->host_if, sizeof (mp->host_if), "%s", args.ifname);
+ if (args.name)
+ snprintf ((char *) mp->name, sizeof (mp->name), "%s", args.name);
+ else
+ mp->name[0] = 0;
+ mp->rxq_num = args.rxq_num;
+ mp->rxq_size = args.rxq_size;
+ mp->txq_size = args.txq_size;
+ mp->mode = api_rdma_mode (args.mode);
+ mp->no_multi_seg = args.no_multi_seg;
+ mp->max_pktlen = args.max_pktlen;
+ mp->rss4 = api_rdma_rss4 (args.rss4);
+ mp->rss6 = api_rdma_rss6 (args.rss6);
+
+ 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)
@@ -243,6 +278,24 @@ vl_api_rdma_create_v3_reply_t_handler (vl_api_rdma_create_v3_reply_t *mp)
vam->regenerate_interface_table = 1;
}
+/* rdma-create reply handler v4 */
+static void
+vl_api_rdma_create_v4_reply_t_handler (vl_api_rdma_create_v4_reply_t *mp)
+{
+ vat_main_t *vam = rdma_test_main.vat_main;
+ i32 retval = 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)