aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts/vnet
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2019-03-01 14:14:10 +0100
committerDamjan Marion <dmarion@me.com>2019-03-26 10:06:57 +0000
commit4af1a7f938207f713c249270ed98a0c12f72cd3f (patch)
tree42c93b22e20228641de844d553819f400676cc5e /src/scripts/vnet
parent50d5069a80fd763f4270d61d991febbdfa88aed3 (diff)
Simplify adjacency rewrite code
Using memcpy instead of complex specific copy logic. This simplify the implementation and also improve perf slightly. Also move adjacency data from tail to head of buffer, which improves cache locality (header and data share the same cacheline) Finally, fix VxLAN which used to workaround vnet_rewrite logic. Change-Id: I770ddad9846f7ee505aa99ad417e6a61d5cbbefa Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/scripts/vnet')
-rw-r--r--src/scripts/vnet/l3fwd67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/scripts/vnet/l3fwd b/src/scripts/vnet/l3fwd
new file mode 100644
index 00000000000..e3dcf73e8de
--- /dev/null
+++ b/src/scripts/vnet/l3fwd
@@ -0,0 +1,67 @@
+create packet-generator interface pg0
+set int ip address pg0 192.168.1.1/24
+set int ip address pg0 192:168:1::1/64
+set ip arp pg0 192.168.1.2 1:2:3:4:5:6 static
+set ip6 neighbor pg0 192:168:1::2 1:2:3:4:5:6 static
+set int state pg0 up
+
+create packet-generator interface pg1
+set int ip address pg1 192.168.2.1/24
+set int ip address pg1 192:168:2::1/64
+set ip arp pg1 192.168.2.2 6:5:4:3:2:1 static
+set ip6 neighbor pg1 192:168:2::2 6:5:4:3:2:1 static
+set int state pg1 up
+
+packet-generator new {
+ name v4-1-to-2
+ limit -1
+ node ip4-input
+ size 64-64
+ interface pg0
+ data {
+ UDP: 192.168.1.2 -> 192.168.2.2
+ UDP: 4321 -> 1234
+ length 128 checksum 0 incrementing 1
+ }
+}
+
+packet-generator new {
+ name v4-2-to-1
+ limit -1
+ node ip4-input
+ size 64-64
+ interface pg0
+ data {
+ UDP: 192.168.2.2 -> 192.168.1.2
+ UDP: 1234 -> 4321
+ length 128 checksum 0 incrementing 1
+ }
+}
+
+packet-generator new {
+ name v6-1-to-2
+ limit -1
+ node ip6-input
+ size 64-64
+ interface pg0
+ data {
+ UDP: 192:168:1::2 -> 192:168:2::2
+ UDP: 4321 -> 1234
+ length 128 checksum 0 incrementing 1
+ }
+}
+
+packet-generator new {
+ name v6-2-to-1
+ limit -1
+ node ip6-input
+ size 64-64
+ interface pg0
+ data {
+ UDP: 192:168:2::2 -> 192:168:1::2
+ UDP: 1234 -> 4321
+ length 128 checksum 0 incrementing 1
+ }
+}
+
+packet-generator enable