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...@intel.com> diff --git a/include/openvswitch/flow.h b/include/openvswitch/flow.h index 03d406b..4fcc6f6 100644 --- a/include/openvswitch/flow.h +++ b/include/openvswitch/flow.h @@ -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 diff --git a/include/openvswitch/packets.h b/include/openvswitch/packets.h index 5d97309..4c7ec31 100644 --- a/include/openvswitch/packets.h +++ b/include/openvswitch/packets.h @@ -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 */ -- 1.8.4.2 -------------------------------------------------------------- Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev