From patchwork Fri Jan 12 20:44:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 860192 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zJF9z1XHqz9sQm for ; Sat, 13 Jan 2018 07:45:10 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 3ADE3EB4; Fri, 12 Jan 2018 20:45:08 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 0FE4DE20 for ; Fri, 12 Jan 2018 20:45:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 582C5163 for ; Fri, 12 Jan 2018 20:45:06 +0000 (UTC) X-Originating-IP: 208.91.3.26 Received: from sigabrt.benpfaff.org (unknown [208.91.3.26]) (Authenticated sender: blp@ovn.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id E37B81720A5; Fri, 12 Jan 2018 21:45:02 +0100 (CET) From: Ben Pfaff To: dev@openvswitch.org Date: Fri, 12 Jan 2018 12:44:59 -0800 Message-Id: <20180112204459.2311-1-blp@ovn.org> X-Mailer: git-send-email 2.10.2 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff , Eric Garver Subject: [ovs-dev] [PATCH] dpif-netlink-rtnl: Work around MTU bug in kernel GRE driver. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org 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 Reported-by: James Page Signed-off-by: Ben Pfaff Acked-by: Eric Garver --- This is not properly tested. It needs to be tested before it makes sense to commit it. lib/dpif-netlink-rtnl.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/dpif-netlink-rtnl.c b/lib/dpif-netlink-rtnl.c index fe9c8ed7104f..0bf965d29f41 100644 --- a/lib/dpif-netlink-rtnl.c +++ b/lib/dpif-netlink-rtnl.c @@ -329,6 +329,19 @@ 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, UINT16_MAX); + + err = nl_transact(NETLINK_ROUTE, &request, NULL); + } exit: ofpbuf_uninit(&request);