On Fri, May 18, 2018 at 5:49 PM, Greg Rose <[email protected]> wrote: > From: William Tu <[email protected]> > > The patch adds support for gre sequence number. > Default is disable. When enable with 'options:seq=true', > the outgoing gre packet will have its sequence number > incremented by one. > > Signed-off-by: William Tu <[email protected]> > --- > lib/netdev-native-tnl.c | 19 ++++++++++++++++++- > lib/netdev-vport.c | 11 ++++++++++- > lib/netdev.h | 3 +++ > tests/tunnel-push-pop.at | 8 ++++---- > vswitchd/vswitch.xml | 7 +++++++ > 5 files changed, 42 insertions(+), 6 deletions(-) > > diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c > index 5eb3d22..876718a 100644 > --- a/lib/netdev-native-tnl.c > +++ b/lib/netdev-native-tnl.c > @@ -436,10 +436,12 @@ err: > } > > void > -netdev_gre_push_header(const struct netdev *netdev OVS_UNUSED, > +netdev_gre_push_header(const struct netdev *netdev, > struct dp_packet *packet, > const struct ovs_action_push_tnl *data) > { > + struct netdev_vport *dev = netdev_vport_cast(netdev); > + struct netdev_tunnel_config *tnl_cfg; > struct gre_base_hdr *greh; > int ip_tot_size; > > @@ -449,6 +451,15 @@ netdev_gre_push_header(const struct netdev *netdev > OVS_UNUSED, > ovs_be16 *csum_opt = (ovs_be16 *) (greh + 1); > *csum_opt = csum(greh, ip_tot_size); > } > + > + if (greh->flags & htons(GRE_SEQ)) { > + /* Last 4 byte is GRE seqno */ > + int seq_ofs = gre_header_len(greh->flags) - 4; > + ovs_16aligned_be32 *seq_opt = > + ALIGNED_CAST(ovs_16aligned_be32 *, (char *)greh + seq_ofs);
Thanks for fixing the alignment issues for me. Regards, William _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
