diff options
author | Mohsin Kazmi <sykazmi@cisco.com> | 2019-07-23 11:54:48 +0200 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2019-07-28 14:20:06 +0000 |
commit | 22e9cfd760be613f33a4135e9247729b64619cc6 (patch) | |
tree | 81c6c66f0729202b71fa9b7748b405f4489f3f5a /src/vnet/pg/cli.c | |
parent | be83704c5b1482dfd2ba38423662a9da5a8d8f81 (diff) |
pg: add GSO support
Type: feature
Change-Id: I72676495a85fbecc946aa266a75234cce70c3a5e
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/pg/cli.c')
-rw-r--r-- | src/vnet/pg/cli.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/vnet/pg/cli.c b/src/vnet/pg/cli.c index 8f82ac1c1f7..a8451d74e1e 100644 --- a/src/vnet/pg/cli.c +++ b/src/vnet/pg/cli.c @@ -649,7 +649,7 @@ create_pg_if_cmd_fn (vlib_main_t * vm, { pg_main_t *pg = &pg_main; unformat_input_t _line_input, *line_input = &_line_input; - u32 if_id; + u32 if_id, gso_enabled = 0, gso_size = 0; clib_error_t *error = NULL; if (!unformat_user (input, unformat_line_input, line_input)) @@ -659,7 +659,17 @@ create_pg_if_cmd_fn (vlib_main_t * vm, { if (unformat (line_input, "interface pg%u", &if_id)) ; - + else if (unformat (line_input, "gso-enabled")) + { + gso_enabled = 1; + if (unformat (line_input, "gso-size %u", &gso_size)) + ; + else + { + error = clib_error_create ("gso enabled but gso size missing"); + goto done; + } + } else { error = clib_error_create ("unknown input `%U'", @@ -668,7 +678,7 @@ create_pg_if_cmd_fn (vlib_main_t * vm, } } - pg_interface_add_or_get (pg, if_id); + pg_interface_add_or_get (pg, if_id, gso_enabled, gso_size); done: unformat_free (line_input); @@ -679,7 +689,7 @@ done: /* *INDENT-OFF* */ VLIB_CLI_COMMAND (create_pg_if_cmd, static) = { .path = "create packet-generator", - .short_help = "create packet-generator interface <interface name>", + .short_help = "create packet-generator interface <interface name> [gso-enabled gso-size <size>]", .function = create_pg_if_cmd_fn, }; /* *INDENT-ON* */ |