diff options
Diffstat (limited to 'ofproto')
-rw-r--r-- | ofproto/ofproto-dpif-xlate.c | 10 | ||||
-rw-r--r-- | ofproto/ofproto-dpif-xlate.h | 4 | ||||
-rw-r--r-- | ofproto/ofproto-dpif.c | 13 |
3 files changed, 20 insertions, 7 deletions
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 507e14dd0..d0e7c6b9f 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -7464,19 +7464,21 @@ enum ofperr xlate_resume(struct ofproto_dpif *ofproto, const struct ofputil_packet_in_private *pin, struct ofpbuf *odp_actions, - enum slow_path_reason *slow) + enum slow_path_reason *slow, + struct flow *flow, + struct xlate_cache *xcache) { struct dp_packet packet; dp_packet_use_const(&packet, pin->base.packet, pin->base.packet_len); - struct flow flow; - flow_extract(&packet, &flow); + flow_extract(&packet, flow); struct xlate_in xin; xlate_in_init(&xin, ofproto, ofproto_dpif_get_tables_version(ofproto), - &flow, 0, NULL, ntohs(flow.tcp_flags), + flow, 0, NULL, ntohs(flow->tcp_flags), &packet, NULL, odp_actions); + xin.xcache = xcache; struct ofpact_note noop; ofpact_init_NOTE(&noop); diff --git a/ofproto/ofproto-dpif-xlate.h b/ofproto/ofproto-dpif-xlate.h index 2cbb3c909..0a5a52887 100644 --- a/ofproto/ofproto-dpif-xlate.h +++ b/ofproto/ofproto-dpif-xlate.h @@ -230,8 +230,8 @@ void xlate_out_uninit(struct xlate_out *); enum ofperr xlate_resume(struct ofproto_dpif *, const struct ofputil_packet_in_private *, - struct ofpbuf *odp_actions, enum slow_path_reason *); - + struct ofpbuf *odp_actions, enum slow_path_reason *, + struct flow *, struct xlate_cache *); int xlate_send_packet(const struct ofport_dpif *, bool oam, struct dp_packet *); void xlate_mac_learning_update(const struct ofproto_dpif *ofproto, diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 0a0c69a7a..5ccf23955 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -5051,18 +5051,29 @@ nxt_resume(struct ofproto *ofproto_, const struct ofputil_packet_in_private *pin) { struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_); + struct dpif_flow_stats stats; + struct xlate_cache xcache; + struct flow flow; + xlate_cache_init(&xcache); /* Translate pin into datapath actions. */ uint64_t odp_actions_stub[1024 / 8]; struct ofpbuf odp_actions = OFPBUF_STUB_INITIALIZER(odp_actions_stub); enum slow_path_reason slow; - enum ofperr error = xlate_resume(ofproto, pin, &odp_actions, &slow); + enum ofperr error = xlate_resume(ofproto, pin, &odp_actions, &slow, + &flow, &xcache); /* Steal 'pin->packet' and put it into a dp_packet. */ struct dp_packet packet; dp_packet_init(&packet, pin->base.packet_len); dp_packet_put(&packet, pin->base.packet, pin->base.packet_len); + /* Run the side effects from the xcache. */ + dpif_flow_stats_extract(&flow, &packet, time_msec(), &stats); + ovs_mutex_lock(&ofproto_mutex); + ofproto_dpif_xcache_execute(ofproto, &xcache, &stats); + ovs_mutex_unlock(&ofproto_mutex); + pkt_metadata_from_flow(&packet.md, &pin->base.flow_metadata.flow); /* Fix up in_port. */ |