@@ -100,6 +100,9 @@ struct flow {
ovs_be16 vlan_tci; /* If 802.1Q, TCI | VLAN_CFI; otherwise 0. */
ovs_be32 mpls_lse[ROUND_UP(FLOW_MAX_MPLS_LABELS, 2)]; /* MPLS label stack
(with padding). */
+ /* Network Service Header */
+ struct flow_nsh nsh;
+
/* L3 (64-bit aligned) */
ovs_be32 nw_src; /* IPv4 source address. */
ovs_be32 nw_dst; /* IPv4 destination address. */
@@ -129,7 +132,7 @@ BUILD_ASSERT_DECL(sizeof(struct flow_tnl) % sizeof(uint64_t) == 0);
/* Remember to update FLOW_WC_SEQ when changing 'struct flow'. */
BUILD_ASSERT_DECL(offsetof(struct flow, igmp_group_ip4) + sizeof(uint32_t)
- == sizeof(struct flow_tnl) + 216
+ == sizeof(struct flow_tnl) + sizeof (struct flow_nsh) + 216
&& FLOW_WC_SEQ == 35);
/* Incremental points at which flow classification may be performed in
@@ -61,4 +61,23 @@ union flow_in_port {
ofp_port_t ofp_port;
};
+/* Network Service Header For flow and Metadata */
+struct flow_nsh {
+ uint8_t flags;
+ uint8_t md_type;
+ uint8_t next_proto;
+ uint8_t nsi;
+ ovs_be32 nsp;
+ ovs_be32 nshc1;
+ ovs_be32 nshc2;
+ ovs_be32 nshc3;
+ ovs_be32 nshc4;
+};
+
+/* NSH flags */
+#define FLOW_NSH_F_OAM (1 << 0)
+#define FLOW_NSH_F_CTX (1 << 1)
+
+#define FLOW_NSH_F_MASK ((1 << 2) - 1)
+
#endif /* packets.h */
Add NSH keys (Metadata type I only, MD type II will reuse the the fields definition tun_metadataN) as part of match fields for the user space flow table. Signed-off-by: Johnson Li <johnson.li@intel.com>