From 5c0243a9db5cdb2a2751caa834534687730c6141 Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Thu, 21 Mar 2013 11:17:00 -0700 Subject: [PATCH] ofproto-dpif: xlate actions once with subfacets. Before this patch, when ofproto-dpif decided that a particular flow miss needed a facet, it would do action translation multiple times. Once in subfacet_make_actions(), and once per packet in subfacet_update_stats(). In the common case (once per miss), this would double the amount of work required in xlate_actions(). The call to facet_push_stats() in subfacet_update_stats() is unnecessary. If the packets are simply accounted to the facet, they will eventually be pushed to the relevant rules in update_stats() or when the facet is removed. Removing the unnecessary step gives us a 20% improvement of the netperf TCP_CRR benchmark with the complex flow tables installed by our controller. Signed-off-by: Ethan Jackson --- ofproto/ofproto-dpif.c | 1 - tests/ofproto-dpif.at | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 6e9023a10..18c5b7dea 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -5269,7 +5269,6 @@ subfacet_update_stats(struct subfacet *subfacet, facet->packet_count += stats->n_packets; facet->byte_count += stats->n_bytes; facet->tcp_flags |= stats->tcp_flags; - facet_push_stats(facet); netflow_flow_update_flags(&facet->nf_flow, stats->tcp_flags); } } diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at index 354fdc91f..f390f2924 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -608,6 +608,7 @@ NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1 ]) +AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl cookie=0x1, n_packets=2, n_bytes=120, dl_src=20:22:22:22:22:22 actions=CONTROLLER:65535,resubmit(80,1) cookie=0x2, n_packets=3, n_bytes=180, dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,CONTROLLER:65535 -- 2.43.0