aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/pg/cli.c
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2022-03-04 16:05:01 +0100
committerBeno�t Ganne <bganne@cisco.com>2022-03-04 15:43:43 +0000
commit59183e9e1074e28560718daed09d1dcb07afc877 (patch)
tree35b598f35ad57e5fbaad5baf720e30139c2f91ff /src/vnet/pg/cli.c
parent3626a7cf82428dbe01df443f6011fe3144266209 (diff)
pg: add support for ip mode through cli
Type: improvement Change-Id: I5dda196ab8f1b634fcac46acd5c57a6dd726759c Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/pg/cli.c')
-rw-r--r--src/vnet/pg/cli.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vnet/pg/cli.c b/src/vnet/pg/cli.c
index e57e72573f3..6715bbde194 100644
--- a/src/vnet/pg/cli.c
+++ b/src/vnet/pg/cli.c
@@ -689,6 +689,7 @@ create_pg_if_cmd_fn (vlib_main_t * vm,
unformat_input_t _line_input, *line_input = &_line_input;
u32 if_id, gso_enabled = 0, gso_size = 0, coalesce_enabled = 0;
clib_error_t *error = NULL;
+ pg_interface_mode_t mode = PG_MODE_ETHERNET;
if (!unformat_user (input, unformat_line_input, line_input))
return 0;
@@ -710,6 +711,10 @@ create_pg_if_cmd_fn (vlib_main_t * vm,
goto done;
}
}
+ else if (unformat (line_input, "mode ip4"))
+ mode = PG_MODE_IP4;
+ else if (unformat (line_input, "mode ip6"))
+ mode = PG_MODE_IP6;
else
{
error = clib_error_create ("unknown input `%U'",
@@ -719,7 +724,7 @@ create_pg_if_cmd_fn (vlib_main_t * vm,
}
pg_interface_add_or_get (pg, if_id, gso_enabled, gso_size, coalesce_enabled,
- PG_MODE_ETHERNET);
+ mode);
done:
unformat_free (line_input);
@@ -731,7 +736,8 @@ done:
VLIB_CLI_COMMAND (create_pg_if_cmd, static) = {
.path = "create packet-generator",
.short_help = "create packet-generator interface <interface name>"
- " [gso-enabled gso-size <size> [coalesce-enabled]]",
+ " [gso-enabled gso-size <size> [coalesce-enabled]]"
+ " [mode <ethernet | ip4 | ip6>]",
.function = create_pg_if_cmd_fn,
};
/* *INDENT-ON* */