diff options
author | Daniele Di Proietto <diproiettod@vmware.com> | 2016-05-17 18:26:02 -0700 |
---|---|---|
committer | Daniele Di Proietto <diproiettod@vmware.com> | 2016-05-20 11:08:15 -0700 |
commit | 1cceb31bc14a15b04bfea3bc36424f8eefb9033a (patch) | |
tree | fd3a144c250684acd37ec94e5d0d4eb64c1dbe6d /ofproto | |
parent | 362ad4ba31098391b0f582db70f5afeb3a7cfdee (diff) | |
download | openvswitch-1cceb31bc14a15b04bfea3bc36424f8eefb9033a.tar.gz |
dpif: Pass flow parameter to dpif_execute().
All the callers of the function already have a copy of the extracted
flow in their stack (or a few frames before).
This is useful for different resons:
* It forces the callers to also call flow_extract() on the packet, which
is necessary to initialize the l2,l3,l4 pointers.
* It will be used in the userspace datapath to generate the RSS hash by
a following commit
* It can be used by the userspace connection tracker to avoid extracting
the l3 type again.
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto')
-rw-r--r-- | ofproto/ofproto-dpif-upcall.c | 1 | ||||
-rw-r--r-- | ofproto/ofproto-dpif.c | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index 56f88c7f7..555c5b496 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -1338,6 +1338,7 @@ handle_upcalls(struct udpif *udpif, struct upcall *upcalls, op->ukey = NULL; op->dop.type = DPIF_OP_EXECUTE; op->dop.u.execute.packet = CONST_CAST(struct dp_packet *, packet); + op->dop.u.execute.flow = upcall->flow; odp_key_to_pkt_metadata(upcall->key, upcall->key_len, &op->dop.u.execute.packet->md); op->dop.u.execute.actions = upcall->odp_actions.data; diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 219933ef2..3bd26ac7d 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -1061,6 +1061,7 @@ check_variable_length_userdata(struct dpif_backer *backer) struct ofpbuf actions; struct dpif_execute execute; struct dp_packet packet; + struct flow flow; size_t start; int error; @@ -1083,11 +1084,14 @@ check_variable_length_userdata(struct dpif_backer *backer) eth = dp_packet_put_zeros(&packet, ETH_HEADER_LEN); eth->eth_type = htons(0x1234); + flow_extract(&packet, &flow); + /* Execute the actions. On older datapaths this fails with ERANGE, on * newer datapaths it succeeds. */ execute.actions = actions.data; execute.actions_len = actions.size; execute.packet = &packet; + execute.flow = &flow; execute.needs_help = false; execute.probe = true; execute.mtu = 0; @@ -1164,6 +1168,7 @@ check_masked_set_action(struct dpif_backer *backer) struct ofpbuf actions; struct dpif_execute execute; struct dp_packet packet; + struct flow flow; int error; struct ovs_key_ethernet key, mask; @@ -1182,11 +1187,14 @@ check_masked_set_action(struct dpif_backer *backer) eth = dp_packet_put_zeros(&packet, ETH_HEADER_LEN); eth->eth_type = htons(0x1234); + flow_extract(&packet, &flow); + /* Execute the actions. On older datapaths this fails with EINVAL, on * newer datapaths it succeeds. */ execute.actions = actions.data; execute.actions_len = actions.size; execute.packet = &packet; + execute.flow = &flow; execute.needs_help = false; execute.probe = true; execute.mtu = 0; @@ -3708,6 +3716,7 @@ ofproto_dpif_execute_actions__(struct ofproto_dpif *ofproto, pkt_metadata_from_flow(&packet->md, flow); execute.packet = packet; + execute.flow = flow; execute.needs_help = (xout.slow & SLOW_ACTION) != 0; execute.probe = false; execute.mtu = 0; @@ -4420,6 +4429,7 @@ nxt_resume(struct ofproto *ofproto_, .actions_len = odp_actions.size, .needs_help = (slow & SLOW_ACTION) != 0, .packet = &packet, + .flow = &headers, }; dpif_execute(ofproto->backer->dpif, &execute); |