[ovs-dev] [PATCH v3 2/2] dpif-netlink-rtnl: Work around MTU bug in kernel GRE driver.

Ben Pfaff blp at ovn.org
Thu Jan 18 22:55:07 UTC 2018


On Thu, Jan 18, 2018 at 08:45:54AM -0500, Eric Garver wrote:
> On Wed, Jan 17, 2018 at 10:02:25AM -0800, Ben Pfaff wrote:
> > The kernel GRE driver ignores IFLA_MTU in RTM_NEWLINK requests and
> > overrides the MTU to 1472 bytes.  This commit works around the problem by
> > following up a request to create a GRE device with a second request to set
> > the MTU.
> > 
> > Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1488484
> > Reported-by: Eric Garver <e at erig.me>
> > Reported-by: James Page <james.page at ubuntu.com>
> > Signed-off-by: Ben Pfaff <blp at ovn.org>
> > ---
> >  lib/dpif-netlink-rtnl.c | 19 +++++++++++++++++++
> >  1 file changed, 19 insertions(+)
> > 
> > diff --git a/lib/dpif-netlink-rtnl.c b/lib/dpif-netlink-rtnl.c
> > index 37451b80de0e..40c456951827 100644
> > --- a/lib/dpif-netlink-rtnl.c
> > +++ b/lib/dpif-netlink-rtnl.c
> > @@ -338,6 +338,25 @@ dpif_netlink_rtnl_create(const struct netdev_tunnel_config *tnl_cfg,
> >      nl_msg_end_nested(&request, linkinfo_off);
> >  
> >      err = nl_transact(NETLINK_ROUTE, &request, NULL);
> > +    if (!err && type == OVS_VPORT_TYPE_GRE) {
> > +        /* Work around a bug in kernel GRE driver, which ignores IFLA_MTU in
> > +         * RTM_NEWLINK, by setting the MTU again.  See
> > +         * https://bugzilla.redhat.com/show_bug.cgi?id=1488484. */
> > +        ofpbuf_clear(&request);
> > +        nl_msg_put_nlmsghdr(&request, 0, RTM_SETLINK,
> > +                            NLM_F_REQUEST | NLM_F_ACK);
> > +        ofpbuf_put_zeros(&request, sizeof(struct ifinfomsg));
> > +        nl_msg_put_string(&request, IFLA_IFNAME, name);
> > +        nl_msg_put_u32(&request, IFLA_MTU, MAX_MTU);
> > +
> > +        int err2 = nl_transact(NETLINK_ROUTE, &request, NULL);
> > +        if (err2) {
> > +            static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
> > +
> > +            VLOG_WARN_RL(&rl, "setting MTU of tunnel %s failed (%s)",
> > +                         name, ovs_strerror(err2));
> > +        }
> > +    }
> >  
> >  exit:
> >      ofpbuf_uninit(&request);
> > -- 
> > 2.10.2
> >
> 
> Looks good. Thank Ben and James!
> I just wanted to note that the above workaround also applies to GRE with
> the "layer3" flag, but I don't think that was tested/verified by James.
> 
> Acked-by: Eric Garver <e at erig.me>

Thanks for the reviews.  I applied these patches to master.


More information about the dev mailing list