From patchwork Mon Jun 10 23:43:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 1113389 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="sXRu1aQd"; 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 45N8q413TQz9sNC for ; Tue, 11 Jun 2019 09:44:00 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 9F364110F; Mon, 10 Jun 2019 23:43:26 +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 224DC1107 for ; Mon, 10 Jun 2019 23:43:24 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 973EF6D6 for ; Mon, 10 Jun 2019 23:43:23 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id s15so926654wmj.3 for ; Mon, 10 Jun 2019 16:43:23 -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=K4WADOO3Dsn3MOsUu/tsdG5AnpFQeeHah4PSH5yH3c0=; b=sXRu1aQd3M85gM7bC5oWM8X19rhfAd1fgR6Ls6qr0b9q8xF5ebun/peZeiDTtmy2cu FMZmm/EXvjF1aFtcFBi/bGZX3r3n/73I/x3gtfxJTtkQ6QcHLMcahze8n8hEn7eYA/8q 8voKI6smJWe1nJKBNy/N0hEcp7rhkm6mTXmS53J5/Bmob6KToPmnH881j4MWZjZpL1hs 1Bd5LvjkJHOi37CZVmUngzsfANQOwo0Xehsuh2sOt+i13NZD/PktB1meQEKgsYgfm42m mBfEOb2/2AeqH3pQJ81xEkOHTWlxUi9hCgm486vXqc4P21sYhoKt6yKwnPJkkk/mJMWg QLgw== 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=K4WADOO3Dsn3MOsUu/tsdG5AnpFQeeHah4PSH5yH3c0=; b=SFTpxUGS9iUuMzrE8x6P6htqPoSVjO8btXfN1/R/2StTt4DEpash3T4Dd5NoVCdMaQ qFQH2OW65aOALmkN9jArb/lC1jdRKN1qrLzu97N6fO8yDpiFTgkfpuKzY0jafgd4PsNz cAuUFBMkBWXlBBnXwXL7v1zeDj3v8ko/2U/okArQpf7i6Oq31HSWRGPnjjEWXdYYuhv8 ZkLyAQzsGurOhv5tpIdAss1/v0wYR30Dn1g5KX9lnsehI81BjGZT0Lmxu4Au0ffD1HJs AO0bfZLGlsZg5w4nJ8jAC1/6YriTyLRKujcsMH28Scnp8u1xxCWNh0AjW2eIo1HPRcHB WUZw== X-Gm-Message-State: APjAAAX/HxGTkrn+BNn4b6u9UZye3pGEFnswx7CqnQVrw4EAd8k30mzQ GBXZ+BoGGKtMF2Sipng4oeCvPkBKiJo= X-Google-Smtp-Source: APXvYqx5KT8esyh7YUGrszQpgLkZIezh8iUY5b0fNzSWyzriZsQPkIk1Qf1wfZ3lDWk4H61Pm/85cA== X-Received: by 2002:a1c:7008:: with SMTP id l8mr14424910wmc.64.1560210201959; Mon, 10 Jun 2019 16:43:21 -0700 (PDT) Received: from kern417.eng.vmware.com ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id v2sm10052180wrn.30.2019.06.10.16.43.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Jun 2019 16:43:21 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Mon, 10 Jun 2019 16:43:07 -0700 Message-Id: <1560210191-9414-2-git-send-email-pkusunyifeng@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560210191-9414-1-git-send-email-pkusunyifeng@gmail.com> References: <1560210191-9414-1-git-send-email-pkusunyifeng@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 1/5] datapath: Check extack argument of rtnl_create_link() 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 Upstream commit d0522f1cd25edb796548f91e04766fa3cbc3b6df ("net: Add extack argument to rtnl_create_link") added new argument to rtnl_create_link(). This introduced compiling errors in the code of kernel datapath. This patch fixes this issue. Signed-off-by: Yifeng Sun Acked-by: Yi-Hung Wei --- acinclude.m4 | 3 +++ datapath/linux/compat/include/net/rtnetlink.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index 08686044f635..6783512a68f3 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -681,6 +681,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ [rcu_read_lock_held])]) OVS_GREP_IFELSE([$KSRC/include/linux/rtnetlink.h], [lockdep_rtnl_is_held]) OVS_GREP_IFELSE([$KSRC/include/linux/rtnetlink.h], [net_rwsem]) + OVS_FIND_PARAM_IFELSE([$KSRC/include/net/rtnetlink.h], + [rtnl_create_link], [extack], + [OVS_DEFINE([HAVE_RTNL_CREATE_LINK_TAKES_EXTACK])]) # Check for the proto_data_valid member in struct sk_buff. The [^@] # is necessary because some versions of this header remove the diff --git a/datapath/linux/compat/include/net/rtnetlink.h b/datapath/linux/compat/include/net/rtnetlink.h index 74d6a27b799f..e026cab9530d 100644 --- a/datapath/linux/compat/include/net/rtnetlink.h +++ b/datapath/linux/compat/include/net/rtnetlink.h @@ -32,7 +32,11 @@ static inline struct net_device *rpl_rtnl_create_link(struct net *net, const cha const struct rtnl_link_ops *ops, struct nlattr *tb[]) { +#ifdef HAVE_RTNL_CREATE_LINK_TAKES_EXTACK + return rtnl_create_link(net, (char *) ifname, name_assign_type, ops, tb, NULL); +#else return rtnl_create_link(net, (char *) ifname, name_assign_type, ops, tb); +#endif } #endif