X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=ofproto%2Fofproto-dpif.c;h=b963ff2017822ec9d848c3bb0981f5a56a0db31b;hb=77ab5fd2a95ba2fef5bbe25aaa429776b9e29ea3;hp=826e6e657b5f78e65d2eba1afa5a7875ab52b71d;hpb=5d10476a12dd3df756e15c9bcae0061bef787379;p=cascardo%2Fovs.git diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 826e6e657..b963ff201 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -4425,6 +4425,39 @@ packet_out(struct ofproto *ofproto_, struct dp_packet *packet, ofpacts_len, packet); return 0; } + +static enum ofperr +nxt_resume(struct ofproto *ofproto_, + const struct ofputil_packet_in_private *pin) +{ + struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_); + + /* 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); + + /* Steal 'pin->packet' and put it into a dp_packet. */ + struct dp_packet packet; + dp_packet_init(&packet, pin->public.packet_len); + dp_packet_put(&packet, pin->public.packet, pin->public.packet_len); + + /* Execute the datapath actions on the packet. */ + struct dpif_execute execute = { + .actions = odp_actions.data, + .actions_len = odp_actions.size, + .needs_help = (slow & SLOW_ACTION) != 0, + .packet = &packet, + }; + dpif_execute(ofproto->backer->dpif, &execute); + + /* Clean up. */ + ofpbuf_uninit(&odp_actions); + dp_packet_uninit(&packet); + + return error; +} /* NetFlow. */ @@ -5772,6 +5805,7 @@ const struct ofproto_class ofproto_dpif_class = { rule_execute, set_frag_handling, packet_out, + nxt_resume, set_netflow, get_netflow_ids, set_sflow,