From e347acbc31111504c015531e8ad764a86d489309 Mon Sep 17 00:00:00 2001 From: Mohsin Kazmi Date: Mon, 28 Sep 2020 10:26:33 +0000 Subject: 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 Change-Id: Ib93c350298b228e80426e58ac77f3bbc93b8be27 --- src/vnet/devices/virtio/cli.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/vnet/devices/virtio/cli.c') 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 " - "[feature-mask ] [gso-enabled] [csum-enabled]", + "[feature-mask ] [gso-enabled] [csum-enabled] " + "[buffering [size ]]", .function = virtio_pci_create_command_fn, }; /* *INDENT-ON* */ -- cgit 1.2.3-korg