diff options
author | Niyaz Murshed <niyaz.murshed@arm.com> | 2024-02-21 19:54:24 +0000 |
---|---|---|
committer | Fan Zhang <fanzhang.oss@gmail.com> | 2024-02-28 13:40:03 +0000 |
commit | 7f050d9749bbf16c0d16625d52d94e0811f284c7 (patch) | |
tree | 506309e76c07378b6edaee72d11cbb388ec2c941 /src/vnet/crypto | |
parent | ea158d64a0aa0673807c74ce00fc854519ba589c (diff) |
crypto: CLI to change dispatch mode
This change aims to affect crypto_sw_scheduler behavior,
but all the edits end up in vnet/crypto.
After 9a9604b introduced adaptive mode for crypto dispatch,
the performance of async mode at lower rate got worse.
A work around for CSIT test is done by changing dispatch mode via explicit API call
in https://github.com/FDio/vpp/commit/139aba204780f6cc2845b311820a0b4c47517d02
In this change, the CLI is brought back to allow user to fix the
dispatch mode.
set crypto async dispatch mode <polling|interrupt|adaptive>
Type: improvement
Change-Id: I029e98aa25889eddcf62e75a6c78926cdee862ef
Signed-off-by: Niyaz Murshed <niyaz.murshed@arm.com>
Diffstat (limited to 'src/vnet/crypto')
-rw-r--r-- | src/vnet/crypto/cli.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/vnet/crypto/cli.c b/src/vnet/crypto/cli.c index 7c2efa2cf64..5bc070c73c2 100644 --- a/src/vnet/crypto/cli.c +++ b/src/vnet/crypto/cli.c @@ -429,6 +429,45 @@ VLIB_CLI_COMMAND (set_crypto_async_handler_command, static) = }; /* *INDENT-ON* */ +static clib_error_t * +set_crypto_async_dispatch_command_fn (vlib_main_t *vm, unformat_input_t *input, + vlib_cli_command_t *cmd) +{ + unformat_input_t _line_input, *line_input = &_line_input; + clib_error_t *error = 0; + u8 adaptive = 0; + u8 mode = VLIB_NODE_STATE_INTERRUPT; + + if (!unformat_user (input, unformat_line_input, line_input)) + return 0; + + while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) + { + if (unformat (line_input, "polling")) + mode = VLIB_NODE_STATE_POLLING; + else if (unformat (line_input, "interrupt")) + mode = VLIB_NODE_STATE_INTERRUPT; + else if (unformat (line_input, "adaptive")) + adaptive = 1; + else + { + error = clib_error_return (0, "invalid params"); + goto done; + } + } + + vnet_crypto_set_async_dispatch (mode, adaptive); +done: + unformat_free (line_input); + return error; +} + +VLIB_CLI_COMMAND (set_crypto_async_dispatch_mode_command, static) = { + .path = "set crypto async dispatch mode", + .short_help = "set crypto async dispatch mode <polling|interrupt|adaptive>", + .function = set_crypto_async_dispatch_command_fn, +}; + /* * fd.io coding-style-patch-verification: ON * |