diff mbox series

[ovs-dev,[RFC] ] ofproto-dpif.at: add testcase for nd_reserved and nd_options_type fields

Message ID 20200929005005.50479-1-fankaixi.li@bytedance.com
State New
Headers show
Series [ovs-dev,[RFC] ] ofproto-dpif.at: add testcase for nd_reserved and nd_options_type fields | expand

Commit Message

范开喜 Sept. 29, 2020, 12:50 a.m. UTC
From: fankaixi <fankaixi.li@bytedance.com>

Add testcase for setting ipv6 nd "nd_reserved" and "nd_options_type"
fields.

Signed-off-by: fankaixi.li <fankaixi.li@bytedance.com>
CC: Flavio Leitner <fbl@sysclose.org>
Fixes: d0d571493cf8 ("ofproto-dpif: Allow IPv6 ND Extensions only if supported")
---
 tests/ofproto-dpif.at | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

范开喜 Oct. 9, 2020, 10:28 a.m. UTC | #1
Hi, is there update on this matter ?

于2020年09月29日星期二 09:05 <fankaixi.li@bytedance.com> 写道:

From: fankaixi Add testcase for setting ipv6 nd "nd_reserved" and
"nd_options_type" fields. Signed-off-by: fankaixi.li CC: Flavio Leitner
Fixes: d0d571493cf8 ("ofproto-dpif: Allow IPv6 ND Extensions only if
supported") --- tests/ofproto-dpif.at | 18 ++++++++++++++++++ 1 file
changed, 18 insertions(+) diff --git a/tests/ofproto-dpif.at b/tests/
ofproto-dpif.at index d63ef237a..d6908223f 100644 --- a/tests/
ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -551,6 +551,24 @@ This flow
is handled by the userspace slow path because it: OVS_VSWITCHD_STOP
AT_CLEANUP +AT_SETUP([ofproto-dpif - modify IPv6 Neighbor Solitication (ND)
Reserved and Options Type fields]) +OVS_VSWITCHD_START +add_of_ports br0 1
2 +AT_DATA([flows.txt], [dnl +table=0
priority=50,icmp6,icmpv6_type=135,icmpv6_code=0,nd_target=2001:db8:0:2:0:0:0:1,nd_sll=fa:16:3e:55:ad:df
actions=set_field:136->icmpv6_type,set_field:0->icmpv6_code,set_field:2->nd_options_type,goto_table(1)
+table=1
priority=80,icmp6,icmpv6_type=136,icmpv6_code=0,nd_target=2001:db8:0:2:0:0:0:1,actions=
move:eth_src[]->eth_dst[],set_field:00:23:15:d3:22:01->eth_src,move:ipv6_src[]->ipv6_dst[],set_field:2001:db8:0:2:0:0:0:1->ipv6_src,set_field:00:23:15:d3:22:01->nd_tll,set_field:0xe00->nd_reserved,set_field:2->nd_options_type,output(2)
+]) +AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt], [0],
[stdout]) +AT_CHECK([ovs-appctl ofproto/trace br0
'in_port=1,dl_src=fa:16:3e:55:ad:df,dl_dst=ff:ff:ff:ff:ff:ff,icmp6,ipv6_src=fe80::1,ipv6_dst=2001:db8:0:2:0:0:0:2,nw_tos=0,nw_ttl=128,icmpv6_type=135,nd_target=2001:db8:0:2:0:0:0:1,nd_sll=fa:16:3e:55:ad:df'],
[0], [stdout]) +AT_CHECK([tail -4 stdout], [0], + [Megaflow:
recirc_id=0,eth,icmp6,in_port=1,dl_src=fa:16:3e:55:ad:df,dl_dst=ff:ff:ff:ff:ff:ff,ipv6_src=fe80::1,ipv6_dst=2001:db8:0:2::2,nw_frag=no,icmp_type=0x87/0xff,icmp_code=0x0/0xff,nd_target=2001:db8:0:2::1,nd_sll=fa:16:3e:55:ad:df,nd_tll=00:00:00:00:00:00,nd_reserved=0,nd_options_type=0x0/0xff
+Datapath actions:
set(eth(src=00:23:15:d3:22:01,dst=fa:16:3e:55:ad:df)),set(ipv6(src=2001:db8:0:2::1,dst=fe80::1)),set(nd_ext(nd_reserved=0xe00,nd_options_type=2)),set(nd(tll=00:23:15:d3:22:01)),set(icmpv6(type=136,code=0)),2
+This flow is handled by the userspace slow path because it: + - Uses
action(s) not supported by datapath. +]) +OVS_VSWITCHD_STOP +AT_CLEANUP +
AT_SETUP([ofproto-dpif - clear actions]) OVS_VSWITCHD_START add_of_ports
br0 1 10 11 12 -- 2.11.0
diff mbox series

Patch

diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index d63ef237a..d6908223f 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -551,6 +551,24 @@  This flow is handled by the userspace slow path because it:
 OVS_VSWITCHD_STOP
 AT_CLEANUP
 
+AT_SETUP([ofproto-dpif - modify IPv6 Neighbor Solitication (ND) Reserved and Options Type fields])
+OVS_VSWITCHD_START
+add_of_ports br0 1 2
+AT_DATA([flows.txt], [dnl
+table=0 priority=50,icmp6,icmpv6_type=135,icmpv6_code=0,nd_target=2001:db8:0:2:0:0:0:1,nd_sll=fa:16:3e:55:ad:df actions=set_field:136->icmpv6_type,set_field:0->icmpv6_code,set_field:2->nd_options_type,goto_table(1)
+table=1 priority=80,icmp6,icmpv6_type=136,icmpv6_code=0,nd_target=2001:db8:0:2:0:0:0:1,actions= move:eth_src[]->eth_dst[],set_field:00:23:15:d3:22:01->eth_src,move:ipv6_src[]->ipv6_dst[],set_field:2001:db8:0:2:0:0:0:1->ipv6_src,set_field:00:23:15:d3:22:01->nd_tll,set_field:0xe00->nd_reserved,set_field:2->nd_options_type,output(2)
+])
+AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt], [0], [stdout])
+AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=fa:16:3e:55:ad:df,dl_dst=ff:ff:ff:ff:ff:ff,icmp6,ipv6_src=fe80::1,ipv6_dst=2001:db8:0:2:0:0:0:2,nw_tos=0,nw_ttl=128,icmpv6_type=135,nd_target=2001:db8:0:2:0:0:0:1,nd_sll=fa:16:3e:55:ad:df'], [0], [stdout])
+AT_CHECK([tail -4 stdout], [0],
+  [Megaflow: recirc_id=0,eth,icmp6,in_port=1,dl_src=fa:16:3e:55:ad:df,dl_dst=ff:ff:ff:ff:ff:ff,ipv6_src=fe80::1,ipv6_dst=2001:db8:0:2::2,nw_frag=no,icmp_type=0x87/0xff,icmp_code=0x0/0xff,nd_target=2001:db8:0:2::1,nd_sll=fa:16:3e:55:ad:df,nd_tll=00:00:00:00:00:00,nd_reserved=0,nd_options_type=0x0/0xff
+Datapath actions: set(eth(src=00:23:15:d3:22:01,dst=fa:16:3e:55:ad:df)),set(ipv6(src=2001:db8:0:2::1,dst=fe80::1)),set(nd_ext(nd_reserved=0xe00,nd_options_type=2)),set(nd(tll=00:23:15:d3:22:01)),set(icmpv6(type=136,code=0)),2
+This flow is handled by the userspace slow path because it:
+  - Uses action(s) not supported by datapath.
+])
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
 AT_SETUP([ofproto-dpif - clear actions])
 OVS_VSWITCHD_START
 add_of_ports br0 1 10 11 12