aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven <sluong@cisco.com>2017-09-08 15:40:32 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2017-09-11 10:15:43 +0000
commita19e1054b58024891691eaebeb13700cdce57fea (patch)
tree1fa8043e94b45a22dd27a40876534d4f5ea12983 /src
parent1500254bee11355bbd69cc1dd9705be4f002f2bd (diff)
memif: mode ip is not settable from binary API
While mode ip is supported via the CLI for creating a memif interface, it is not settable from the binary API due to missing code. While at it, update the help usage to include the missing keyword secret. Change-Id: Ia9c71f4017210a5e1733ce4992fbb566b7d20c1a Signed-off-by: Steven <sluong@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/memif/cli.c4
-rw-r--r--src/plugins/memif/memif_api.c3
-rw-r--r--src/plugins/memif/memif_test.c7
3 files changed, 10 insertions, 4 deletions
diff --git a/src/plugins/memif/cli.c b/src/plugins/memif/cli.c
index 8af761646a8..e1bd04441e0 100644
--- a/src/plugins/memif/cli.c
+++ b/src/plugins/memif/cli.c
@@ -109,8 +109,8 @@ VLIB_CLI_COMMAND (memif_create_command, static) = {
.path = "create memif",
.short_help = "create memif [id <id>] [socket <path>] "
"[ring-size <size>] [buffer-size <size>] [hw-addr <mac-address>] "
- "<master|slave> [rx-queues <number>] [tx-queues <number>]"
- "[mode ip]",
+ "<master|slave> [rx-queues <number>] [tx-queues <number>] "
+ "[mode ip] [secret <string>]",
.function = memif_create_command_fn,
};
/* *INDENT-ON* */
diff --git a/src/plugins/memif/memif_api.c b/src/plugins/memif/memif_api.c
index 89afdb8d681..07347bc05a4 100644
--- a/src/plugins/memif/memif_api.c
+++ b/src/plugins/memif/memif_api.c
@@ -133,6 +133,9 @@ vl_api_memif_create_t_handler (vl_api_memif_create_t * mp)
/* role */
args.is_master = (mp->role == 0);
+ /* mode */
+ args.mode = mp->mode;
+
/* rx/tx queues */
if (args.is_master == 0)
{
diff --git a/src/plugins/memif/memif_test.c b/src/plugins/memif/memif_test.c
index a7c23daae9c..4ca7526df13 100644
--- a/src/plugins/memif/memif_test.c
+++ b/src/plugins/memif/memif_test.c
@@ -129,7 +129,7 @@ api_memif_create (vat_main_t * vam)
u32 rx_queues = MEMIF_DEFAULT_RX_QUEUES;
u32 tx_queues = MEMIF_DEFAULT_TX_QUEUES;
int ret;
-
+ u8 mode = MEMIF_INTERFACE_MODE_ETHERNET;
while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
{
@@ -148,6 +148,8 @@ api_memif_create (vat_main_t * vam)
else if (unformat (i, "slave %U",
unformat_memif_queues, &rx_queues, &tx_queues))
role = 1;
+ else if (unformat (i, "mode ip"))
+ mode = MEMIF_INTERFACE_MODE_IP;
else if (unformat (i, "hw_addr %U", unformat_ethernet_address, hw_addr))
;
else
@@ -177,6 +179,7 @@ api_memif_create (vat_main_t * vam)
M (MEMIF_CREATE, mp);
+ mp->mode = mode;
mp->id = clib_host_to_net_u32 (id);
mp->role = role;
mp->ring_size = clib_host_to_net_u32 (ring_size);
@@ -309,7 +312,7 @@ static void vl_api_memif_details_t_handler (vl_api_memif_details_t * mp)
#define foreach_vpe_api_msg \
_(memif_create, "[id <id>] [socket <path>] [ring_size <size>] " \
"[buffer_size <size>] [hw_addr <mac_address>] " \
- "<master|slave>") \
+ "[secret <string>] [mode ip] <master|slave>") \
_(memif_delete, "<sw_if_index>") \
_(memif_dump, "")