From patchwork Tue Jun 12 00:50:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi-Hung Wei X-Patchwork-Id: 927995 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 Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LCSIDuJJ"; dkim-atps=neutral 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 414WZv0DM9z9s0W for ; Tue, 12 Jun 2018 10:53:11 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 51A231455; Tue, 12 Jun 2018 00:53:09 +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 ABBE311AE for ; Tue, 12 Jun 2018 00:53:08 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 726935C2 for ; Tue, 12 Jun 2018 00:53:08 +0000 (UTC) Received: by mail-pg0-f65.google.com with SMTP id w12-v6so10595618pgc.6 for ; Mon, 11 Jun 2018 17:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=dVuDPxPEz6I70ow/Ay5I/Y7jVzmX+PxgHDlgu0nJfVc=; b=LCSIDuJJLyy39yrAa4yAyJqYGQWlJq3blrdUavBtHiZiKNXIQBuwuoIgF7Vx2hZuuF NLQgvDPTTrhvVyqM5KY9219emzJMsQJkc4QRC8JGShvPAG8cCYwp27NKOEzf3iLqv3SI LXOhPpehuo03uYy34YJwop7968JdGbJw2C4Ro2Nz7iqvlMbIEVlTAC78qbqJzBu3wpp5 WkcEn6LS5+MOBu596fhWg6DIF0WoGhg6Fu+IK1cbWD6Tq9/pAVEvQ74eftB6CrzVRVU5 P6/SI10cdGQgJsbtv7a0jYlDRi8rZbHUZkbXyV0zbSMz6UBW0FMtoi5KaWnxUaokwTNV Gxsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=dVuDPxPEz6I70ow/Ay5I/Y7jVzmX+PxgHDlgu0nJfVc=; b=Pv/CN9d+P40A/W2R3A6mChXofDNchL2x2zmnP9cdl/mwmQfhjgPw42PwVzQyPXgWvK lbBmdcM6zOCVZqIx0CyuXg4PMeS+Q99gPnosIZ8aa9ljpXMg+Mw4VOhsqeqBak/mzLeH irnn03wtsso3ebHIuW9OwoCmPknUc5Ol35AmXRQrCxwaTIrjSeJRCMMyj73dNhFjf3X7 Ghe6bqVeyOfHe1ORZ+qo3p3HAr+MApoRsYGydnDnH6k2CPH+ateVA8U9EoZ+t2Pi/GE+ e9KLaTSMoQtFp7q6/D1465gk0SPiR2pSStxLXh0ByF/yXoIe/Ga+tpX6Datja7olK0W7 x+Pg== X-Gm-Message-State: APt69E2C9RDXMA30+YiCdE2jeKEIDwiys2P6AmKH6FSWpBl6aPYbA17q 65tF/y5JuAOXsEOpI9X5U6gkMCHi X-Google-Smtp-Source: ADUXVKL6eTtRD8a/hote+2xTYNQd7MKG0SiVERsiygULbKrvqWOjd74U0pRak2TzYy2TkpXlmKwxfQ== X-Received: by 2002:a63:7847:: with SMTP id t68-v6mr1170036pgc.329.1528764787518; Mon, 11 Jun 2018 17:53:07 -0700 (PDT) Received: from Husky.eng.vmware.com ([66.170.99.1]) by smtp.gmail.com with ESMTPSA id o65-v6sm15679002pga.75.2018.06.11.17.53.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jun 2018 17:53:06 -0700 (PDT) From: Yi-Hung Wei To: dev@openvswitch.org Date: Mon, 11 Jun 2018 17:50:21 -0700 Message-Id: <1528764623-19974-1-git-send-email-yihung.wei@gmail.com> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE 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 1/3] datapath: Fix max MTU size on RHEL 7.5 kernel 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 Without the patch, in RHEL 7.5, the maximum configurable MTU of vport internal device is 1500, which shall be 65535. This patch fixes this issue. Fixes: 39ca338374ab ("datapath: compat: Fix build on RHEL 7.5") Reported-by: Lucas Alvares Gomes Signed-off-by: Yi-Hung Wei Reviewed-by: Greg Rose Tested-by: Greg Rose Acked-by: Lucas Alvares Gomes --- datapath/vport-internal_dev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c index 3cb8d06b2475..3fa86815c7fa 100644 --- a/datapath/vport-internal_dev.c +++ b/datapath/vport-internal_dev.c @@ -169,6 +169,8 @@ static void do_setup(struct net_device *netdev) #ifdef HAVE_NET_DEVICE_WITH_MAX_MTU netdev->max_mtu = ETH_MAX_MTU; +#elif HAVE_RHEL7_MAX_MTU + netdev->extended->max_mtu = ETH_MAX_MTU; #endif netdev->netdev_ops = &internal_dev_netdev_ops; From patchwork Tue Jun 12 00:50:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi-Hung Wei X-Patchwork-Id: 927996 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 Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="F8EOpgNz"; dkim-atps=neutral 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 414WbK4xPvz9s0W for ; Tue, 12 Jun 2018 10:53:33 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 036511466; Tue, 12 Jun 2018 00:53:13 +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 5A04E1407 for ; Tue, 12 Jun 2018 00:53:11 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id E75606A1 for ; Tue, 12 Jun 2018 00:53:10 +0000 (UTC) Received: by mail-pg0-f67.google.com with SMTP id 15-v6so10595888pge.2 for ; Mon, 11 Jun 2018 17:53:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UgHx9xftQVZ5CadV7fyvelAGGNCOLDJVhbXfvYNy/JU=; b=F8EOpgNzygIPU618vYyY2KlbRK1RPOiriDWqCHbb0ay3foNGm9FtlgBdxBz6ksxHiZ RQON5TU4e1eZSKXPQpkNuPkSNFwmuTqdkCo3A6zL9stTn8hxFMbHF/mKgfQOXWzB/NZi KREneSCP/kgmwTAN+eloq+4A2yeON7QIbOF0JS/RRIJ7ZtC/xG0N3FlpTgmSwk8UWYru Oh0+pfOGScZnbAhr7T3Gr5d7VGtq2+JuKe+eiEbM/vyENAnXT8FAJST9hnZJkbBvwbxY RiXwTvibdWLrixkbHA/9EPYK2t0oL2E4SlK6fW3htXpLGGnSEte6W28/Lvb46Q4N0XpY jYoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UgHx9xftQVZ5CadV7fyvelAGGNCOLDJVhbXfvYNy/JU=; b=dRG3IE7IVB9L1QbTSXpET8d57iy3DKC4p/qoqLQpnWHBiephJtIeXEVq4oy84Rj7vQ X0FsSBtYSEff33oaOET3sPuYFgCOYkb/ypEbIdOyXpK+gJbZ/azuJ9v8+QnxTfHZwMQN BEG7XfItBPfmXOqHsvbVUmPJn5ncVc3+S2Ax144+7RsTQbQTR0sSJ1/kuebga0PZOvsn Lik5f6vWw093mlPaI3YpTzTv/oapFzdfaKp0QBldnIvcp1SVluVGJzl3Or7HmI66K8YL pkiviOgguxkxAZcueVZIkbW2q/1hK+DV/X7EQgujTabKshOJbjyu1fKNJAzhrfzOVHqR lQYg== X-Gm-Message-State: APt69E2S/lXxv7abgHVEBkRA5gLrRGdaNvH1lEyzMrBKpAQlbVvStapt w1urpH2WUqWFZI8OesQxvi/ac/E9 X-Google-Smtp-Source: ADUXVKKTEBuYaO6J4kCmrGJcRqAG6ZRR2JomM6K9ywwx5PIDGSHboAo9ps0j1UySHHmV+XfiZHUbAg== X-Received: by 2002:a65:6190:: with SMTP id c16-v6mr1136361pgv.405.1528764790026; Mon, 11 Jun 2018 17:53:10 -0700 (PDT) Received: from Husky.eng.vmware.com ([66.170.99.1]) by smtp.gmail.com with ESMTPSA id o65-v6sm15679002pga.75.2018.06.11.17.53.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jun 2018 17:53:08 -0700 (PDT) From: Yi-Hung Wei To: dev@openvswitch.org Date: Mon, 11 Jun 2018 17:50:22 -0700 Message-Id: <1528764623-19974-2-git-send-email-yihung.wei@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528764623-19974-1-git-send-email-yihung.wei@gmail.com> References: <1528764623-19974-1-git-send-email-yihung.wei@gmail.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE 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 2/3] datapath: Fix ip6_gre, ip6_tunnel, and ip_gre backport 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 Recently added ERSAPN feature introduced changes in ip6_gre, ip6_tunnel, and ip_gre which will break build on RHEL 7.5 kernel because of ndo_change_mtu(). This patch fixes the issue in RHEL 7.5 kernel. Fixes: 8e53509c ("gre: introduce native tunnel support for ERSPAN") Fixes: c387d817 ("compat: Add ipv6 GRE and IPV6 Tunneling") Signed-off-by: Yi-Hung Wei Reviewed-by: Greg Rose Tested-by: Greg Rose --- datapath/linux/compat/ip6_gre.c | 15 +++++++++++++++ datapath/linux/compat/ip6_tunnel.c | 5 +++++ datapath/linux/compat/ip_gre.c | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/datapath/linux/compat/ip6_gre.c b/datapath/linux/compat/ip6_gre.c index dd22240fc962..0c885472df5b 100644 --- a/datapath/linux/compat/ip6_gre.c +++ b/datapath/linux/compat/ip6_gre.c @@ -1525,7 +1525,12 @@ static const struct net_device_ops ip6gre_netdev_ops = { .ndo_uninit = ip6gre_tunnel_uninit, .ndo_start_xmit = ip6gre_tunnel_xmit, .ndo_do_ioctl = ip6gre_tunnel_ioctl, +#ifdef HAVE_RHEL7_MAX_MTU + .ndo_size = sizeof(struct net_device_ops), + .extended.ndo_change_mtu = ip6_tnl_change_mtu, +#else .ndo_change_mtu = ip6_tnl_change_mtu, +#endif .ndo_get_stats64 = ip_tunnel_get_stats64, #ifdef HAVE_NDO_GET_IFLINK .ndo_get_iflink = ip6_tnl_get_iflink, @@ -2010,7 +2015,12 @@ static const struct net_device_ops ip6gre_tap_netdev_ops = { .ndo_start_xmit = ip6gre_tunnel_xmit, .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, +#ifdef HAVE_RHEL7_MAX_MTU + .ndo_size = sizeof(struct net_device_ops), + .extended.ndo_change_mtu = ip6_tnl_change_mtu, +#else .ndo_change_mtu = ip6_tnl_change_mtu, +#endif .ndo_get_stats64 = ip_tunnel_get_stats64, #ifdef HAVE_NDO_GET_IFLINK .ndo_get_iflink = ip6_tnl_get_iflink, @@ -2073,7 +2083,12 @@ static const struct net_device_ops ip6erspan_netdev_ops = { .ndo_start_xmit = ip6erspan_tunnel_xmit, .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, +#ifdef HAVE_RHEL7_MAX_MTU + .ndo_size = sizeof(struct net_device_ops), + .extended.ndo_change_mtu = ip6_tnl_change_mtu, +#else .ndo_change_mtu = ip6_tnl_change_mtu, +#endif .ndo_get_stats64 = ip_tunnel_get_stats64, #ifdef HAVE_NDO_GET_IFLINK .ndo_get_iflink = ip6_tnl_get_iflink, diff --git a/datapath/linux/compat/ip6_tunnel.c b/datapath/linux/compat/ip6_tunnel.c index f6ac069b5281..7c66787967f6 100644 --- a/datapath/linux/compat/ip6_tunnel.c +++ b/datapath/linux/compat/ip6_tunnel.c @@ -1612,7 +1612,12 @@ static const struct net_device_ops ip6_tnl_netdev_ops = { .ndo_uninit = ip6_tnl_dev_uninit, .ndo_start_xmit = ip6_tnl_start_xmit, .ndo_do_ioctl = ip6_tnl_ioctl, +#ifdef HAVE_RHEL7_MAX_MTU + .ndo_size = sizeof(struct net_device_ops), + .extended.ndo_change_mtu = ip6_tnl_change_mtu, +#else .ndo_change_mtu = ip6_tnl_change_mtu, +#endif .ndo_get_stats = ip6_get_stats, #ifdef HAVE_NDO_GET_IFLINK .ndo_get_iflink = ip6_tnl_get_iflink, diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c index d35614ee9a73..ac9fb8bfcc88 100644 --- a/datapath/linux/compat/ip_gre.c +++ b/datapath/linux/compat/ip_gre.c @@ -1153,7 +1153,12 @@ static const struct net_device_ops ipgre_netdev_ops = { .ndo_init = ipgre_tunnel_init, .ndo_uninit = rpl_ip_tunnel_uninit, .ndo_start_xmit = ipgre_xmit, +#ifdef HAVE_RHEL7_MAX_MTU + .ndo_size = sizeof(struct net_device_ops), + .extended.ndo_change_mtu = ip_tunnel_change_mtu, +#else .ndo_change_mtu = ip_tunnel_change_mtu, +#endif .ndo_get_stats64 = ip_tunnel_get_stats64, #ifdef HAVE_GET_LINK_NET .ndo_get_iflink = ip_tunnel_get_iflink, @@ -1187,7 +1192,12 @@ static const struct net_device_ops erspan_netdev_ops = { .ndo_start_xmit = erspan_xmit, .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, +#ifdef HAVE_RHEL7_MAX_MTU + .ndo_size = sizeof(struct net_device_ops), + .extended.ndo_change_mtu = ip_tunnel_change_mtu, +#else .ndo_change_mtu = ip_tunnel_change_mtu, +#endif .ndo_get_stats64 = ip_tunnel_get_stats64, #ifdef HAVE_NDO_GET_IFLINK .ndo_get_iflink = rpl_ip_tunnel_get_iflink, From patchwork Tue Jun 12 00:50:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yi-Hung Wei X-Patchwork-Id: 927997 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 Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rtO4mvPn"; dkim-atps=neutral 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 414Wbn4HLMz9s0W for ; Tue, 12 Jun 2018 10:53:57 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id BD72F15D2; Tue, 12 Jun 2018 00:53:17 +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 2EDA515AB for ; Tue, 12 Jun 2018 00:53:17 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A881670C for ; Tue, 12 Jun 2018 00:53:16 +0000 (UTC) Received: by mail-pf0-f193.google.com with SMTP id q1-v6so11139874pff.13 for ; Mon, 11 Jun 2018 17:53:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wBQXAVb9KCXZBQaFAywKno+baGAFBLcFb5C807VDA54=; b=rtO4mvPngZ7trO5xg3c6ofr6U2KqSUEvvYSizwJyC2HVQmaHT13NfJRq+9CrVjn7zn kT6xV4yzJjuBs4fS50RUUYSL6VFhQW3pBuMxlA67xbz5zlJU9vFZRMVhCOpHM78ZVl/Y rvnN2dJcraYw+W0e+5inFOU1PusxFQO6LTlskdahZ09KZL65QPxAhijeX/Z9lKhUveKd GjXvadvj2Tv+wVv1FjCfkZbPWQj+oBtE+DL9Tuw+T+EeuNJLPV3zV5AZbJ9JnH6junQL 452A5MS6vBxvwHSfRXLz2SNA0Deyaz4XHw+WZpiDEEOE2EbVvJLxIRWs9MUtCiO2R7vd Z1DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wBQXAVb9KCXZBQaFAywKno+baGAFBLcFb5C807VDA54=; b=sq2CeYAYgGRr+0FiktmvzsnM/LCkpfm3gOIHP0ys7I071aONZgv8kI4S6iWcMsB5DW CBygj/PVcwRNKmZu9wWF33IWxUTf/vtbgLUEo2CLiDi0NIreDU6RtsMQ7QxQXP+KoLqQ 5+pOQ8ibMOrC65T3l3RYr86jnXWTqGcoFygq3nzMup687wyLb5Jro1bl8K6msA0gNnHG t44sH8M1obJYGU7kCsHeCvlLe1d6H7NeYXjBq79vqmPIFhsLxEHrdDbL9d8MTXKi+Snh VJbRT3u0rJKMqvgNslK5Nwwi6CyGNGdafBzblwkZ+bysraUmZuV2DMFwYuKSSlAEX2vW qd2A== X-Gm-Message-State: APt69E3J+mO1E7Mc7mJRLbqH/TGmcjDPq4JLHmLJaI8+at/iEC0/wVhw kJbY96KfmxMP7s3efca1UhtmdECD X-Google-Smtp-Source: ADUXVKJjYah5AMlJV2SJDcTzc/7z5orHuit9n/p0BYGVpjfRnvA9balmZHqRnBUdaQ6ONOtKjbEsjg== X-Received: by 2002:a63:2dc2:: with SMTP id t185-v6mr1250632pgt.204.1528764795601; Mon, 11 Jun 2018 17:53:15 -0700 (PDT) Received: from Husky.eng.vmware.com ([66.170.99.1]) by smtp.gmail.com with ESMTPSA id o65-v6sm15679002pga.75.2018.06.11.17.53.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jun 2018 17:53:14 -0700 (PDT) From: Yi-Hung Wei To: dev@openvswitch.org Date: Mon, 11 Jun 2018 17:50:23 -0700 Message-Id: <1528764623-19974-3-git-send-email-yihung.wei@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528764623-19974-1-git-send-email-yihung.wei@gmail.com> References: <1528764623-19974-1-git-send-email-yihung.wei@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE 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 3/3] datapath: compat: Fix RHEL 7.5 build warning from ip_tunnel_get_stats64() 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: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org This patch fixes warning as the following in RHEL 7.5 kernel. CC [M] /root/git/ovs/datapath/linux/geneve.o /root/git/ovs/datapath/linux/geneve.c:1273:2: warning: initialization from incompatible pointer type [enabled by default] .ndo_get_stats64 = ip_tunnel_get_stats64, ^ /root/git/ovs/datapath/linux/geneve.c:1273:2: warning: (near initialization for ‘geneve_netdev_ops..ndo_get_stats64’) [enabled by default] /root/git/ovs/datapath/linux/ip_gre.c:1162:2: warning: initialization from incompatible pointer type [enabled by default] .ndo_get_stats64 = ip_tunnel_get_stats64, ^ /root/git/ovs/datapath/linux/ip_gre.c:1162:2: warning: (near initialization for ‘ipgre_netdev_ops..ndo_get_stats64’) [enabled by default] /root/git/ovs/datapath/linux/ip_gre.c:1180:2: warning: initialization from incompatible pointer type [enabled by default] .ndo_get_stats64 = ip_tunnel_get_stats64, ^ Fixes: 436d36db ("compat: Fixups for newer kernels") Signed-off-by: Yi-Hung Wei Reviewed-by: Greg Rose Tested-by: Greg Rose --- datapath/linux/compat/include/net/ip_tunnels.h | 2 +- datapath/linux/compat/ip_tunnels_core.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/datapath/linux/compat/include/net/ip_tunnels.h b/datapath/linux/compat/include/net/ip_tunnels.h index b1c383dc8036..d187a12d29ae 100644 --- a/datapath/linux/compat/include/net/ip_tunnels.h +++ b/datapath/linux/compat/include/net/ip_tunnels.h @@ -364,7 +364,7 @@ static inline int ovs_ip_tunnel_encap(struct sk_buff *skb, struct ip_tunnel *t, } #define ip_tunnel_get_stats64 rpl_ip_tunnel_get_stats64 -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0) && !defined(HAVE_RHEL7_MAX_MTU) struct rtnl_link_stats64 *rpl_ip_tunnel_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *tot); #else diff --git a/datapath/linux/compat/ip_tunnels_core.c b/datapath/linux/compat/ip_tunnels_core.c index fcb08905ef2f..38fb801e9411 100644 --- a/datapath/linux/compat/ip_tunnels_core.c +++ b/datapath/linux/compat/ip_tunnels_core.c @@ -274,7 +274,7 @@ static void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64, } #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0) && !defined(HAVE_RHEL7_MAX_MTU) struct rtnl_link_stats64 *rpl_ip_tunnel_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *tot) #else @@ -306,7 +306,7 @@ void rpl_ip_tunnel_get_stats64(struct net_device *dev, tot->tx_bytes += tx_bytes; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0) && !defined(HAVE_RHEL7_MAX_MTU) return tot; #endif }