summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorYi-Hung Wei <yihung.wei@gmail.com>2017-05-15 10:04:57 -0700
committerBen Pfaff <blp@ovn.org>2017-05-31 14:54:10 -0700
commitd7892c814a8a9cf5681d34c6470bc9d841f4ad21 (patch)
tree3f0a70672a3781b56f3b6f8ae7e41178d4721c94 /ofproto
parent577bfa9f687936d53970d0ff41928c3a727720e8 (diff)
downloadopenvswitch-d7892c814a8a9cf5681d34c6470bc9d841f4ad21.tar.gz
ofproto: Add pipeline fields support for OF 1.5 packet-out
This patch decodes pipeline fields from a packet-out message, and populates the pipeline fields into datapath. Error OFPERR_OFPBRC_PIPELINE_FIELDS_ONLY is returned if the match field of a packet-out messages contains any non pipeline fields. Currently, the supported pipeline fields are as following. * metadata fields: - in_port, in_port_oxm * tunnel fields: - tun_id, tun_src, tun_dst, tun_ipv6_src, tun_ipv6_dst - tun_gbp_id, tun_gpb_flags, tun_flags - tun_metadata0 - tun_metadata63 * register fields: - metadata - reg0 - reg-15, xreg0 - xreg7, xxreg0 - xxreg3 Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 1bf4c8213..14985e623 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -3458,6 +3458,10 @@ ofproto_packet_out_init(struct ofproto *ofproto,
{
enum ofperr error;
struct match match;
+ struct {
+ struct miniflow mf;
+ uint64_t buf[FLOW_U64S];
+ } m;
uint16_t in_port = ofp_to_u16(po->flow_metadata.flow.in_port.ofp_port);
if (in_port >= ofproto->max_ports && in_port < ofp_to_u16(OFPP_MAX)) {
@@ -3474,8 +3478,9 @@ ofproto_packet_out_init(struct ofproto *ofproto,
po->packet_len, 2);
/* Store struct flow. */
opo->flow = xmalloc(sizeof *opo->flow);
- flow_extract(opo->packet, opo->flow);
- opo->flow->in_port.ofp_port = po->flow_metadata.flow.in_port.ofp_port;
+ *opo->flow = po->flow_metadata.flow;
+ miniflow_extract(opo->packet, &m.mf);
+ flow_union_with_miniflow(opo->flow, &m.mf);
/* Check actions like for flow mods. We pass a 'table_id' of 0 to
* ofproto_check_consistency(), which isn't strictly correct because these