From 4f5decf4ab3fd23a68116a7cb2052d209f08bf56 Mon Sep 17 00:00:00 2001 From: Eelco Chaudron Date: Tue, 26 Jul 2022 11:40:27 +0200 Subject: ofproto-dpif-xlate: Optimize datapath action set by removing last clone action. When OFPROTO non-reversible actions are translated to data plane actions, the only thing looked at is if there are more actions pending. If this is the case, the action is encapsulated in a clone(). This could lead to unnecessary clones if no meaningful data plane actions are added. For example, the register pop in the included test case. The best solution would probably be to build the full action path and determine if the clone is needed. However, this would be a huge change in the existing design, so for now, we just try to optimize the generated datapath flow. We can revisit this later, as some of the pending CT issues might need this rework. Fixes: feee58b9587f ("ofproto-dpif-xlate: Keep track of the last action") Fixes: dadd8357f224 ("ofproto-dpif: Fix issue with non-reversible actions on a patch ports.") Acked-by: Ales Musil Signed-off-by: Eelco Chaudron Signed-off-by: Ilya Maximets --- tests/tunnel-push-pop.at | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/tunnel-push-pop.at') diff --git a/tests/tunnel-push-pop.at b/tests/tunnel-push-pop.at index 2c6c52eda..bc82abc1f 100644 --- a/tests/tunnel-push-pop.at +++ b/tests/tunnel-push-pop.at @@ -906,11 +906,11 @@ AT_CHECK([ovs-appctl ofproto/trace ovs-tun0 in_port=p7], [0], [stdout]) AT_CHECK([tail -2 stdout], [0], [dnl Megaflow: recirc_id=0,eth,in_port=7,dl_src=00:00:00:00:00:00,dnl dl_dst=00:00:00:00:00:00,dl_type=0x0000 -Datapath actions: push_vlan(vid=200,pcp=0),1,clone(tnl_push(tnl_port(4789),dnl +Datapath actions: push_vlan(vid=200,pcp=0),1,tnl_push(tnl_port(4789),dnl header(size=50,type=4,eth(dst=aa:55:aa:66:00:00,src=aa:55:aa:55:00:00,dnl dl_type=0x0800),ipv4(src=10.0.0.2,dst=10.0.0.11,proto=17,tos=0,ttl=64,dnl frag=0x4000),udp(src=0,dst=4789,csum=0x0),vxlan(flags=0x8000000,vni=0x0)),dnl -out_port(100)),8) +out_port(100)),8 ]) OVS_VSWITCHD_STOP -- cgit v1.2.1