summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/cli.c
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2020-09-28 10:26:33 +0000
committerBeno�t Ganne <bganne@cisco.com>2020-09-28 16:47:30 +0000
commite347acbc31111504c015531e8ad764a86d489309 (patch)
tree3a72d961fd97b9ce7985865d89b0c45d27cab2fc /src/vnet/devices/virtio/cli.c
parent7741afaf5c66a5d7ed1d2d76ae36a81ec24fdaaa (diff)
virtio: add packet buffering on tx
Type: feature This patch adds packet buffering on tx for slow backend which have some jitter/delays in freeing the vrings. There are some limitations to the current design: 1) It only works in poll mode. 2) Atleast 1 rx queue of an interface (with buffering enabled) should be placed on each worker and main thread. Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ib93c350298b228e80426e58ac77f3bbc93b8be27
Diffstat (limited to 'src/vnet/devices/virtio/cli.c')
-rw-r--r--src/vnet/devices/virtio/cli.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vnet/devices/virtio/cli.c b/src/vnet/devices/virtio/cli.c
index 6d47bad7e39..8a9c97be8cb 100644
--- a/src/vnet/devices/virtio/cli.c
+++ b/src/vnet/devices/virtio/cli.c
@@ -30,6 +30,7 @@ virtio_pci_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
unformat_input_t _line_input, *line_input = &_line_input;
virtio_pci_create_if_args_t args;
u64 feature_mask = (u64) ~ (0ULL);
+ u32 buffering_size = 0;
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
@@ -46,6 +47,12 @@ virtio_pci_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
args.gso_enabled = 1;
else if (unformat (line_input, "csum-enabled"))
args.checksum_offload_enabled = 1;
+ else if (unformat (line_input, "buffering"))
+ {
+ args.virtio_flags = VIRTIO_FLAG_BUFFERING;
+ if (unformat (line_input, "size %u", &buffering_size))
+ args.buffering_size = buffering_size;
+ }
else
return clib_error_return (0, "unknown input `%U'",
format_unformat_error, input);
@@ -61,7 +68,8 @@ virtio_pci_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
VLIB_CLI_COMMAND (virtio_pci_create_command, static) = {
.path = "create interface virtio",
.short_help = "create interface virtio <pci-address> "
- "[feature-mask <hex-mask>] [gso-enabled] [csum-enabled]",
+ "[feature-mask <hex-mask>] [gso-enabled] [csum-enabled] "
+ "[buffering [size <buffering-szie>]]",
.function = virtio_pci_create_command_fn,
};
/* *INDENT-ON* */