From patchwork Thu Dec 7 17:01:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 845688 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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BTYmnMNc"; 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 3yt1xB1P8Sz9rxl for ; Fri, 8 Dec 2017 04:02:06 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 0AC96CD6; Thu, 7 Dec 2017 17:01:24 +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 015DCC96 for ; Thu, 7 Dec 2017 17:01:23 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id B3316A3 for ; Thu, 7 Dec 2017 17:01:22 +0000 (UTC) Received: by mail-pf0-f196.google.com with SMTP id n6so5118958pfa.4 for ; Thu, 07 Dec 2017 09:01:22 -0800 (PST) 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=2rP1ckgWDQEOOS3UB8mBwzUYDFxtH4alqP3kuTwuWGo=; b=BTYmnMNcWj8cylwxv3ribidHbDSK8k9gSa8y0z+ZG6o6zJRb/yJBb63OHDuU15Qvv7 or7TblxtmKBHIGecXv71Xyp1PHUJGpkiQLDLdg8TiaT/UaaOgTzHUcqcBUt+ImSq8Tw6 rlMfuUysfsAh0TJ6VOOQhBHH1g+ORe3jgvVPRVNxQ9ybm2AuYnJR/fAY/71H1ALO7AcD gJuPyYnQhVJYD59PjlthNnRRdc/LnCMcRLhLX+FovheMehFdKD9pxtHTo49kjJy6NXbH yb9EiNITPzMIFvkRw9BPvIKzYPxCNjRVrmTUHBXOjrfZGx/q7MevPflfHo274tJYCdAd RWqA== 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=2rP1ckgWDQEOOS3UB8mBwzUYDFxtH4alqP3kuTwuWGo=; b=HiVnRfxg56hsxzADorQ7DBo8w3JVYYnuc7LGG89A1dxX3ALVPYEHDSDQzmfiSgEon+ lGHehvwopmclbsJGP+bSgElT9I0DwgUJwj27v8V8q+PB6PKrvut0XQStOsdLo9nXBjOS PKGYHiwItw8gNgRp8/9obF2bPHI5vBxsIUPxlc5DhOKofeTv5oPfWswbHP/lnNM5v0M4 KBUqyUxUGaKGkAlAS4ibSsjVOtr2c75loSlCalfQdQtqRJsxMVdbTiYXNRO4S6c4j0AB t9sTHRGY/MpsuX59OEDrWy0u0HwyF07CffDj4Z2/u0yBN50TiAvReK2TZc4TgrKYRfUd mXGQ== X-Gm-Message-State: AJaThX7q4pqXkmREYEitEgDm0nLsgLatqWGSVCsB1BOtEEFTEApdu8N7 vCI59Th5LMZmDj9UgeRsz8tBOIPE X-Google-Smtp-Source: AGs4zMZvPKOEMBkslero1tmRcoOnZSgKwI8NkyeBk3n55BBWrQdstZt2IPPNXYEENF0ETUiV30DSSA== X-Received: by 10.84.246.194 with SMTP id j2mr26342981plt.7.1512666081570; Thu, 07 Dec 2017 09:01:21 -0800 (PST) Received: from gizo.domain (67-5-143-47.ptld.qwest.net. [67.5.143.47]) by smtp.gmail.com with ESMTPSA id u18sm10549134pgn.72.2017.12.07.09.01.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Dec 2017 09:01:20 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Thu, 7 Dec 2017 09:01:10 -0800 Message-Id: <1512666075-11857-2-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1512666075-11857-1-git-send-email-gvrose8192@gmail.com> References: <1512666075-11857-1-git-send-email-gvrose8192@gmail.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Greg Rose Subject: [ovs-dev] [PATCH V2 1/6] datapath: Fix netdev_master_upper_dev_link for 4.14 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: Greg Rose An extended netlink ack has been added for 4.14 - add compat layer changes so that it compiles for all kernels up to and including 4.14. Signed-off-by: Greg Rose --- acinclude.m4 | 3 +++ datapath/linux/compat/include/linux/netdevice.h | 15 ++++++++++++++- datapath/vport-netdev.c | 9 ++++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 1179a40..6511a24 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -785,6 +785,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/netfilter.h], [nf_hook_ops], [list], [OVS_DEFINE([HAVE_LIST_IN_NF_HOOK_OPS])]) + OVS_FIND_PARAM_IFELSE([$KSRC/include/linux/netdevice.h], + [netdev_master_upper_dev_link], [extack], + [OVS_DEFINE([HAVE_UPPER_DEV_LINK_EXTACK])]) if cmp -s datapath/linux/kcompat.h.new \ datapath/linux/kcompat.h >/dev/null 2>&1; then diff --git a/datapath/linux/compat/include/linux/netdevice.h b/datapath/linux/compat/include/linux/netdevice.h index 3c3cf42..c460332 100644 --- a/datapath/linux/compat/include/linux/netdevice.h +++ b/datapath/linux/compat/include/linux/netdevice.h @@ -101,13 +101,26 @@ static inline bool netif_needs_gso(struct sk_buff *skb, #ifndef HAVE_NETDEV_MASTER_UPPER_DEV_LINK_RH static inline int rpl_netdev_master_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, - void *upper_priv, void *upper_info) + void *upper_priv, + void *upper_info, void *extack) { return netdev_master_upper_dev_link(dev, upper_dev); } #define netdev_master_upper_dev_link rpl_netdev_master_upper_dev_link #endif +#else +#ifndef HAVE_UPPER_DEV_LINK_EXTACK +static inline int rpl_netdev_master_upper_dev_link(struct net_device *dev, + struct net_device *upper_dev, + void *upper_priv, + void *upper_info, void *extack) +{ + return netdev_master_upper_dev_link(dev, upper_dev, upper_priv, + upper_info); +} +#define netdev_master_upper_dev_link rpl_netdev_master_upper_dev_link +#endif #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0) diff --git a/datapath/vport-netdev.c b/datapath/vport-netdev.c index 697c442..e2d8eaf 100644 --- a/datapath/vport-netdev.c +++ b/datapath/vport-netdev.c @@ -112,8 +112,15 @@ struct vport *ovs_netdev_link(struct vport *vport, const char *name) } rtnl_lock(); +#ifdef HAVE_NETDEV_MASTER_UPPER_DEV_LINK_RH err = netdev_master_upper_dev_link(vport->dev, - get_dpdev(vport->dp), NULL, NULL); + get_dpdev(vport->dp), + NULL, NULL); +#else + err = netdev_master_upper_dev_link(vport->dev, + get_dpdev(vport->dp), + NULL, NULL, NULL); +#endif if (err) goto error_unlock;