#include "ofpbuf.h"
#include "openflow/openflow.h"
#include "packets.h"
+#include "odp-util.h"
#include "random.h"
#include "unaligned.h"
}
-/* Initializes 'flow' members from 'packet', 'skb_priority', 'tnl', and
- * 'in_port'.
+/* Initializes 'flow' members from 'packet' and 'md'
*
* Initializes 'packet' header pointers as follows:
*
* present and has a correct length, and otherwise NULL.
*/
void
-flow_extract(struct ofpbuf *packet, uint32_t skb_priority, uint32_t pkt_mark,
- const struct flow_tnl *tnl, const union flow_in_port *in_port,
+flow_extract(struct ofpbuf *packet, const struct pkt_metadata *md,
struct flow *flow)
{
struct ofpbuf b = *packet;
memset(flow, 0, sizeof *flow);
- if (tnl) {
- ovs_assert(tnl != &flow->tunnel);
- flow->tunnel = *tnl;
- }
- if (in_port) {
- flow->in_port = *in_port;
+ if (md) {
+ flow->tunnel = md->tunnel;
+ if (md->in_port.odp_port != ODPP_NONE) {
+ flow->in_port = md->in_port;
+ };
+ flow->skb_priority = md->skb_priority;
+ flow->pkt_mark = md->pkt_mark;
}
- flow->skb_priority = skb_priority;
- flow->pkt_mark = pkt_mark;
packet->l2 = b.data;
packet->l2_5 = NULL;
* If the new label is the second or label MPLS label in 'flow', it is
* generated as;
*
- * - label: 0.
+ * - label: Copied from outer label.
*
* - TTL: Copied from outer label.
*
flow->mpls_lse[i] = flow->mpls_lse[i - 1];
}
flow->mpls_lse[0] = (flow->mpls_lse[1]
- & htonl(MPLS_TTL_MASK | MPLS_TC_MASK));
+ & htonl(~MPLS_BOS_MASK));
} else {
int label = 0; /* IPv4 Explicit Null. */
int tc = 0;