[ovs-dev] [PATCH] dpif-netlink-rtnl: Retry a smaller MTU for netdev when MAX_MTU is too large.

Ben Pfaff blp at ovn.org
Fri Jul 6 20:17:39 UTC 2018


On Thu, Jul 05, 2018 at 11:55:46AM -0700, Yifeng Sun wrote:
> When MAX_MTU is larger than hw supported max MTU,
> dpif_netlink_rtnl_create will fail. This leads to
> testing failure '11: datapath - ping over gre tunnel'
> in 'make check-kmod'.
> 
> This patch fixes this issue by retrying a smaller MTU
> when MAX_MTU is too large.
> 
> Signed-off-by: Yifeng Sun <pkusunyifeng at gmail.com>

...

> -        int err2 = nl_transact(NETLINK_ROUTE, &request, NULL);
> +         * https://bugzilla.redhat.com/show_bug.cgi?id=1488484.
> +         *
> +         * In case of MAX_MTU exceeds hw max MTU, retry a smaller value. */
> +        int err2 = rtnl_set_mtu(name, MAX_MTU, &request) &&
> +                   rtnl_set_mtu(name, 1450, &request);

Probably, this should be more like:

        int err2 = rtnl_set_mtu(name, MAX_MTU, &request);
        if (err2) {
            err2 = rtnl_set_mtu(name, 1450, &request);
        }

because if you use && then the result is 0 or 1, not 0 or an errno
value.

Thanks,

Ben.


More information about the dev mailing list