[ovs-dev] [CudaMailTagged] [RFC PATCH 03/14] Add NSH keys as match fields for user space flow table

Li, Johnson johnson.li at intel.com
Mon Jun 20 02:11:59 UTC 2016


> Regards
> _Sugesh
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces at openvswitch.org] On Behalf Of Johnson Li
> > Sent: Tuesday, June 7, 2016 7:10 PM
> > To: dev at openvswitch.org
> > Subject: [ovs-dev] [CudaMailTagged] [RFC PATCH 03/14] Add NSH keys as
> > match fields for user space flow table
> > Importance: Low
> >
> > Add NSH keys (Metadata type I only) as part of match fields for the
> > user space flow table.
> >
> > Signed-off-by: Johnson Li <johnson.li at intel.com>
> >
> > diff --git a/include/openvswitch/flow.h b/include/openvswitch/flow.h
> > index
> > 03d406b..5f3cd39 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) + 240
> >                    && 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;
> > +};
> [Sugesh] I am not sure this is generic enough to support all the NSH header
> types. This will work fine to configure MD1 type NSH , how can this extend
> for MD2?
> Or next version of NSH? Is it possible to define this flow to cover all those
> under one NSH umberalla?
[JL]: I was trying to define the structure for MD type 1 only. For MD type 2,
We will try to reuse the fields tun_metadata[0...63] based on Mengke's 
Discussion with Jesse through the "eth + nsh" is not tunneling packets. 
Here is the link for the discussion:
http://comments.gmane.org/gmane.network.openvswitch.devel/53788
I will try to draw one mail to introduce how we are planning to support
MD type and "eth + nsh" encapsulation based on the current comments
From community. 
> > +
> > +/* 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
> >
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> > http://openvswitch.org/mailman/listinfo/dev


More information about the dev mailing list