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 From patchwork Mon Jun 10 23:43:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 1113390 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="RM6d22OH"; 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 45N8qg3J3vz9sNC for ; Tue, 11 Jun 2019 09:44:31 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 5F94711CA; Mon, 10 Jun 2019 23:43: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 B151711BC for ; Mon, 10 Jun 2019 23:43:26 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 91F336D6 for ; Mon, 10 Jun 2019 23:43:25 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id z23so921033wma.4 for ; Mon, 10 Jun 2019 16:43:25 -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=dCNHGe3lr/oNfG3rbZ+s/IXgCkZSwpizG38BM+zl/3Q=; b=RM6d22OHxtDvhssZEDaECEoeaLqSStuVH46+Yvyks+XkWJy/H9cNsshS+tPlrcCNgh 7dfEuDuQ2KPuB0AsWt/Bw65lb7+thZwY1LK7rlc4H46frhBBpyxpr9D4Nk0W/iyaVpey wWMQQJLwYp0WY5B7R4ue41+FH8P9vsibXH9TRmbXfGNZ2qgFPLLqscCwfbTQ/xOE9El5 YtqjHuRKlp7ySj8MrjFNf0ReNYpm13sXvxwh1dHq5X9Bfug0SyISB8o1/lSaJXzMguHN QBHHhJysm7LJJMfTP2KFRE6WjgwX8epx3yPltIGHozTrZrkbgWGDGIxrHYebO9SARc7B Ozrw== 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=dCNHGe3lr/oNfG3rbZ+s/IXgCkZSwpizG38BM+zl/3Q=; b=iUHq4wiGB4JHBTuqFCcAhC0Q4vw2uH5XTxyRZ13ddAmF9gu1jZo3VR/YRmd4JvvV1v yY/aU9FPO/NRPTbLe0SpjaNZMpo9d9EmncZwJ8b6I95tYnxr0/z4a1LjZhT9eIR+EZsp T4lEf4gZV/rWqAJiQ2Qdn2iAmsBBzH0jADwlT27+maJBG0ZcdotBje8F4tU0W5lyHrON cED3pI6lDoI0Q1kR42zf/ijBoH9ZHEq1AZzShVRNkcFKeaZz0ISQEPRlDs+A4EBM93/j 6rsUrYNMNh8JRvn00NHhorSYQtqD89q3yRwca1RLz+XpBRZPXkd3UxguFqtJeQBC38aU HPwA== X-Gm-Message-State: APjAAAWVO4TgCGkjQzmWpS7r0NKzmgTD++5sR5XdnNLV3R2iXd2/X4Mx ZGzkvXcGQYoaA7fkUk8gIETK7FVP/Bc= X-Google-Smtp-Source: APXvYqxcVUVK4etqNToGDkkDbSIMbg/KHZRS0MvYYEN4tEUyUg9CBg0NLUO7jpHrCbSisnuvjrSkZQ== X-Received: by 2002:a1c:7408:: with SMTP id p8mr14521566wmc.161.1560210203786; Mon, 10 Jun 2019 16:43:23 -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.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Jun 2019 16:43:23 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Mon, 10 Jun 2019 16:43:08 -0700 Message-Id: <1560210191-9414-3-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> 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 Cc: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [ovs-dev] [PATCH 2/5] OVS: remove use of VLAN_TAG_PRESENT 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 From: Michał Mirosław Upstream commit: commit 9df46aefafa6dee81a27c2a9d8ba360abd8c5fe3 Author: Michał Mirosław Date: Thu Nov 8 18:44:50 2018 +0100 OVS: remove use of VLAN_TAG_PRESENT This is a minimal change to allow removing of VLAN_TAG_PRESENT. It leaves OVS unable to use CFI bit, as fixing this would need a deeper surgery involving userspace interface. Signed-off-by: Michał Mirosław Signed-off-by: David S. Miller This patch backports the above upstream patch to OVS and adds extra checking in kernel module's compat code. Cc: Michał Mirosław Signed-off-by: Yifeng Sun Acked-by: Yi-Hung Wei --- acinclude.m4 | 4 ++++ datapath/actions.c | 13 +++++++++---- datapath/flow.c | 6 +++--- datapath/flow.h | 2 +- datapath/flow_netlink.c | 22 +++++++++++----------- datapath/linux/compat/include/linux/if_vlan.h | 19 +++++++++++++++++++ 6 files changed, 47 insertions(+), 19 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 6783512a68f3..eb978e0fae6c 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -511,6 +511,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_GREP_IFELSE([$KSRC/include/linux/if_link.h], [rtnl_link_stats64]) OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [vlan_set_encap_proto]) OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [vlan_hwaccel_push_inside]) + OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [__vlan_hwaccel_clear_tag]) OVS_GREP_IFELSE([$KSRC/include/linux/in.h], [ipv4_is_multicast]) OVS_GREP_IFELSE([$KSRC/include/linux/in.h], [proto_ports_offset]) @@ -925,6 +926,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/skbuff.h], [sk_buff], [csum_valid], [OVS_DEFINE([HAVE_SKBUFF_CSUM_VALID])]) + OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/skbuff.h], [sk_buff], + [vlan_present], + [OVS_DEFINE([HAVE_SKBUFF_VLAN_PRESENT])]) OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_checksum_simple_validate]) OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], diff --git a/datapath/actions.c b/datapath/actions.c index f5db12389889..5a1d3206a101 100644 --- a/datapath/actions.c +++ b/datapath/actions.c @@ -306,7 +306,7 @@ static int push_vlan(struct sk_buff *skb, struct sw_flow_key *key, key->eth.vlan.tpid = vlan->vlan_tpid; } return skb_vlan_push(skb, vlan->vlan_tpid, - ntohs(vlan->vlan_tci) & ~VLAN_TAG_PRESENT); + ntohs(vlan->vlan_tci) & ~VLAN_CFI_MASK); } /* 'src' is already properly masked. */ @@ -828,8 +828,10 @@ static int ovs_vport_output(OVS_VPORT_OUTPUT_PARAMS) __skb_dst_copy(skb, data->dst); *OVS_GSO_CB(skb) = data->cb; ovs_skb_set_inner_protocol(skb, data->inner_protocol); - skb->vlan_tci = data->vlan_tci; - skb->vlan_proto = data->vlan_proto; + if (data->vlan_tci & VLAN_CFI_MASK) + __vlan_hwaccel_put_tag(skb, data->vlan_proto, data->vlan_tci & ~VLAN_CFI_MASK); + else + __vlan_hwaccel_clear_tag(skb); /* Reconstruct the MAC header. */ skb_push(skb, data->l2_len); @@ -873,7 +875,10 @@ static void prepare_frag(struct vport *vport, struct sk_buff *skb, data->cb = *OVS_GSO_CB(skb); data->inner_protocol = ovs_skb_get_inner_protocol(skb); data->network_offset = orig_network_offset; - data->vlan_tci = skb->vlan_tci; + if (skb_vlan_tag_present(skb)) + data->vlan_tci = skb_vlan_tag_get(skb) | VLAN_CFI_MASK; + else + data->vlan_tci = 0; data->vlan_proto = skb->vlan_proto; data->mac_proto = mac_proto; data->l2_len = hlen; diff --git a/datapath/flow.c b/datapath/flow.c index f6a95f9fd86c..618c25e0c3ad 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -327,7 +327,7 @@ static int parse_vlan_tag(struct sk_buff *skb, struct vlan_head *key_vh, return -ENOMEM; vh = (struct vlan_head *)skb->data; - key_vh->tci = vh->tci | htons(VLAN_TAG_PRESENT); + key_vh->tci = vh->tci | htons(VLAN_CFI_MASK); key_vh->tpid = vh->tpid; if (unlikely(untag_vlan)) { @@ -365,7 +365,7 @@ static int parse_vlan(struct sk_buff *skb, struct sw_flow_key *key) key->eth.cvlan.tpid = 0; if (skb_vlan_tag_present(skb)) { - key->eth.vlan.tci = htons(skb->vlan_tci); + key->eth.vlan.tci = htons(skb->vlan_tci) | htons(VLAN_CFI_MASK); key->eth.vlan.tpid = skb->vlan_proto; } else { /* Parse outer vlan tag in the non-accelerated case. */ @@ -604,7 +604,7 @@ static int key_extract(struct sk_buff *skb, struct sw_flow_key *key) * skb_vlan_pop(), which will later shift the ethertype into * skb->protocol. */ - if (key->eth.cvlan.tci & htons(VLAN_TAG_PRESENT)) + if (key->eth.cvlan.tci & htons(VLAN_CFI_MASK)) skb->protocol = key->eth.cvlan.tpid; else skb->protocol = key->eth.type; diff --git a/datapath/flow.h b/datapath/flow.h index 87e212fdfd9f..4884c006c786 100644 --- a/datapath/flow.h +++ b/datapath/flow.h @@ -59,7 +59,7 @@ struct ovs_tunnel_info { struct vlan_head { __be16 tpid; /* Vlan type. Generally 802.1q or 802.1ad.*/ - __be16 tci; /* 0 if no VLAN, VLAN_TAG_PRESENT set otherwise. */ + __be16 tci; /* 0 if no VLAN, VLAN_CFI_MASK set otherwise. */ }; #define OVS_SW_FLOW_KEY_METADATA_SIZE \ diff --git a/datapath/flow_netlink.c b/datapath/flow_netlink.c index c4704a5b3041..0f7ab53fc141 100644 --- a/datapath/flow_netlink.c +++ b/datapath/flow_netlink.c @@ -993,9 +993,9 @@ static int validate_vlan_from_nlattrs(const struct sw_flow_match *match, if (a[OVS_KEY_ATTR_VLAN]) tci = nla_get_be16(a[OVS_KEY_ATTR_VLAN]); - if (!(tci & htons(VLAN_TAG_PRESENT))) { + if (!(tci & htons(VLAN_CFI_MASK))) { if (tci) { - OVS_NLERR(log, "%s TCI does not have VLAN_TAG_PRESENT bit set.", + OVS_NLERR(log, "%s TCI does not have VLAN_CFI_MASK bit set.", (inner) ? "C-VLAN" : "VLAN"); return -EINVAL; } else if (nla_len(a[OVS_KEY_ATTR_ENCAP])) { @@ -1016,9 +1016,9 @@ static int validate_vlan_mask_from_nlattrs(const struct sw_flow_match *match, __be16 tci = 0; __be16 tpid = 0; bool encap_valid = !!(match->key->eth.vlan.tci & - htons(VLAN_TAG_PRESENT)); + htons(VLAN_CFI_MASK)); bool i_encap_valid = !!(match->key->eth.cvlan.tci & - htons(VLAN_TAG_PRESENT)); + htons(VLAN_CFI_MASK)); if (!(key_attrs & (1 << OVS_KEY_ATTR_ENCAP))) { /* Not a VLAN. */ @@ -1042,8 +1042,8 @@ static int validate_vlan_mask_from_nlattrs(const struct sw_flow_match *match, (inner) ? "C-VLAN" : "VLAN", ntohs(tpid)); return -EINVAL; } - if (!(tci & htons(VLAN_TAG_PRESENT))) { - OVS_NLERR(log, "%s TCI mask does not have exact match for VLAN_TAG_PRESENT bit.", + if (!(tci & htons(VLAN_CFI_MASK))) { + OVS_NLERR(log, "%s TCI mask does not have exact match for VLAN_CFI_MASK bit.", (inner) ? "C-VLAN" : "VLAN"); return -EINVAL; } @@ -1098,7 +1098,7 @@ static int parse_vlan_from_nlattrs(struct sw_flow_match *match, if (err) return err; - encap_valid = !!(match->key->eth.vlan.tci & htons(VLAN_TAG_PRESENT)); + encap_valid = !!(match->key->eth.vlan.tci & htons(VLAN_CFI_MASK)); if (encap_valid) { err = __parse_vlan_from_nlattrs(match, key_attrs, true, a, is_mask, log); @@ -3034,7 +3034,7 @@ static int __ovs_nla_copy_actions(struct net *net, const struct nlattr *attr, vlan = nla_data(a); if (!eth_type_vlan(vlan->vlan_tpid)) return -EINVAL; - if (!(vlan->vlan_tci & htons(VLAN_TAG_PRESENT))) + if (!(vlan->vlan_tci & htons(VLAN_CFI_MASK))) return -EINVAL; vlan_tci = vlan->vlan_tci; break; @@ -3050,7 +3050,7 @@ static int __ovs_nla_copy_actions(struct net *net, const struct nlattr *attr, /* Prohibit push MPLS other than to a white list * for packets that have a known tag order. */ - if (vlan_tci & htons(VLAN_TAG_PRESENT) || + if (vlan_tci & htons(VLAN_CFI_MASK) || (eth_type != htons(ETH_P_IP) && eth_type != htons(ETH_P_IPV6) && eth_type != htons(ETH_P_ARP) && @@ -3062,7 +3062,7 @@ static int __ovs_nla_copy_actions(struct net *net, const struct nlattr *attr, } case OVS_ACTION_ATTR_POP_MPLS: - if (vlan_tci & htons(VLAN_TAG_PRESENT) || + if (vlan_tci & htons(VLAN_CFI_MASK) || !eth_p_mpls(eth_type)) return -EINVAL; @@ -3127,7 +3127,7 @@ static int __ovs_nla_copy_actions(struct net *net, const struct nlattr *attr, case OVS_ACTION_ATTR_POP_ETH: if (mac_proto != MAC_PROTO_ETHERNET) return -EINVAL; - if (vlan_tci & htons(VLAN_TAG_PRESENT)) + if (vlan_tci & htons(VLAN_CFI_MASK)) return -EINVAL; mac_proto = MAC_PROTO_NONE; break; diff --git a/datapath/linux/compat/include/linux/if_vlan.h b/datapath/linux/compat/include/linux/if_vlan.h index 2cf18e5fa3f3..4e9cc48500f1 100644 --- a/datapath/linux/compat/include/linux/if_vlan.h +++ b/datapath/linux/compat/include/linux/if_vlan.h @@ -53,6 +53,25 @@ static inline struct sk_buff *rpl_vlan_insert_tag_set_proto(struct sk_buff *skb, } #endif +#ifndef HAVE_VLAN_HWACCEL_CLEAR_TAG +/** + * __vlan_hwaccel_clear_tag - clear hardware accelerated VLAN info + * @skb: skbuff to clear + * + * Clears the VLAN information from @skb + */ +#define __vlan_hwaccel_clear_tag rpl_vlan_hwaccel_clear_tag +static inline void rpl_vlan_hwaccel_clear_tag(struct sk_buff *skb) +{ +#ifdef HAVE_SKBUFF_VLAN_PRESENT + skb->vlan_present = 0; +#else + skb->vlan_tci = 0; + skb->vlan_proto = 0; +#endif +} +#endif + #ifndef HAVE_VLAN_HWACCEL_PUSH_INSIDE /* From patchwork Mon Jun 10 23:43:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 1113391 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="sExBnAWi"; 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 45N8rJ4ywnz9sNC for ; Tue, 11 Jun 2019 09:45:04 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 25A3911BE; Mon, 10 Jun 2019 23:43:29 +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 5156D11C4 for ; Mon, 10 Jun 2019 23:43:27 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id D071B6D6 for ; Mon, 10 Jun 2019 23:43:26 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id 207so976081wma.1 for ; Mon, 10 Jun 2019 16:43:26 -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=8XUooHVoPf2lEhWYVYQQmvZ7/S2ll3Sadms3YhABwzk=; b=sExBnAWif+MzQzvuJ2kO2QHr6vKdNXE0MlNdOTKpcAXTFwnka8R5uoWWswrjbWOnic 1UyRc42KeccYc2iDVVov7bnt6iH+Z8daVPnVxlGdikX2YrHjLB+ilaVlcsNP8F+2in69 K9AUR8IoJgOO6zaeOcetQbIEkyhbbX5YCiFBG9Y0uSO958448yy7oUic89PgFLdeSouK RNyF4kG9XceOT/i9QCYJXraI3QLidM6ZUfphOLFby/Trbl4YRWsvaHEaY3o4moHW2Kau Z5XlYn/ojfw7UTQuvLHiCfbeqtlISLyg4BluBiwJWLFUUKNtnrYS+RGxmixF2nixeBjy NzNQ== 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=8XUooHVoPf2lEhWYVYQQmvZ7/S2ll3Sadms3YhABwzk=; b=l6bn5ErRsrDdypa22UCqyexhohNNZlLoyIcgTExDDSIL4Iuv9oviCgAwPUFIj5nwTQ vaYrsqJuYlouRQhsq940/u349Pza0bSZiGZDpFchZIrLcXkLvyRyk1aFHxFGoahlfsHU 7kgPpjiNgYgX6ucnXgqhYTz6o4smovnHk7EII/Oc9X+C6NaYpxg0qX0mLne7jU6gVMgP TKQkQGbjJnp9aT7cpBJ5S2FWlshs5vjFX5/espJEK13TbGnSIoW9qB6ir6ANQtNEgQ/N Y7E1M6RYHlFkmLjf6SnIjxpSTvBYGpGBWYENt4azdHGe1V47hzuTxsR6mHwiuUA2fK8W TLRg== X-Gm-Message-State: APjAAAU8s8cl/sfGjO+6BZRFCd2De3C0IMUL6rqcuGokufjy1raJ/eK4 GqG/Cbn3TW+qklVXNcxMbXOXZw+wy/M= X-Google-Smtp-Source: APXvYqwptnxoB4ypTArDUVBQppH4hwbUnkE3Mqab7vajqJAM3zqYuQw3bPTR8t8QfTB954dh9z0RbQ== X-Received: by 2002:a05:600c:2189:: with SMTP id e9mr9047572wme.56.1560210205262; Mon, 10 Jun 2019 16:43:25 -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.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Jun 2019 16:43:24 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Mon, 10 Jun 2019 16:43:09 -0700 Message-Id: <1560210191-9414-4-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 3/5] datapath: Backport the removal of __tcp_checksum_complete() 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 6ab6dfa6bb500f5cbb9b7a0f23a1613417ca2d12 ("net: get rid of __tcp_checksum_complete())" deleted __tcp_checksum_complete() and caused compilation failure for OVS on newer kernels. This patch fixes it by using __skb_checksum_complete(), which is 100% the same with __tcp_checksum_complete(). Signed-off-by: Yifeng Sun Acked-by: Yi-Hung Wei --- datapath/linux/compat/stt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapath/linux/compat/stt.c b/datapath/linux/compat/stt.c index 5f045120ed20..21fef09f4329 100644 --- a/datapath/linux/compat/stt.c +++ b/datapath/linux/compat/stt.c @@ -1299,7 +1299,7 @@ static bool validate_checksum(struct sk_buff *skb) skb->csum = csum_tcpudp_nofold(iph->saddr, iph->daddr, skb->len, IPPROTO_TCP, 0); - return __tcp_checksum_complete(skb) == 0; + return __skb_checksum_complete(skb) == 0; } static bool set_offloads(struct sk_buff *skb) From patchwork Mon Jun 10 23:43:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 1113392 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="VKNurehl"; 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 45N8rs0TJbz9sNC for ; Tue, 11 Jun 2019 09:45:33 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id D07B511E3; Mon, 10 Jun 2019 23:43:30 +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 7BDBA11D7 for ; Mon, 10 Jun 2019 23:43:29 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A8BAD6D6 for ; Mon, 10 Jun 2019 23:43:28 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id s3so974555wms.2 for ; Mon, 10 Jun 2019 16:43:28 -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=w7o8JtkU4if1h8iGNK+Uod0+wV9PXUgjjQWiZ+6YeuM=; b=VKNurehlPuKg1TdqtJXZ9Oia2/V5ocAXZkYg3CAafr3VzGOMZPJWzXw0ix7CSDhAe4 dH/ZKL89Uc+P76GBtMREi9qHu9dU1dTsQJujp0CEwCKfeZYAd/xaCpqveoLoORnzqt1Y LEdjLc3cpASk3zkCIifPO1d+swqo8P9IasaEcqNEJ/V7uSylzITYQP52TkaDoQo9lGiq UxmPWlli6u19QpslruxBlf0idNhqDTXK9cZ7rMbGA4fgdUq3yantVZ91Czj86e01ankF hl1zzrb4kDwEMm0nR3z6jJOa7+U243XNaqkNyGRdw6+CzrZiggClv3WdpcIvGazENuhG Ge7A== 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=w7o8JtkU4if1h8iGNK+Uod0+wV9PXUgjjQWiZ+6YeuM=; b=AQKqLgZYDZrDHghMWm03XKcDy2Z3xfQixzwopVGg0hhw5VQ2FMpmzkfikVFCM1SAXs 59pnr5ASow6QEzaXGLWQvfbhhDvuAewKdtLLPxdvhqJLsi2gUV0abDEiHbPAxqxrfG3q Xv8W4JbulTb+aOwfFW4kibZ9PpIDwouI71E+JEa6AQpIaXP5WsoK0mhHfA3N6/p4c5UP eMIHxVlTZHJuc1qvl3Ji6UDDUhSy9fXx0uPbXbSSzQ39Yn4Mn1k74XTkaVzwMkewXo5N ToiBGpLWFro5mVH6za/VB5O4aGsSpVe9THhfl5sR6hL5SPvXdC2ZP1eujk0tSC2uPhnc Aq3Q== X-Gm-Message-State: APjAAAVAHXeuhV1RRZkuCJvVsOMv1+aG6zqjn/Mj1O12DJWClCvz3rHW Ktcwdbk8l6r7dxUJO/kebVK7sIYI2OI= X-Google-Smtp-Source: APXvYqwgyVQUxvJNZQfQZ+fem2TaVEf2gfMvm/prpZr/p2OPRRufevUhYa8AgFwlPBl2XCH+R17rvw== X-Received: by 2002:a1c:1d8d:: with SMTP id d135mr14549341wmd.54.1560210207008; Mon, 10 Jun 2019 16:43:27 -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.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Jun 2019 16:43:26 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Mon, 10 Jun 2019 16:43:10 -0700 Message-Id: <1560210191-9414-5-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 Cc: Petr Machata Subject: [ovs-dev] [PATCH 4/5] net: core: dev: Add extack argument to dev_change_flags() 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: Petr Machata Upstream commit: commit 567c5e13be5cc74d24f5eb54cf353c2e2277189b Author: Petr Machata Date: Thu Dec 6 17:05:42 2018 +0000 net: core: dev: Add extack argument to dev_change_flags() In order to pass extack together with NETDEV_PRE_UP notifications, it's necessary to route the extack to __dev_open() from diverse (possibly indirect) callers. One prominent API through which the notification is invoked is dev_change_flags(). Therefore extend dev_change_flags() with and extra extack argument and update all users. Most of the calls end up just encoding NULL, but several sites (VLAN, ipvlan, VRF, rtnetlink) do have extack available. Since the function declaration line is changed anyway, name the other function arguments to placate checkpatch. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Reviewed-by: David Ahern Signed-off-by: David S. Miller This patch backports the above upstream patch and also adds fixes in compat code. Cc: Petr Machata Signed-off-by: Yifeng Sun Acked-by: Yi-Hung Wei --- acinclude.m4 | 3 +++ datapath/linux/compat/include/linux/netdevice.h | 10 ++++++++++ datapath/linux/compat/ip6_gre.c | 4 ++-- datapath/linux/compat/ip_gre.c | 4 ++-- datapath/vport-geneve.c | 2 +- datapath/vport-gre.c | 2 +- datapath/vport-lisp.c | 2 +- datapath/vport-stt.c | 2 +- datapath/vport-vxlan.c | 2 +- 9 files changed, 22 insertions(+), 9 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index eb978e0fae6c..93fbf0ebb84c 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -617,6 +617,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ [max_mtu]) OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/netdevice.h], [net_device_ops_extended], [ndo_change_mtu], [OVS_DEFINE([HAVE_RHEL7_MAX_MTU])]) + OVS_FIND_PARAM_IFELSE([$KSRC/include/linux/netdevice.h], + [dev_change_flags], [extack], + [OVS_DEFINE([HAVE_DEV_CHANGE_FLAGS_TAKES_EXTACK])]) OVS_GREP_IFELSE([$KSRC/include/linux/netfilter.h], [nf_hook_state]) OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/netfilter.h], [nf_hook_state], diff --git a/datapath/linux/compat/include/linux/netdevice.h b/datapath/linux/compat/include/linux/netdevice.h index cf68ed5238d4..126ff23cfa27 100644 --- a/datapath/linux/compat/include/linux/netdevice.h +++ b/datapath/linux/compat/include/linux/netdevice.h @@ -323,4 +323,14 @@ static inline void netif_keep_dst(struct net_device *dev) } #endif +#ifndef HAVE_DEV_CHANGE_FLAGS_TAKES_EXTACK +static inline int rpl_dev_change_flags(struct net_device *dev, + unsigned int flags, + struct netlink_ext_ack *extack) +{ + return dev_change_flags(dev, flags); +} +#define dev_change_flags rpl_dev_change_flags +#endif + #endif /* __LINUX_NETDEVICE_WRAPPER_H */ diff --git a/datapath/linux/compat/ip6_gre.c b/datapath/linux/compat/ip6_gre.c index 2ffdda5e1dc3..ca4e66133570 100644 --- a/datapath/linux/compat/ip6_gre.c +++ b/datapath/linux/compat/ip6_gre.c @@ -2647,7 +2647,7 @@ static struct vport *erspan6_tnl_create(const struct vport_parms *parms) return ERR_CAST(dev); } - err = dev_change_flags(dev, dev->flags | IFF_UP); + err = dev_change_flags(dev, dev->flags | IFF_UP, NULL); if (err < 0) { rtnl_delete_link(dev); rtnl_unlock(); @@ -2748,7 +2748,7 @@ static struct vport *ip6gre_tnl_create(const struct vport_parms *parms) return ERR_CAST(dev); } - err = dev_change_flags(dev, dev->flags | IFF_UP); + err = dev_change_flags(dev, dev->flags | IFF_UP, NULL); if (err < 0) { rtnl_delete_link(dev); rtnl_unlock(); diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c index 89ef45556dce..cf8803b53075 100644 --- a/datapath/linux/compat/ip_gre.c +++ b/datapath/linux/compat/ip_gre.c @@ -1500,7 +1500,7 @@ static struct vport *erspan_tnl_create(const struct vport_parms *parms) return ERR_CAST(dev); } - err = dev_change_flags(dev, dev->flags | IFF_UP); + err = dev_change_flags(dev, dev->flags | IFF_UP, NULL); if (err < 0) { rtnl_delete_link(dev); rtnl_unlock(); @@ -1554,7 +1554,7 @@ static struct vport *ipgre_tnl_create(const struct vport_parms *parms) return ERR_CAST(dev); } - err = dev_change_flags(dev, dev->flags | IFF_UP); + err = dev_change_flags(dev, dev->flags | IFF_UP, NULL); if (err < 0) { rtnl_delete_link(dev); rtnl_unlock(); diff --git a/datapath/vport-geneve.c b/datapath/vport-geneve.c index 14a54f1997a9..a5b91246f8dd 100644 --- a/datapath/vport-geneve.c +++ b/datapath/vport-geneve.c @@ -93,7 +93,7 @@ static struct vport *geneve_tnl_create(const struct vport_parms *parms) return ERR_CAST(dev); } - err = dev_change_flags(dev, dev->flags | IFF_UP); + err = dev_change_flags(dev, dev->flags | IFF_UP, NULL); if (err < 0) { rtnl_delete_link(dev); rtnl_unlock(); diff --git a/datapath/vport-gre.c b/datapath/vport-gre.c index 1d63734f4141..07a8c19df96e 100644 --- a/datapath/vport-gre.c +++ b/datapath/vport-gre.c @@ -68,7 +68,7 @@ static struct vport *gre_tnl_create(const struct vport_parms *parms) return ERR_CAST(dev); } - err = dev_change_flags(dev, dev->flags | IFF_UP); + err = dev_change_flags(dev, dev->flags | IFF_UP, NULL); if (err < 0) { rtnl_delete_link(dev); rtnl_unlock(); diff --git a/datapath/vport-lisp.c b/datapath/vport-lisp.c index 27f40ab4272f..5e2bcda88ac8 100644 --- a/datapath/vport-lisp.c +++ b/datapath/vport-lisp.c @@ -92,7 +92,7 @@ static struct vport *lisp_tnl_create(const struct vport_parms *parms) ovs_vport_free(vport); return ERR_CAST(dev); } - err = dev_change_flags(dev, dev->flags | IFF_UP); + err = dev_change_flags(dev, dev->flags | IFF_UP, NULL); if (err < 0) { rtnl_delete_link(dev); rtnl_unlock(); diff --git a/datapath/vport-stt.c b/datapath/vport-stt.c index 31fa46245503..35c4942c5f51 100644 --- a/datapath/vport-stt.c +++ b/datapath/vport-stt.c @@ -95,7 +95,7 @@ static struct vport *stt_tnl_create(const struct vport_parms *parms) return ERR_CAST(dev); } - err = dev_change_flags(dev, dev->flags | IFF_UP); + err = dev_change_flags(dev, dev->flags | IFF_UP, NULL); if (err < 0) { rtnl_delete_link(dev); rtnl_unlock(); diff --git a/datapath/vport-vxlan.c b/datapath/vport-vxlan.c index c7139abc8919..05764467a687 100644 --- a/datapath/vport-vxlan.c +++ b/datapath/vport-vxlan.c @@ -162,7 +162,7 @@ static struct vport *vxlan_tnl_create(const struct vport_parms *parms) return ERR_CAST(dev); } - err = dev_change_flags(dev, dev->flags | IFF_UP); + err = dev_change_flags(dev, dev->flags | IFF_UP, NULL); if (err < 0) { rtnl_delete_link(dev); rtnl_unlock(); From patchwork Mon Jun 10 23:43:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 1113393 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="hkvt4JEK"; 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 45N8sK3bmfz9sNC for ; Tue, 11 Jun 2019 09:45:57 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id BD7C81203; Mon, 10 Jun 2019 23:43:33 +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 A39B911E3 for ; Mon, 10 Jun 2019 23:43:30 +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 14C50711 for ; Mon, 10 Jun 2019 23:43:30 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id h19so661352wme.0 for ; Mon, 10 Jun 2019 16:43:29 -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=XcyHgA5HJ0rbJ+VN04jKdBoo78zLCUYmzZ0ypfdWQU0=; b=hkvt4JEKq9m72ThZzvTuKhLtmkgoGHaPpoggZBeRG/PXVl220sttjUR4PWkdGNZQnd dqxRIhMAFTXhgaExR4LbeKLRQc8Pb4hVgk17DowkPfcsAd2MXxdgemDfIo3JskpsoNkx X4Y32qQShU0VDm8NGY8B8Oi31KVHTMc5vHJLpnI8IPXoElZCiH2ciPCMJMpNZz+fJ45W ZNEvotJC6RFguiH4OfPxHE5F8cb0E2DNPaUI0mCQJIEBw9KW72YrmAeMntwx6XaEkYhm 2C4UhTROQffCpsVS5Fa/Aznl/dTARtSSV7aGbV+vJvqJWwSxvOFhrliVhpulIro1J0Pi b7aA== 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=XcyHgA5HJ0rbJ+VN04jKdBoo78zLCUYmzZ0ypfdWQU0=; b=jeinVJQc6K/cYohE2EVFL6qL+gLaAJolU5/r2V59XTsfWJs56TqOlzdj1n94nZ70Yv Lxg0Sy2u4jep4dFnd6Vc/S4zmiDp4iN5tD2tS662/BHTxhSlORR1AuRay5xKBUALQOQ+ P61Zqil7kl8IRkFMMteakaNgPqZnOBWkt44PeHBL31+86otF4gkbVFp/xAZvNb0WYMiL GdIpXp/B7ROWwWXk9n9R7ycU5zmrEVtW6zxcNRfQCoPuFptg6o6sHpbWssJHMthRK1Br Z7nOk3CKvI3WclZhATxzFeDcMU/e+l9AwsDCDLlh8CpPRltco2zZqcMLpiWQgkLzlFUR AQig== X-Gm-Message-State: APjAAAXu3gEDLgRx98FsCgcAeM61+QBZXTH3S4jP88j0lcnU0FccVgt5 6DBiRAVHHub9tOiOtxDyfaxHVvA2lLE= X-Google-Smtp-Source: APXvYqxPk3L4QirQuae5jNqCyrTVB6aifDvg0hcT8mNi80z+fnHomRDPG7dFO4FHgwgwJPaL6hTj+Q== X-Received: by 2002:a1c:988b:: with SMTP id a133mr15095573wme.21.1560210208437; Mon, 10 Jun 2019 16:43:28 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Jun 2019 16:43:27 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Mon, 10 Jun 2019 16:43:11 -0700 Message-Id: <1560210191-9414-6-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 5/5] datapath: Support kernel version 5.0.x 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 This patch updated acinclude.m4 so that OVS can be compiled on 5.0.x kernels. This patch also updated travis files so that 5.0.x kernel versions are used during travis test builds. Besides, NEWS and releases.rst are also updated to reflect this new support. Signed-off-by: Yifeng Sun Acked-by: Yi-Hung Wei --- .travis.yml | 1 + .travis/linux-build.sh | 4 +++- Documentation/faq/releases.rst | 2 +- NEWS | 1 + acinclude.m4 | 10 ++++++---- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6621fb53575f..cb96d13cf537 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,6 +35,7 @@ env: - KERNEL=3.16 TESTSUITE=1 DPDK=1 - KERNEL=3.16 DPDK_SHARED=1 - KERNEL=3.16 DPDK_SHARED=1 OPTS="--enable-shared" + - KERNEL=5.0 - KERNEL=4.20 - KERNEL=4.19 - KERNEL=4.18 diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh index 123cde575667..bb97600c9789 100755 --- a/.travis/linux-build.sh +++ b/.travis/linux-build.sh @@ -11,7 +11,9 @@ TARGET="x86_64-native-linuxapp-gcc" function install_kernel() { - if [[ "$1" =~ ^4.* ]]; then + if [[ "$1" =~ ^5.* ]]; then + PREFIX="v5.x" + elif [[ "$1" =~ ^4.* ]]; then PREFIX="v4.x" elif [[ "$1" =~ ^3.* ]]; then PREFIX="v3.x" diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst index 6c5949b33d63..d9504d682c60 100644 --- a/Documentation/faq/releases.rst +++ b/Documentation/faq/releases.rst @@ -68,7 +68,7 @@ Q: What Linux kernel versions does each Open vSwitch release work with? 2.8.x 3.10 to 4.12 2.9.x 3.10 to 4.13 2.10.x 3.10 to 4.17 - 2.11.x 3.10 to 4.18 + 2.11.x 3.10 to 5.0 ============ ============== Open vSwitch userspace should also work with the Linux kernel module built diff --git a/NEWS b/NEWS index 19cebf89a785..a38ab258fc6c 100644 --- a/NEWS +++ b/NEWS @@ -46,6 +46,7 @@ Post-v2.11.0 - Added support for TLS Server Name Indication (SNI). - Linux datapath: * Support for the kernel versions 4.19.x and 4.20.x. + * Support for the kernel version 5.0.x. v2.11.0 - 19 Feb 2019 diff --git a/acinclude.m4 b/acinclude.m4 index 93fbf0ebb84c..321a741985db 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -150,12 +150,14 @@ AC_DEFUN([OVS_CHECK_LINUX], [ fi AC_MSG_RESULT([$kversion]) - if test "$version" -ge 4; then - if test "$version" = 4 && test "$patchlevel" -le 20; then - : # Linux 4.x + if test "$version" -ge 5; then + if test "$version" = 5 && test "$patchlevel" -le 0; then + : # Linux 5.x else - AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.20.x is not supported (please refer to the FAQ for advice)]) + AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 5.0.x is not supported (please refer to the FAQ for advice)]) fi + elif test "$version" = 4; then + : # Linux 4.x elif test "$version" = 3 && test "$patchlevel" -ge 10; then : # Linux 3.x else