From patchwork Wed Feb 7 15:30:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 870419 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="N3+mQuLq"; 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 3zc4zP4DPyz9s7F for ; Thu, 8 Feb 2018 02:30:57 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id C3A861113; Wed, 7 Feb 2018 15:30:19 +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 39BC710F2 for ; Wed, 7 Feb 2018 15:30:18 +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 D1ABC3F9 for ; Wed, 7 Feb 2018 15:30:17 +0000 (UTC) Received: by mail-pg0-f67.google.com with SMTP id f6so404824pgs.10 for ; Wed, 07 Feb 2018 07:30:17 -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=wSnyerb8/Dhh0/ZdZqITQLss+VZ/YsR7We3qk7PN5Yc=; b=N3+mQuLqeCBmOt6XL+9ZshPNtjWRgqRYZmCZTp5P4oRsLCgeO0dqLIWHfaYJrjBFXs pICkwG9uhkZ9P5D/jjK519PBAzktc+98Y0OcSufha2SHSF5LCWqpYgD9Rg62WWHA1MnT PS0ZfhgnAOMQrZaZ+vbmI4Gs8qKhdd1aUaDpYHbmdFQRnUin4czVLJwZFpA/7tqb0c1p qG/LGElBwlu+ydG/QfBtkfd6SAsKmEfPKChh2DPDutTxGQxVbGxZ7VIkWAyUcYkooFSK 1ecwwuzTWrgSPCwe8OMt+cbwtiprLtk4THdYGy1AITdZnzVq2VOlgfpBk3994RzVMips 9qRQ== 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=wSnyerb8/Dhh0/ZdZqITQLss+VZ/YsR7We3qk7PN5Yc=; b=S09eUX6nJJI7g0Pz+xA2RJuCEOTpBjVNrVQwRnhS0JFk6mCTA5gVxYKOEFXYiZW9Ko tZ1twRHVkKz25yJcUeo1iMY2r0ClAvFqmVgORxhDbv1bSlBWcqhkxEVHmWzwnu8G8sIY Ij6AS+tJxN6AjD5RqNlqmHCjT6pdI6dXJRfjc8XKN8mSjgf8fYbO8jeWFz9/LEabwwHe 6cj+PEXbKMrfuKt4Nd2J6xGSNLL0FlxDrhAu8ST5y2YQhrcYnO62GA0U7aHfYpp29Cqm nY/fwNf0LOEKE/IiAwJl/Q0RZ9UxvPehc/SQE7N22BhlgZACSHQ7Ofj6ANHKfY7Igegr JTQw== X-Gm-Message-State: APf1xPC3asO0E23+2dD5bVCM7qLsKmyfVm/Z02ZgnY8NjnzvPZTQlSXG 6Y5LtASlMC7za0lhychg/Ok3hQ== X-Google-Smtp-Source: AH8x2253+dXhivNYFedtYm7ewwqTHbi4U9CF2yqo1ubriaCju0zplv+KR4pbqx15EFMwQRi80vvtYA== X-Received: by 10.98.70.155 with SMTP id o27mr6368002pfi.28.1518017416911; Wed, 07 Feb 2018 07:30:16 -0800 (PST) Received: from gizo.domain (184-100-240-187.ptld.qwest.net. [184.100.240.187]) by smtp.gmail.com with ESMTPSA id e88sm5176558pfl.80.2018.02.07.07.30.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 07:30:15 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Wed, 7 Feb 2018 07:30:01 -0800 Message-Id: <1518017410-31711-2-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1518017410-31711-1-git-send-email-gvrose8192@gmail.com> References: <1518017410-31711-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 Subject: [ovs-dev] [PATCH V2 01/10] 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 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 | 30 +++++++++++++++++++++---- datapath/vport-netdev.c | 3 ++- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index c04c2c6..768c20c 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -795,6 +795,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ [OVS_DEFINE([HAVE_LIST_IN_NF_HOOK_OPS])]) OVS_GREP_IFELSE([$KSRC/include/uapi/linux/netfilter/nf_conntrack_common.h], [IP_CT_UNTRACKED]) + 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..25d5d3a 100644 --- a/datapath/linux/compat/include/linux/netdevice.h +++ b/datapath/linux/compat/include/linux/netdevice.h @@ -101,14 +101,36 @@ 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 -#endif +#else /* #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 *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 /* #else HAVE_NETDEV_MASTER_UPPER_DEV_LINK_RH */ +#else /* #ifndef HAVE_NETDEV_MASTER_UPPER_DEV_LINK_PRIV */ +#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 /* #ifndef HAVE_UPPER_DEV_LINK_EXTACK */ +#endif /* #else HAVE_NETDEV_MASTER_UPPER_DEV_LINK_PRIV */ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0) #define dev_queue_xmit rpl_dev_queue_xmit diff --git a/datapath/vport-netdev.c b/datapath/vport-netdev.c index 697c442..4eb8816 100644 --- a/datapath/vport-netdev.c +++ b/datapath/vport-netdev.c @@ -113,7 +113,8 @@ struct vport *ovs_netdev_link(struct vport *vport, const char *name) rtnl_lock(); err = netdev_master_upper_dev_link(vport->dev, - get_dpdev(vport->dp), NULL, NULL); + get_dpdev(vport->dp), + NULL, NULL, NULL); if (err) goto error_unlock; From patchwork Wed Feb 7 15:30:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 870421 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="NwHAP1I0"; 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 3zc50G2Hqsz9s4q for ; Thu, 8 Feb 2018 02:31:42 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id DAB1A1145; Wed, 7 Feb 2018 15:30:22 +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 70F031143 for ; Wed, 7 Feb 2018 15:30:21 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl0-f68.google.com (mail-pl0-f68.google.com [209.85.160.68]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id AEBC33F9 for ; Wed, 7 Feb 2018 15:30:19 +0000 (UTC) Received: by mail-pl0-f68.google.com with SMTP id q17-v6so224769pll.1 for ; Wed, 07 Feb 2018 07:30:19 -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=+JNsr8BN2rVSh25YRG2EMvI/THXkRubNpMg9V3QYNLI=; b=NwHAP1I0OcFBTdqt6MCn9POPvMH8+WdNiSRrw7IaJHNTJtV3y8spMNYl++9C9Bl5ZA LP3q6xk15q/Z8p6bSdpaJwUBUmNxHYMzpkV4lLpzM7dKzwh3RpLbQhnXi3Bs5D4n/EvP VQOpsT7jUe2zUeVQWPYNXJIya9ZIFiKtPmUg1xVPCxPWv80adq7Kt97HGRmrDEGZPjJw ugEBfrGJ/NomKWBK//wfieb470K96nNVfRk255EC65nW60f9CX+fd0PnvupOZ4vidO1J TeDuZts/AAR85R5liBNNmQeQXR6bI9YZbbOlgIunTr5KOB2Ivhj9mUIKjmiBwM4jQ2jW 3ZkQ== 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=+JNsr8BN2rVSh25YRG2EMvI/THXkRubNpMg9V3QYNLI=; b=bVnUHwIHtgJqF+A7YRis6hU9F029OlwOwzwb+dNi8z/rvQcrG/ilqzs6UwJMtxLVPf ZCPbXULxD9edosVYPClw6P3mo4XnqawVVPk8D2rBTkn7ctC7qoxl/TkgslR8Yi80r2ny +D5NKF1N/NqOrMtkwEYtP5fy89CsUpbFRsn+j0TNQnWKUgxF3D63Yc8jAJVLT7VJReCd QgYa6Xd4gurPhdz6oEzQctqHPFv+HPJ2rylbxfGp8Tigr7003Z+cY3cxPSqmGC/zZaO1 3Wal+S+IMnnjdEkcS+Nxr/5nFSSDfYl0gA8+CrHwGSW/ES+Z8CKvPkcYmD9HhT+5F1iT JKaw== X-Gm-Message-State: APf1xPDiXKbzEZoD2Y08nHxYuJ8ktU2mYO2gG8dqixYFN5k6vTt9fJA3 vZHe/vswFO/PyhU3LUiMya96EQ== X-Google-Smtp-Source: AH8x2260yWkg6sXX4cQ8169fumpX0WWkFltxtWN+BO3ETpBHOEqHnqGqmZVIFrPKg4NZBQWTlaBHtQ== X-Received: by 2002:a17:902:7b81:: with SMTP id w1-v6mr6291064pll.295.1518017418893; Wed, 07 Feb 2018 07:30:18 -0800 (PST) Received: from gizo.domain (184-100-240-187.ptld.qwest.net. [184.100.240.187]) by smtp.gmail.com with ESMTPSA id e88sm5176558pfl.80.2018.02.07.07.30.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 07:30:17 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Wed, 7 Feb 2018 07:30:02 -0800 Message-Id: <1518017410-31711-3-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1518017410-31711-1-git-send-email-gvrose8192@gmail.com> References: <1518017410-31711-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 Subject: [ovs-dev] [PATCH V2 02/10] compat: Do not include headers when not compiling 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 If the entire file is not going to be compiled because OVS is using upstream tunnel support then also don't bother pulling in the headers. Signed-off-by: Greg Rose --- datapath/linux/compat/ip_gre.c | 2 +- datapath/linux/compat/ip_output.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c index 94fdaa9..4e32591 100644 --- a/datapath/linux/compat/ip_gre.c +++ b/datapath/linux/compat/ip_gre.c @@ -12,6 +12,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#ifndef USE_UPSTREAM_TUNNEL #include #include #include @@ -52,7 +53,6 @@ #include #include -#ifndef USE_UPSTREAM_TUNNEL #if IS_ENABLED(CONFIG_IPV6) #include #include diff --git a/datapath/linux/compat/ip_output.c b/datapath/linux/compat/ip_output.c index edca340..e2f869f 100644 --- a/datapath/linux/compat/ip_output.c +++ b/datapath/linux/compat/ip_output.c @@ -45,6 +45,7 @@ * Hirokazu Takahashi: sendfile() on UDP works now. */ +#ifndef HAVE_CORRECT_MRU_HANDLING #include #include #include @@ -82,7 +83,6 @@ #include #include -#ifndef HAVE_CORRECT_MRU_HANDLING static inline void rpl_ip_options_fragment(struct sk_buff *skb) { unsigned char *optptr = skb_network_header(skb) + sizeof(struct iphdr); From patchwork Wed Feb 7 15:30:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 870422 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="muXQJ+xW"; 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 3zc50w51Klz9s4q for ; Thu, 8 Feb 2018 02:32:16 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 915E51169; Wed, 7 Feb 2018 15:30:23 +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 704B11143 for ; Wed, 7 Feb 2018 15:30:22 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl0-f67.google.com (mail-pl0-f67.google.com [209.85.160.67]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 619A3516 for ; Wed, 7 Feb 2018 15:30:21 +0000 (UTC) Received: by mail-pl0-f67.google.com with SMTP id f4-v6so208440plr.10 for ; Wed, 07 Feb 2018 07:30:21 -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=vtOY+iZ0d6y1L5p3PJFN8hf0CGcjaGazJ9AS3UhM6uI=; b=muXQJ+xWDcdRmlU8gZu2HhATTU0jwY+NJNJ8mE0PFe8SQG+aB4XmsT2CrMVwryUWlR C3x4c2e9i7EjWKgAuQWx5MRDzk/L4uk4/DoRZKLFR+5ytXbtVBBJd9aJSX4s7TuL8wGp ZJWTg4kMmDnXucz+N9I5SKQQg/fu9QjGtr8MSJKgMfPPR6x1BHnPvNwdUN9gc+APzza8 DFOIDc7Dn94T1FAqCb09HG1Aia485ovrTnayIHeoh6lmZqih/fFzxiu93JcFhUh8Rpk/ TdF6pwDuwRXU6q8mOmQ/9UsrJUYjRSHaj4d7MQ7iwIycmegm57RMrvGlemxSTpdw6kRS VHwg== 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=vtOY+iZ0d6y1L5p3PJFN8hf0CGcjaGazJ9AS3UhM6uI=; b=kxDYB4Eq02SWQdHeYs5dnaC30Js5bQCbXb1QTRq9n+2nXMYp/Vy63E6nG1nJP88ESi +obTWrNSx0+Fee9X8o5VeOw36z99+bE/595ffKFGwK3vDLxCun190QLopX6fJz9kSUhl SBc3afvKr5BglVE7DDpqcnT3/IVmbx9ZPxyQKz99zvQCXGotO4RrvcbbeseeGB/u9Y7g tXR83vdym+p3OKLSE4qIIWZ5BfMPTCosnXMUfBBI5n6rTfVC9DE+ELRcstAavJHqw1bh Z06N9jjBRgW+trWKcwernjaGCHCAfIukiBVQsISsobkWz2piUcp4HbqRdT09WbLm+8jg QHOw== X-Gm-Message-State: APf1xPDIQLKXygomafi50/vlF6DSRxTMiZ0MRG9vaLat2ium8GsymiKn uZyXdlfyrnpB4QTFotrLDjOAzA== X-Google-Smtp-Source: AH8x2273zIldyzEoGTbX7HNr+6EPV30q/5Jb2IvfeeBQGnzj7uuO9RSEIYSJGVNBDLDa5tGqiG0oAQ== X-Received: by 2002:a17:902:6bc3:: with SMTP id m3-v6mr6362205plt.442.1518017420640; Wed, 07 Feb 2018 07:30:20 -0800 (PST) Received: from gizo.domain (184-100-240-187.ptld.qwest.net. [184.100.240.187]) by smtp.gmail.com with ESMTPSA id e88sm5176558pfl.80.2018.02.07.07.30.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 07:30:19 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Wed, 7 Feb 2018 07:30:03 -0800 Message-Id: <1518017410-31711-4-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1518017410-31711-1-git-send-email-gvrose8192@gmail.com> References: <1518017410-31711-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 Subject: [ovs-dev] [PATCH V2 03/10] compat:inet_frag.h: Check for frag_percpu_counter_batch 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 Fix up the compat layer to check for frag_percpu_counter_batch and if not present then use atomic_sub and atomic_add as per the backport in the 3.16.50 LTS kernel. Signed-off-by: Greg Rose --- datapath/linux/compat/include/net/inet_frag.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/datapath/linux/compat/include/net/inet_frag.h b/datapath/linux/compat/include/net/inet_frag.h index 34078c8..4090886 100644 --- a/datapath/linux/compat/include/net/inet_frag.h +++ b/datapath/linux/compat/include/net/inet_frag.h @@ -30,6 +30,7 @@ static inline bool inet_frag_evicting(struct inet_frag_queue *q) #endif #ifndef HAVE_SUB_FRAG_MEM_LIMIT_ARG_STRUCT_NETNS_FRAGS +#ifdef frag_percpu_counter_batch static inline void rpl_sub_frag_mem_limit(struct netns_frags *nf, int i) { __percpu_counter_add(&nf->mem, -i, frag_percpu_counter_batch); @@ -41,6 +42,19 @@ static inline void rpl_add_frag_mem_limit(struct netns_frags *nf, int i) __percpu_counter_add(&nf->mem, i, frag_percpu_counter_batch); } #define add_frag_mem_limit rpl_add_frag_mem_limit +#else /* !frag_percpu_counter_batch */ +static inline void rpl_sub_frag_mem_limit(struct netns_frags *nf, int i) +{ + atomic_sub(i, &nf->mem); +} +#define sub_frag_mem_limit rpl_sub_frag_mem_limit + +static inline void rpl_add_frag_mem_limit(struct netns_frags *nf, int i) +{ + atomic_add(i, &nf->mem); +} +#define add_frag_mem_limit rpl_add_frag_mem_limit +#endif /* frag_percpu_counter_batch */ #endif #ifdef HAVE_VOID_INET_FRAGS_INIT From patchwork Wed Feb 7 15:30:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 870423 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="A4g6VPv3"; 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 3zc51b6PCdz9s4q for ; Thu, 8 Feb 2018 02:32:51 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 8BE541180; Wed, 7 Feb 2018 15:30:25 +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 ED3DE1180 for ; Wed, 7 Feb 2018 15:30:23 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl0-f67.google.com (mail-pl0-f67.google.com [209.85.160.67]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 564FB3F9 for ; Wed, 7 Feb 2018 15:30:23 +0000 (UTC) Received: by mail-pl0-f67.google.com with SMTP id q17-v6so224882pll.1 for ; Wed, 07 Feb 2018 07:30:23 -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=UDwY4w/VLD/EQskXHBWZwImGY7vkT+JXPYKIyvVMGFg=; b=A4g6VPv3sm9olJ1Igca9AqY2QVmA1fsQ1JVWHonj6dZ8FeABGIQbsdfOcyhNmClWE8 1FHXus/x+2nYwxwwCPmws8jZLBrateDqqEJCCM2q+184HY78D5s6kQ2y+/t2VHcKV/Ua rRyx9IlS/RZF0zIxCeiuLGvrymMa23bThhvrDwhNQt4kCS03cPfqiETq2tgnmzmGDjDj Vj72BDqov9pl5dgGjrRgA5G0dIEKIZzs8BatY3oF+SKO6wL1Gjr+7P8aEk8XCFSRgNIg eA7iA9f+B9lVzRKlcHtf6PDISxXS8TLGh3F2QVkKIgq8CFPd5I+eBFrC54l1ZeDR3JZx uRLw== 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=UDwY4w/VLD/EQskXHBWZwImGY7vkT+JXPYKIyvVMGFg=; b=Dmqo3yijWNqqORZ2jJGscqxQAp65L5yWtGGnxnoAqM9ne9ym6InXoX3uMLYV9atCLn M9489lFM7m/1BvJwRz43W79R5/7A1weYf7u7FOTqhgUjmnE4VNSvqINoe2Z0IzN+46O8 ogYkowOGVaiONEXD1SQQzy1PgeQt356yWQ+5bSY+LHPIskp+TfKZQs3X+w/S758iK+d7 TxJoSuNrJx6GRVUodsEMzcGfONj1HumdhRZmgaYfcdePs+lcZwn7t4RXJyQJo6TUbpJi 7pTPBjpu0f/dWl4zrrZ78fU9kLabl1HWRjjRsLo/7N5OxukRDqFhMa4bTcoAzJxsRKvq UD0g== X-Gm-Message-State: APf1xPAQLU/rj8rcDctkFdfPeB1PhK0TP9Gg2/P1kAJSnqmQUUUi0g7U 6Zn8rZsviiXmo+0zlTjvvLaXDw== X-Google-Smtp-Source: AH8x2258DiCMIPQY8soROeqkCgKhmQUtEAFzon/98kZPscyBR/hKFxDpO1JeFtvDigBar/BQvYsPow== X-Received: by 2002:a17:902:6c44:: with SMTP id h4-v6mr6458168pln.373.1518017422421; Wed, 07 Feb 2018 07:30:22 -0800 (PST) Received: from gizo.domain (184-100-240-187.ptld.qwest.net. [184.100.240.187]) by smtp.gmail.com with ESMTPSA id e88sm5176558pfl.80.2018.02.07.07.30.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 07:30:21 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Wed, 7 Feb 2018 07:30:04 -0800 Message-Id: <1518017410-31711-5-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1518017410-31711-1-git-send-email-gvrose8192@gmail.com> References: <1518017410-31711-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: Florian Westphal Subject: [ovs-dev] [PATCH V2 04/10] datapath: conntrack: make protocol tracker pointers const 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: Florian Westphal Upstream commit: commit b3480fe059ac9121b5714205b4ddae14b59ef4be Author: Florian Westphal Date: Sat Aug 12 00:57:08 2017 +0200 netfilter: conntrack: make protocol tracker pointers const Doesn't change generated code, but will make it easier to eventually make the actual trackers themselvers const. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Cc: Florian Westphal Signed-off-by: Greg Rose --- datapath/conntrack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datapath/conntrack.c b/datapath/conntrack.c index 3f79433..a75ae3c 100644 --- a/datapath/conntrack.c +++ b/datapath/conntrack.c @@ -613,8 +613,8 @@ static struct nf_conn * ovs_ct_find_existing(struct net *net, const struct nf_conntrack_zone *zone, u8 l3num, struct sk_buff *skb, bool natted) { - struct nf_conntrack_l3proto *l3proto; - struct nf_conntrack_l4proto *l4proto; + const struct nf_conntrack_l3proto *l3proto; + const struct nf_conntrack_l4proto *l4proto; struct nf_conntrack_tuple tuple; struct nf_conntrack_tuple_hash *h; struct nf_conn *ct; From patchwork Wed Feb 7 15:30:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 870424 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="neHx99zz"; 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 3zc52H1p36z9s4q for ; Thu, 8 Feb 2018 02:33:27 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 8258411D3; Wed, 7 Feb 2018 15:30: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 05AF711A2 for ; Wed, 7 Feb 2018 15:30:25 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl0-f67.google.com (mail-pl0-f67.google.com [209.85.160.67]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A169D516 for ; Wed, 7 Feb 2018 15:30:24 +0000 (UTC) Received: by mail-pl0-f67.google.com with SMTP id 11-v6so212824plc.9 for ; Wed, 07 Feb 2018 07:30:24 -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=g+vzTWQ6n1On+HtcTZ9+cQlxh0C8VU224aZTsIOCIwk=; b=neHx99zzhOwkJjBMJyQ7WO4JFlZIyuODPLPS5tPAgli81G3bj8gg1C36zJfZ0sKfYd q92frg5Ae0r2ay8M11staEfHLdAQKFGhMb0G9QGLLAMJbExZAXIkws3NGtHHNHCJjL6g zIv9MlStQboFecdJYa+9IlDJ5enSSy8CggfthLYbad+HDTUk8lq0GxHPB3v1WmU/3eav ljFfU15LrtjUi0U+wkJhhFpp73++tqF5fDAb+yDv0DW+IWHw16/vwaBmcXx746Yp9VZL UeSXblOVTzNXSpRKBn802n9WPmGJqdP5ZaUHYBP7O9I/+q6K0zyuP6wre0no97WcpM+u nUlw== 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=g+vzTWQ6n1On+HtcTZ9+cQlxh0C8VU224aZTsIOCIwk=; b=WxZHob3cDcnahbCtlJN3qjUVcE1mEGK9aaI3nJsqI9qTdAlG0hf8LgtER3OdAOSH+g HPG6qlnAWiEk9Lw6Uxf4hZ0owuct/Q9Mauu601OPmdJbSAhvgkA6lBRCOi8z6O3sQpfE cueKFMtwokTIbhEX7qcW9cXoog9GF4C866RISLWeIEtaXEakoVSFr5FI9gifHR/obsA0 jWKWBjYGUY8M4OLI83OdSwAXKcl34A1YqIYUfH/qdCxupxNhwg7yNCAC6VNmn+xxprgQ tTpkuVw1IbWgPqR5pfU7iJN8Y6oTDL6Ud0w+DH1QO3OaO5/1ip/xLC2WYRmRrUmyu0cg S/qA== X-Gm-Message-State: APf1xPDt97GLwMS/mSUxKc22nIrpADR8XXIVem4/15gbu1cgD1BtJZBx xOvyFko4op+sBpyblYaxhNur9Q== X-Google-Smtp-Source: AH8x225DwcGCj6II/Fdy23XdAeel6r1+k77PdxHPHIDtWBTgmqwa07QgKq/lstkywFaOEq3BLQekuA== X-Received: by 2002:a17:902:2cc3:: with SMTP id n61-v6mr6345285plb.440.1518017423908; Wed, 07 Feb 2018 07:30:23 -0800 (PST) Received: from gizo.domain (184-100-240-187.ptld.qwest.net. [184.100.240.187]) by smtp.gmail.com with ESMTPSA id e88sm5176558pfl.80.2018.02.07.07.30.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 07:30:22 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Wed, 7 Feb 2018 07:30:05 -0800 Message-Id: <1518017410-31711-6-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1518017410-31711-1-git-send-email-gvrose8192@gmail.com> References: <1518017410-31711-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 Subject: [ovs-dev] [PATCH V2 05/10] datapath: Fix SKB_GSO_UDP usage 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 Using SKB_GSO_UDP breaks the compilation on Linux 4.14. Check for the HAVE_SKB_GSO_UDP compiler #define. Signed-off-by: Greg Rose --- datapath/datapath.c | 9 ++++++--- datapath/linux/compat/stt.c | 11 ++++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index 1780819..a3fdd8f 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -339,8 +339,10 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb, const struct dp_upcall_info *upcall_info, uint32_t cutlen) { +#ifdef HAVE_SKB_GSO_UDP unsigned short gso_type = skb_shinfo(skb)->gso_type; struct sw_flow_key later_key; +#endif struct sk_buff *segs, *nskb; struct ovs_skb_cb ovs_cb; int err; @@ -352,7 +354,7 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb, return PTR_ERR(segs); if (segs == NULL) return -EINVAL; - +#ifdef HAVE_SKB_GSO_UDP if (gso_type & SKB_GSO_UDP) { /* The initial flow key extracted by ovs_flow_key_extract() * in this case is for a first fragment, so we need to @@ -361,14 +363,15 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb, later_key = *key; later_key.ip.frag = OVS_FRAG_TYPE_LATER; } - +#endif /* Queue all of the segments. */ skb = segs; do { *OVS_CB(skb) = ovs_cb; +#ifdef HAVE_SKB_GSO_UDP if (gso_type & SKB_GSO_UDP && skb != segs) key = &later_key; - +#endif err = queue_userspace_packet(dp, skb, key, upcall_info, cutlen); if (err) break; diff --git a/datapath/linux/compat/stt.c b/datapath/linux/compat/stt.c index 37d5f4b..66a97f2 100644 --- a/datapath/linux/compat/stt.c +++ b/datapath/linux/compat/stt.c @@ -81,8 +81,13 @@ struct stt_dev { #define STT_PROTO_TCP BIT(3) #define STT_PROTO_TYPES (STT_PROTO_IPV4 | STT_PROTO_TCP) +#ifdef HAVE_SKB_GSO_UDP #define SUPPORTED_GSO_TYPES (SKB_GSO_TCPV4 | SKB_GSO_UDP | SKB_GSO_DODGY | \ SKB_GSO_TCPV6) +#else +#define SUPPORTED_GSO_TYPES (SKB_GSO_TCPV4 | SKB_GSO_DODGY | \ + SKB_GSO_TCPV6) +#endif /* The length and offset of a fragment are encoded in the sequence number. * STT_SEQ_LEN_SHIFT is the left shift needed to store the length. @@ -1310,7 +1315,7 @@ static bool validate_checksum(struct sk_buff *skb) static bool set_offloads(struct sk_buff *skb) { struct stthdr *stth = stt_hdr(skb); - unsigned short gso_type; + unsigned short gso_type = 0; int l3_header_size; int l4_header_size; u16 csum_offset; @@ -1351,7 +1356,9 @@ static bool set_offloads(struct sk_buff *skb) case STT_PROTO_IPV4: /* UDP/IPv4 */ csum_offset = offsetof(struct udphdr, check); +#ifdef HAVE_SKB_GSO_UDP gso_type = SKB_GSO_UDP; +#endif l3_header_size = sizeof(struct iphdr); l4_header_size = sizeof(struct udphdr); skb->protocol = htons(ETH_P_IP); @@ -1359,7 +1366,9 @@ static bool set_offloads(struct sk_buff *skb) default: /* UDP/IPv6 */ csum_offset = offsetof(struct udphdr, check); +#ifdef HAVE_SKB_GSO_UDP gso_type = SKB_GSO_UDP; +#endif l3_header_size = sizeof(struct ipv6hdr); l4_header_size = sizeof(struct udphdr); skb->protocol = htons(ETH_P_IPV6); From patchwork Wed Feb 7 15:30:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 870425 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="KfGvbSJC"; 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 3zc52y0Hdrz9s4q for ; Thu, 8 Feb 2018 02:34:02 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 81FF811DF; Wed, 7 Feb 2018 15:30:28 +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 BD5D711DD for ; Wed, 7 Feb 2018 15:30:27 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl0-f65.google.com (mail-pl0-f65.google.com [209.85.160.65]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id AF74232F for ; Wed, 7 Feb 2018 15:30:26 +0000 (UTC) Received: by mail-pl0-f65.google.com with SMTP id j19-v6so222382pll.2 for ; Wed, 07 Feb 2018 07:30:26 -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=3x2Wdn52nZKqIEwgK9q486mRovIVeDxEEqteyL4FTtg=; b=KfGvbSJCTXbsj6QiZ5/iGsdPZXvCr23mxLqeMtQqSpTEWvMZvaS02o2lUdyE0RfRyC KzSgsmWQVrWEfsm33jkg1p6yMyx5hTOTEHz56HTNffXE2RVp4f4sMau4CbuU26vRfbUc GT/i+fXZ58nsZ0WmX/ksVRodQqsrHGzjZywtZgoRM0c79cBETkncwFhjyGq0SRxpat4z dF17hpAIuQijPgm9RxXmB7kJYpCN2KOH8LP0QkGemtgnnQH7xNVCIiaIPlnD0cCyrKMS 14VJar44nVK43jTT5Ac3Lqf8mR6ohGoNNH9xbr56DFOkjtmX1NRWGfAG2WCL89CwtUUQ ig7A== 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=3x2Wdn52nZKqIEwgK9q486mRovIVeDxEEqteyL4FTtg=; b=dRzwXP4NfQTnxPtqNwX1/V8awxxMov7PI5MArcWb50B24TIwrLWdnJLHoFengYIpA5 3XD9NeX46DiABC38P9w8kmz33BevQZiDvG2GozoGZ5i2xnY64GjVMNOqPWxsNdjfx3JV 9G9++5XIrc5R59iRnbkxravXnpKrzloStaUKvOO3+chQasp21ugj8PimMJPiBpgxf6wQ SSpqkDQOuylM4LqwuMmkqz93nOMg8xailM9KT116rTO84FB8ZiLMuizPMzVmayF82Xh6 rgoJta3XfXGGMRb5KaI5MBFYUumKPk/J0XAnkhoCzUKf3iNz12hc4ex1BrX4dKRiOkkj Aj7g== X-Gm-Message-State: APf1xPDbMVfkdLWULEJ3XHy7oVOW6WLl+RQOCKdQKniy29VhW3I8kdOS XI/UffDIKwETmTNNmf9uUryFgw== X-Google-Smtp-Source: AH8x224smwnPuGhyzfP0sBWE/fY6UqilaxdOJQCHemOZrd/mV4diaKVSPwo9HrZmPVQCGIHlhM0XvA== X-Received: by 2002:a17:902:7789:: with SMTP id o9-v6mr6406873pll.84.1518017425887; Wed, 07 Feb 2018 07:30:25 -0800 (PST) Received: from gizo.domain (184-100-240-187.ptld.qwest.net. [184.100.240.187]) by smtp.gmail.com with ESMTPSA id e88sm5176558pfl.80.2018.02.07.07.30.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 07:30:24 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Wed, 7 Feb 2018 07:30:06 -0800 Message-Id: <1518017410-31711-7-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1518017410-31711-1-git-send-email-gvrose8192@gmail.com> References: <1518017410-31711-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 Subject: [ovs-dev] [PATCH V2 06/10] compat: Fix compiler headers 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 Since Linux kernel upstream commit d15155824c50 ("linux/compiler.h: Split into compiler.h and compiler_types.h") this error check for the gcc compiler header is no longer valid. Remove so that openvswitch builds for linux kernels 4.14.8 and since. Signed-off-by: Greg Rose --- acinclude.m4 | 3 +++ datapath/linux/compat/include/linux/compiler-gcc.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index 768c20c..b8ac7db 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -798,6 +798,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_FIND_PARAM_IFELSE([$KSRC/include/linux/netdevice.h], [netdev_master_upper_dev_link], [extack], [OVS_DEFINE([HAVE_UPPER_DEV_LINK_EXTACK])]) + OVS_GREP_IFELSE([$KSRC/include/linux/compiler_types.h], + [__LINUX_COMPILER_TYPES_H], + [OVS_DEFINE([HAVE_LINUX_COMPILER_TYPES_H])]) 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/compiler-gcc.h b/datapath/linux/compat/include/linux/compiler-gcc.h index bf057f7..bfcd531 100644 --- a/datapath/linux/compat/include/linux/compiler-gcc.h +++ b/datapath/linux/compat/include/linux/compiler-gcc.h @@ -1,6 +1,8 @@ #ifndef __LINUX_COMPILER_H +#ifndef HAVE_LINUX_COMPILER_TYPES_H #error "Please don't include directly, include instead." #endif +#endif #include_next From patchwork Wed Feb 7 15:30:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 870426 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="A6nTOD2N"; 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 3zc53k2vnbz9s4q for ; Thu, 8 Feb 2018 02:34:42 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 56D571222; Wed, 7 Feb 2018 15:30:31 +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 35BAF11E7 for ; Wed, 7 Feb 2018 15:30:29 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl0-f68.google.com (mail-pl0-f68.google.com [209.85.160.68]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id CF4205A8 for ; Wed, 7 Feb 2018 15:30:28 +0000 (UTC) Received: by mail-pl0-f68.google.com with SMTP id g18-v6so216751plo.7 for ; Wed, 07 Feb 2018 07:30:28 -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=/JwnnjTGvgxZeNTHu03TKkaOzSwKSRCutAR4i3DtimY=; b=A6nTOD2NSn58xMLBO1CK6TFwG0sIWTYW/chz0OA6r5O0yiIPhu8TIoCXUgdIhIAQ2K e/iBZYRrN7MbvXT2vOxcrZ61sWtlWhW2nQeySu6OIOmN8FUxfeF7e8447GypELbx0yQ4 3RMZVUZUVhp/h2pW+7oXd9HP65Ii5Qf1BQcjDVM7vc7n8hK08aQyVPNAqOxS/R+za16S X5krmPuFkGDyt2YnIMpPYm9ruJPiv1pQeqNJJe+36ZbrC1GR82zzzSBK0bFkqCjYMH6U xGmHKTuQ/X4eg2zlUXBxP2RQuD0MCgM7adsladj7V/TUcpLcz7VODJ7kwICW3hF/AOfi Ksbg== 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=/JwnnjTGvgxZeNTHu03TKkaOzSwKSRCutAR4i3DtimY=; b=LLT/F7S6X80w4ebUskIolTz38ZgmqVgb5f/MLxbpgfADvQQvIL3pFeM0BYDoRa6/7l oVMrvBbMGNwHuhraA3LJ5aHMlMrK+1QhoJ1JOKBcBeOyfOPJOfaui1eVX0ackQ9xwIV6 ueK1k2tf7F2Z9zx3WsXuH4LNmyppn3LN1RUDcT6uAP7YB1p9QXvMA6cNc/yB5Wea/2VH xdKms4R95VmJY9Cr9gNpO8vGDYS0H1bXccz0Ma/gsPall5hLFZCfjj+BLBfIonra8ePM 2mipfixjP13oMeT18NWy0wwwefhDTC9/J03kwdCyuNLzOLOxARXaUTY7Px76wpj8sonI /FzA== X-Gm-Message-State: APf1xPB5ClND7J455hO5f6Dna0crwEq36N28o7oeCq0I9zQLQ39XJO1E J5+7PXHu5eeTyHX0dkyjGu5d3g== X-Google-Smtp-Source: AH8x227ty8lwjA76DLpuYpMrTEVElhEu6LQaWtb7oPsNLCdZFGbI6nzcpV8s9Rr5RrNjQnboHA6A4w== X-Received: by 2002:a17:902:507:: with SMTP id 7-v6mr6362772plf.0.1518017427828; Wed, 07 Feb 2018 07:30:27 -0800 (PST) Received: from gizo.domain (184-100-240-187.ptld.qwest.net. [184.100.240.187]) by smtp.gmail.com with ESMTPSA id e88sm5176558pfl.80.2018.02.07.07.30.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 07:30:26 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Wed, 7 Feb 2018 07:30:07 -0800 Message-Id: <1518017410-31711-8-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1518017410-31711-1-git-send-email-gvrose8192@gmail.com> References: <1518017410-31711-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: Christophe JAILLET Subject: [ovs-dev] [PATCH V2 07/10] datapath: Fix an error handling path in 'ovs_nla_init_match_and_action() 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: Christophe JAILLET Upstream commit: commit 5829e62ac17a40ab08c1b905565604a4b5fa7af6 Author: Christophe JAILLET Date: Mon Sep 11 21:56:20 2017 +0200 openvswitch: Fix an error handling path in 'ovs_nla_init_match_and_action()' All other error handling paths in this function go through the 'error' label. This one should do the same. Fixes: 9cc9a5cb176c ("datapath: Avoid using stack larger than 1024.") Signed-off-by: Christophe JAILLET Acked-by: Pravin B Shelar Signed-off-by: David S. Miller Cc: Christophe JAILLET Fixes: 850c2a4d1a ("datapath: Avoid using stack larger than 1024.") Signed-off-by: Greg Rose --- datapath/datapath.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index a3fdd8f..38a453b 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -1139,7 +1139,8 @@ static int ovs_nla_init_match_and_action(struct net *net, if (!a[OVS_FLOW_ATTR_KEY]) { OVS_NLERR(log, "Flow key attribute not present in set flow."); - return -EINVAL; + error = -EINVAL; + goto error; } *acts = get_flow_actions(net, a[OVS_FLOW_ATTR_ACTIONS], key, From patchwork Wed Feb 7 15:30:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 870428 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="ivNzHl4H"; 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 3zc54W6Lpnz9s4q for ; Thu, 8 Feb 2018 02:35:23 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 930A51226; Wed, 7 Feb 2018 15:30:32 +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 DCB331216 for ; Wed, 7 Feb 2018 15:30:31 +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 A31A85AB for ; Wed, 7 Feb 2018 15:30:30 +0000 (UTC) Received: by mail-pf0-f193.google.com with SMTP id k5so455461pff.3 for ; Wed, 07 Feb 2018 07:30:30 -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=9iBgrECN1IrR6XZAD3jYnE/6VVmw/ZpgtyPagScBth4=; b=ivNzHl4H68xdlJ0Ho5V2/ry4A9ygw3dwWk61O0T4sEzQQVN9gb8KJb6aTiozLtULCz 7JMF+8kveb9wO8JyYiCqu8Uq1StA1EJqU0vD8NhstR7DmA+qPpP6xGBysSAjTuCRTuKY ncIdR26OKi2QIyGlqKigdfP+eYgOR7/BLzxMwJ29n6Aw4V3ZkC+W3JBmCeEX64bPzC34 35sXwe3+fo+fw8kxBVpR1UqSQWc9z2qQCTnUP+PsYfIcVNmGUHZXQ6bbHZjaIALSLWTD xeCqRLLAWHFa7j13yfWODdXq9E6SFU27ZUOpbqpyyDY79pBp7cTjeQpLKj5MR3mK32PX 2Asg== 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=9iBgrECN1IrR6XZAD3jYnE/6VVmw/ZpgtyPagScBth4=; b=Gy1xwU5UP+FgGXfOET4SZtlWRI89Yh96/DAnYh1CLLO7h7H29V7gZv5Wf057NGiW/j /UxcKy5cxPd2k0piePwQAHV43qP2JB6FYCYDTouca7UJK2VK3XZUYxHRCG7BDaaP82gU uT9StJYhofLQiRvqG3Z8/qISOv7xRnQNo1ERRz2P7cppVH64TSOMSqrlnMCZa1uWnEjg zwFJGwOzo25iPA/Ch/65iK5eh0/iGIbfhEa8Ms1FCSzoBK5x7P/IQowfzAJsNBd/6421 onlIqyB6Nh/RPRp3EO9wu6YeOfdTPsXWtaN1sD4gCD4CfwrOJ/JS8F6/aJH6gHH+qt9D FiWA== X-Gm-Message-State: APf1xPAUksamCWro1GWxLj6D2660wqB1LrhDkpmo0g1+zkY35z7wh2uN pdG0RfDsAq4S+ugHJ0r4FEo/zA== X-Google-Smtp-Source: AH8x224HDgJJ9BWCkgOuiQz3atJRi06GpGNxihlGMc12rQNqYiqVAl1/OnS8HEMXi9NZm0zaCB1KpA== X-Received: by 10.99.99.5 with SMTP id x5mr5427043pgb.307.1518017429650; Wed, 07 Feb 2018 07:30:29 -0800 (PST) Received: from gizo.domain (184-100-240-187.ptld.qwest.net. [184.100.240.187]) by smtp.gmail.com with ESMTPSA id e88sm5176558pfl.80.2018.02.07.07.30.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 07:30:28 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Wed, 7 Feb 2018 07:30:08 -0800 Message-Id: <1518017410-31711-9-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1518017410-31711-1-git-send-email-gvrose8192@gmail.com> References: <1518017410-31711-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: "Gustavo A. R. Silva" Subject: [ovs-dev] [PATCH V2 08/10] datapath: fix data type in queue_gso_packets 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: "Gustavo A. R. Silva" Upstream commit: commit 2734166e89639c973c6e125ac8bcfc2d9db72b70 Author: Gustavo A. R. Silva Date: Sat Nov 25 13:14:40 2017 -0600 net: openvswitch: datapath: fix data type in queue_gso_packets gso_type is being used in binary AND operations together with SKB_GSO_UDP. The issue is that variable gso_type is of type unsigned short and SKB_GSO_UDP expands to more than 16 bits: SKB_GSO_UDP = 1 << 16 this makes any binary AND operation between gso_type and SKB_GSO_UDP to be always zero, hence making some code unreachable and likely causing undesired behavior. Fix this by changing the data type of variable gso_type to unsigned int. Addresses-Coverity-ID: 1462223 Fixes: 0c19f846d582 ("net: accept UFO datagrams from tuntap and packet") Signed-off-by: Gustavo A. R. Silva Acked-by: Willem de Bruijn Signed-off-by: David S. Miller While backporting this I found another couple of instances of the same issue so I fixed them up as well. Cc: Gustavo A. R. Silva Signed-off-by: Greg Rose --- datapath/datapath.c | 2 +- datapath/linux/compat/stt.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index 38a453b..6ee507a 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -340,7 +340,7 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb, uint32_t cutlen) { #ifdef HAVE_SKB_GSO_UDP - unsigned short gso_type = skb_shinfo(skb)->gso_type; + unsigned int gso_type = skb_shinfo(skb)->gso_type; struct sw_flow_key later_key; #endif struct sk_buff *segs, *nskb; diff --git a/datapath/linux/compat/stt.c b/datapath/linux/compat/stt.c index 66a97f2..2189476 100644 --- a/datapath/linux/compat/stt.c +++ b/datapath/linux/compat/stt.c @@ -1315,7 +1315,7 @@ static bool validate_checksum(struct sk_buff *skb) static bool set_offloads(struct sk_buff *skb) { struct stthdr *stth = stt_hdr(skb); - unsigned short gso_type = 0; + unsigned int gso_type = 0; int l3_header_size; int l4_header_size; u16 csum_offset; From patchwork Wed Feb 7 15:30:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 870431 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="NTUc97+Y"; 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 3zc5574xyLz9s82 for ; Thu, 8 Feb 2018 02:35:55 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 84FA31232; Wed, 7 Feb 2018 15:30:35 +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 514EE121E for ; Wed, 7 Feb 2018 15:30:33 +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 025BE32F for ; Wed, 7 Feb 2018 15:30:32 +0000 (UTC) Received: by mail-pg0-f65.google.com with SMTP id l18so410163pgc.5 for ; Wed, 07 Feb 2018 07:30:32 -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=fD2ukvzoH3qpi8xtlJTkK/y9qekoDZ7S+00J6QA/Mo0=; b=NTUc97+YunbwWAvr6l90G87+rTs+8wPDPAnhCBqbAomwjLj3oSBNxY5kZYXgxPwNCs 1qhzSRE1KdsU6idKyC4A9x3RSMpjBbdgdsSJZpkdN/4OdldGXK3iW/8npR3X4mRG/Aow Cof7ecM437NNiOSIfyZ6QTB90ZDNPOUVV4BvwDXx6R52Gwm/DLz9xqFHPWeHBQ6QZCix ORV77RBSsRqQtU0wxD68o/+aH6n92LaJT6gSWzIuLWav3mZMJDHqvxOzyFAa0UQGdGn/ Ji76FvHspg1l5VDRStr6XjgrN1S0WB+4wNx1Dxqd6b1dlAGS053N1y4VUYfYka0EpZbF 6sZA== 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=fD2ukvzoH3qpi8xtlJTkK/y9qekoDZ7S+00J6QA/Mo0=; b=dcns6OcifkSxiOVxhFOUa/Qj3cpkyovn8/1Dd1eyIl6Qn3k3HYTqqcGMD4zSIfLFrp FEeTy9vSMA3501GfNBYL0WiSFOuGblTHbGuRwXKDei1NVyzCxYOfS5Ig5YBeeuG9i+q6 gr+w7gvxgdS6aGZ/LnCLxyrd+K7mwrde1IXhOmZS4cMsLio0vz7W7onklO64hiSDo3kF 79Qi6xYqsJzKvtVSbmG/kkQ8HmwwMUWBe0pzf8d00xv431Tz44+UBjjdoc1s3ALwZ8dC KNcjQdizfvmtk/6PvOoN7zq26jB66WZup7AcTguWBR2eS+6DJ99y4XwbN8+lFm6YitP8 uPPw== X-Gm-Message-State: APf1xPCCEmhjVl82nGpZbW+2mvtfWJTiW1HhzmrO/1kKyWbne4OMwdjv ybgCyQLXyImSpInonguwU/wzBA== X-Google-Smtp-Source: AH8x224FNkABSzZ0n501xHS0pffXs66uhtNrVo7Uuq9ypn6n2s8vzOszAdl7r64uAuCOwsfHRf6Z0g== X-Received: by 10.101.77.140 with SMTP id p12mr5150457pgq.195.1518017432040; Wed, 07 Feb 2018 07:30:32 -0800 (PST) Received: from gizo.domain (184-100-240-187.ptld.qwest.net. [184.100.240.187]) by smtp.gmail.com with ESMTPSA id e88sm5176558pfl.80.2018.02.07.07.30.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 07:30:30 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Wed, 7 Feb 2018 07:30:09 -0800 Message-Id: <1518017410-31711-10-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1518017410-31711-1-git-send-email-gvrose8192@gmail.com> References: <1518017410-31711-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: zhangliping Subject: [ovs-dev] [PATCH V2 09/10] datapath: fix the incorrect flow action alloc size 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: zhangliping Upstream commit: commit 67c8d22a73128ff910e2287567132530abcf5b71 Author: zhangliping Date: Sat Nov 25 22:02:12 2017 +0800 openvswitch: fix the incorrect flow action alloc size If we want to add a datapath flow, which has more than 500 vxlan outputs' action, we will get the following error reports: openvswitch: netlink: Flow action size 32832 bytes exceeds max openvswitch: netlink: Flow action size 32832 bytes exceeds max openvswitch: netlink: Actions may not be safe on all matching packets ... ... It seems that we can simply enlarge the MAX_ACTIONS_BUFSIZE to fix it, but this is not the root cause. For example, for a vxlan output action, we need about 60 bytes for the nlattr, but after it is converted to the flow action, it only occupies 24 bytes. This means that we can still support more than 1000 vxlan output actions for a single datapath flow under the the current 32k max limitation. So even if the nla_len(attr) is larger than MAX_ACTIONS_BUFSIZE, we shouldn't report EINVAL and keep it move on, as the judgement can be done by the reserve_sfa_size. Signed-off-by: zhangliping Acked-by: Pravin B Shelar Signed-off-by: David S. Miller Cc: zhangliping Signed-off-by: Greg Rose --- datapath/flow_netlink.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/datapath/flow_netlink.c b/datapath/flow_netlink.c index 303337c..80c57bd 100644 --- a/datapath/flow_netlink.c +++ b/datapath/flow_netlink.c @@ -1909,14 +1909,11 @@ int ovs_nla_put_mask(const struct sw_flow *flow, struct sk_buff *skb) #define MAX_ACTIONS_BUFSIZE (32 * 1024) #endif -static struct sw_flow_actions *nla_alloc_flow_actions(int size, bool log) +static struct sw_flow_actions *nla_alloc_flow_actions(int size) { struct sw_flow_actions *sfa; - if (size > MAX_ACTIONS_BUFSIZE) { - OVS_NLERR(log, "Flow action size %u bytes exceeds max", size); - return ERR_PTR(-EINVAL); - } + WARN_ON_ONCE(size > MAX_ACTIONS_BUFSIZE); sfa = kmalloc(sizeof(*sfa) + size, GFP_KERNEL); if (!sfa) @@ -1989,12 +1986,15 @@ static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa, new_acts_size = ksize(*sfa) * 2; if (new_acts_size > MAX_ACTIONS_BUFSIZE) { - if ((MAX_ACTIONS_BUFSIZE - next_offset) < req_size) + if ((MAX_ACTIONS_BUFSIZE - next_offset) < req_size) { + OVS_NLERR(log, "Flow action size exceeds max %u", + MAX_ACTIONS_BUFSIZE); return ERR_PTR(-EMSGSIZE); + } new_acts_size = MAX_ACTIONS_BUFSIZE; } - acts = nla_alloc_flow_actions(new_acts_size, log); + acts = nla_alloc_flow_actions(new_acts_size); if (IS_ERR(acts)) return (void *)acts; @@ -2673,7 +2673,7 @@ int ovs_nla_copy_actions(struct net *net, const struct nlattr *attr, { int err; - *sfa = nla_alloc_flow_actions(nla_len(attr), log); + *sfa = nla_alloc_flow_actions(min(nla_len(attr), MAX_ACTIONS_BUFSIZE)); if (IS_ERR(*sfa)) return PTR_ERR(*sfa); From patchwork Wed Feb 7 15:30:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 870433 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="meNVMCAb"; 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 3zc55l5MXCz9s4q for ; Thu, 8 Feb 2018 02:36:27 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 641091213; Wed, 7 Feb 2018 15:30:37 +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 3EC93122E for ; Wed, 7 Feb 2018 15:30:35 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 80BD8579 for ; Wed, 7 Feb 2018 15:30:34 +0000 (UTC) Received: by mail-pg0-f68.google.com with SMTP id s73so415227pgc.1 for ; Wed, 07 Feb 2018 07:30:34 -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=G6j6zd5VXzYwBar0IlBxWXW6rHYpgYE7jYiFScZK4CI=; b=meNVMCAbTWVpvOt8HhIf0i/bUkglNlgkNrWX2ge2stCbVICFPZrG9PVDAH9GO25SHP mRB827LTG5QxLyhBROLUt9H0QKRN+k2Vr9I53iuwIZ+Av2LZylc2xeA2wt/7kPO4/Dob 8eDuT6tMuluEO1eJIhuTd0mxBPi+XpxESgodPE60QdMldN+QHDltBcFychwBFqUDkhkO K9LtbgLBDuWD9I98y65EDv+J8OziAHyiZZNTkaj7CuB/oaAAEl6Y5Y+XhuX63ix/2TOd FOZCAtFk9Mzdvs9T+32j3vLpYA2jn7kgf73ae4nFy/7BeaM8jKhTmJANcZi86arI9sz7 /3Yg== 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=G6j6zd5VXzYwBar0IlBxWXW6rHYpgYE7jYiFScZK4CI=; b=OF0I+mkdbl1ZLGRGSyxH+Q4YIJAPR8iB+yVyk+GmsA9F8aOdfb2l861XsEIOOJNw5R cmBDwwu+uKcoHIAqou9CCwxJKul1Flgd0Tnn0TIDYZ/B2vIhkpjKnkK8u3SOmYVBSCb4 jcuwNyNOnwaHeViBdm0JG7UKDEIFkNRrdUThoMOevJoCZRxfm57oVIxx7iCldBBMVLoq mIosvavokVkKMCGM1cXt12JYn2XCSXdZWUuzUH7aH/WPo6C+JsYmOHzq+skXjeaNeuwV z1/nJzVV5TmMXRSPLvtKfXpgoEnXAFDSV19hkrBs/YOzSGQ0pn2YMhq/iSEkP5SP6w25 gZzA== X-Gm-Message-State: APf1xPD/qSgW3spV5w0RsE2rkuegwBCem7rl2hKDm0Rbr4NQh0ypsjSp BwWCaFREP3R7fs9YbSPmtP0BPA== X-Google-Smtp-Source: AH8x227wxEeUKPk3gEapxYsAF2egpNt9CT0PO7ttL8GgtVd+O1ZyjoPi3c3Hg5j6ttoJvp4oHIWZjA== X-Received: by 10.98.100.139 with SMTP id y133mr6389455pfb.68.1518017433685; Wed, 07 Feb 2018 07:30:33 -0800 (PST) Received: from gizo.domain (184-100-240-187.ptld.qwest.net. [184.100.240.187]) by smtp.gmail.com with ESMTPSA id e88sm5176558pfl.80.2018.02.07.07.30.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 07:30:32 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Wed, 7 Feb 2018 07:30:10 -0800 Message-Id: <1518017410-31711-11-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1518017410-31711-1-git-send-email-gvrose8192@gmail.com> References: <1518017410-31711-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: Arnd Bergmann Subject: [ovs-dev] [PATCH V2 10/10] datapath: use ktime_get_ts64() instead of ktime_get_ts() 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: Arnd Bergmann Upstream commit: commit 311af51dcb5629f04976a8e451673f77e3301041 Author: Arnd Bergmann Date: Mon Nov 27 12:41:38 2017 +0100 openvswitch: use ktime_get_ts64() instead of ktime_get_ts() timespec is deprecated because of the y2038 overflow, so let's convert this one to ktime_get_ts64(). The code is already safe even on 32-bit architectures, since it uses monotonic times. On 64-bit architectures, nothing changes, while on 32-bit architectures this avoids one type conversion. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller Additional compatability check for ktime_get_ts64() exists or not. If not, then just continue using ktime_get_ts(). I added a new compatability header file "timekeeping.h". Cc: Arnd Bergmann Signed-off-by: Greg Rose --- acinclude.m4 | 3 +++ datapath/flow.c | 7 ++++--- datapath/linux/Modules.mk | 1 + datapath/linux/compat/include/linux/timekeeping.h | 11 +++++++++++ 4 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 datapath/linux/compat/include/linux/timekeeping.h diff --git a/acinclude.m4 b/acinclude.m4 index b8ac7db..6d440f8 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -801,6 +801,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_GREP_IFELSE([$KSRC/include/linux/compiler_types.h], [__LINUX_COMPILER_TYPES_H], [OVS_DEFINE([HAVE_LINUX_COMPILER_TYPES_H])]) + OVS_GREP_IFELSE([$KSRC/include/linux/timekeeping.h], + [ktime_get_ts64], + [OVS_DEFINE([HAVE_KTIME_GET_TS64])]) if cmp -s datapath/linux/kcompat.h.new \ datapath/linux/kcompat.h >/dev/null 2>&1; then diff --git a/datapath/flow.c b/datapath/flow.c index 5da7e3e..1684762 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -54,12 +55,12 @@ u64 ovs_flow_used_time(unsigned long flow_jiffies) { - struct timespec cur_ts; + struct timespec64 cur_ts; u64 cur_ms, idle_ms; - ktime_get_ts(&cur_ts); + ktime_get_ts64(&cur_ts); idle_ms = jiffies_to_msecs(jiffies - flow_jiffies); - cur_ms = (u64)cur_ts.tv_sec * MSEC_PER_SEC + + cur_ms = (u64)(u32)cur_ts.tv_sec * MSEC_PER_SEC + cur_ts.tv_nsec / NSEC_PER_MSEC; return cur_ms - idle_ms; diff --git a/datapath/linux/Modules.mk b/datapath/linux/Modules.mk index eec9f23..0fc4132 100644 --- a/datapath/linux/Modules.mk +++ b/datapath/linux/Modules.mk @@ -64,6 +64,7 @@ openvswitch_headers += \ linux/compat/include/linux/u64_stats_sync.h \ linux/compat/include/linux/udp.h \ linux/compat/include/linux/workqueue.h \ + linux/compat/include/linux/timekeeping.h \ linux/compat/include/net/checksum.h \ linux/compat/include/net/dst.h \ linux/compat/include/net/dst_cache.h \ diff --git a/datapath/linux/compat/include/linux/timekeeping.h b/datapath/linux/compat/include/linux/timekeeping.h new file mode 100644 index 0000000..3a3b183 --- /dev/null +++ b/datapath/linux/compat/include/linux/timekeeping.h @@ -0,0 +1,11 @@ +#ifndef _LINUX_TIMEKEEPING_WRAPPER_H +#define _LINUX_TIMEKEEPING_WRAPPER_H + +#ifndef HAVE_KTIME_GET_TS64 +#define ktime_get_ts64 ktime_get_ts +#define timespec64 timespec +#else +#include_next +#endif + +#endif