From patchwork Thu May 17 11:27:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Alvares Gomes X-Patchwork-Id: 915351 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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 40mpvP6VYBz9s3B for ; Thu, 17 May 2018 21:28:01 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id EC92BD96; Thu, 17 May 2018 11:27:58 +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 9DC44D85 for ; Thu, 17 May 2018 11:27:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 423CD196 for ; Thu, 17 May 2018 11:27:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 58759401EF11; Thu, 17 May 2018 11:27:56 +0000 (UTC) Received: from lucas-t460s.redhat.com (ovpn-117-241.ams2.redhat.com [10.36.117.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8077710E51C2; Thu, 17 May 2018 11:27:55 +0000 (UTC) From: lucasagomes@gmail.com To: dev@openvswitch.org Date: Thu, 17 May 2018 12:27:50 +0100 Message-Id: <20180517112750.10424-1-lucasagomes@gmail.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 17 May 2018 11:27:56 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 17 May 2018 11:27:56 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lucasagomes@gmail.com' RCPT:'' X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] datapath: RHEL 7.5 ndo_change_mtu backward compatibility 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 From: Lucas Alvares Gomes The commit [0] partially fixed the problem but in RHEL 7.5 neither .{min, max}_mtu or 'ndo_change_mtu' were being set/implemented for vport-internal_dev.c. As pointed out by commit [0], the ndo_change_mtu function pointer has been moved from 'struct net_device_ops' to 'struct net_device_ops_extended' on RHEL 7.5. So this patch fixes the backport issue by setting the .extended.ndo_change_mtu when necessary. [0] 39ca338374abe367e28a2247bac9159695f19710 Signed-off-by: Lucas Alvares Gomes Acked-by: Daniel Alvarez Tested-by: Daniel Alvarez --- datapath/vport-internal_dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c index 3cb8d06b2..16f4aaeee 100644 --- a/datapath/vport-internal_dev.c +++ b/datapath/vport-internal_dev.c @@ -88,7 +88,7 @@ static const struct ethtool_ops internal_dev_ethtool_ops = { .get_link = ethtool_op_get_link, }; -#if !defined(HAVE_NET_DEVICE_WITH_MAX_MTU) && !defined(HAVE_RHEL7_MAX_MTU) +#ifndef HAVE_NET_DEVICE_WITH_MAX_MTU static int internal_dev_change_mtu(struct net_device *dev, int new_mtu) { if (new_mtu < ETH_MIN_MTU) { @@ -155,6 +155,8 @@ static const struct net_device_ops internal_dev_netdev_ops = { .ndo_set_mac_address = eth_mac_addr, #if !defined(HAVE_NET_DEVICE_WITH_MAX_MTU) && !defined(HAVE_RHEL7_MAX_MTU) .ndo_change_mtu = internal_dev_change_mtu, +#elif !defined(HAVE_NET_DEVICE_WITH_MAX_MTU) && defined(HAVE_RHEL7_MAX_MTU) + .extended.ndo_change_mtu = internal_dev_change_mtu, #endif .ndo_get_stats64 = (void *)internal_get_stats, };