summaryrefslogtreecommitdiffstats
path: root/src/vnet/pg/cli.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-04-15 09:34:43 -0400
committerFlorin Coras <florin.coras@gmail.com>2020-04-15 19:19:29 +0000
commit08eb2bb205f998a75dacd1f3b999ec1a10160b35 (patch)
treec5d83c0db16472322720ba17c626cb74aae635e6 /src/vnet/pg/cli.c
parent4422753b9f7edf7ff391f97a10c1b8a7dbd7dafb (diff)
pg: set vnet buffer flags in pg streams
See .../extras/pg/checksum_offload.pg for a nontrivial example, which deliberately sets bogus ip and udp checksums in the generated packets, then fixes the mess with (software emulated) hardware checksum offload. Validated via "pcap dispatch trace on max 1000 buffer-trace pg-input 100". Packets stuffed into loop1-output have the configured bogus ip and udp checksums. vnet_calc_checksums_inline(...) fixes the checksums, which are correct when packets visit loop1-tx. The packet generator is a dumb robot in this regard. If you ask for a ridiculous flag combination - example: ip4 and ip6 - your mileage may vary. Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I6d9e790f373bcd9e445a89113ca8e4c8f9aa9419
Diffstat (limited to 'src/vnet/pg/cli.c')
-rw-r--r--src/vnet/pg/cli.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vnet/pg/cli.c b/src/vnet/pg/cli.c
index 9336ca406d7..b3aaddfda2b 100644
--- a/src/vnet/pg/cli.c
+++ b/src/vnet/pg/cli.c
@@ -376,6 +376,10 @@ new_stream (vlib_main_t * vm,
else if (unformat (input, "source pg%u", &s.if_id))
;
+ else if (unformat (input, "buffer-flags %U",
+ unformat_vnet_buffer_flags, &s.buffer_flags))
+ ;
+
else if (unformat (input, "node %U",
unformat_vlib_node, vm, &s.node_index))
;