From 50bd16559933576ed632eff8757d5954e93e99ce Mon Sep 17 00:00:00 2001 From: Mohsin Kazmi Date: Wed, 26 Aug 2020 11:07:48 +0200 Subject: tap: add virtio 1.1 API flag Type: feature Signed-off-by: Mohsin Kazmi Change-Id: I3e00deb94943c545d1649865b2efdf7d51b90f4d --- src/vnet/devices/tap/cli.c | 6 +++++- src/vnet/devices/tap/tap.h | 4 +++- src/vnet/devices/tap/tapv2.api | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src/vnet/devices') diff --git a/src/vnet/devices/tap/cli.c b/src/vnet/devices/tap/cli.c index fa5fa91e7a6..704cd18d729 100644 --- a/src/vnet/devices/tap/cli.c +++ b/src/vnet/devices/tap/cli.c @@ -100,6 +100,10 @@ tap_create_command_fn (vlib_main_t * vm, unformat_input_t * input, args.tap_flags |= TAP_FLAG_ATTACH; else if (unformat (line_input, "tun")) args.tap_flags |= TAP_FLAG_TUN; + else if (unformat (line_input, "packed")) + args.tap_flags |= TAP_FLAG_PACKED; + else if (unformat (line_input, "in-order")) + args.tap_flags |= TAP_FLAG_IN_ORDER; else if (unformat (line_input, "hw-addr %U", unformat_ethernet_address, args.mac_addr.bytes)) args.mac_addr_set = 1; @@ -141,7 +145,7 @@ VLIB_CLI_COMMAND (tap_create_command, static) = { "[host-ip4-gw ] [host-ip6-gw ] " "[host-mac-addr ] [host-if-name ] " "[host-mtu-size ] [no-gso|gso|csum-offload|gro-coalesce] " - "[persist] [attach] [tun]", + "[persist] [attach] [tun] [packed] [in-order]", .function = tap_create_command_fn, }; /* *INDENT-ON* */ diff --git a/src/vnet/devices/tap/tap.h b/src/vnet/devices/tap/tap.h index 93b5da51dc5..46f13a4e274 100644 --- a/src/vnet/devices/tap/tap.h +++ b/src/vnet/devices/tap/tap.h @@ -28,7 +28,9 @@ _ (PERSIST, 2) \ _ (ATTACH, 3) \ _ (TUN, 4) \ - _ (GRO_COALESCE, 5) + _ (GRO_COALESCE, 5) \ + _ (PACKED, 6) \ + _ (IN_ORDER, 7) typedef enum { diff --git a/src/vnet/devices/tap/tapv2.api b/src/vnet/devices/tap/tapv2.api index 94e1a7c00c2..6b6618411a6 100644 --- a/src/vnet/devices/tap/tapv2.api +++ b/src/vnet/devices/tap/tapv2.api @@ -32,6 +32,8 @@ enum tap_flags { TAP_API_FLAG_ATTACH = 8, /* attach to the existing persistence interface after vpp crash/restart */ TAP_API_FLAG_TUN = 16, /* create TUN interface instead of tap */ TAP_API_FLAG_GRO_COALESCE = 32, /* enable packet coalescing on tx side, provided gso enabled */ + TAP_API_FLAG_PACKED = 64 [backwards_compatible], /* enable packed ring support */ + TAP_API_FLAG_IN_ORDER = 128 [backwards_compatible], /* enable in-order desc support */ }; /** \brief Initialize a new tap interface with the given parameters -- cgit 1.2.3-korg