From patchwork Sat Nov 16 18:36:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 11247693 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AC7251599 for ; Sat, 16 Nov 2019 18:41:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9698B206F4 for ; Sat, 16 Nov 2019 18:41:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727696AbfKPSlu (ORCPT ); Sat, 16 Nov 2019 13:41:50 -0500 Received: from mout-u-107.mailbox.org ([91.198.250.252]:50106 "EHLO mout-u-107.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727697AbfKPSlu (ORCPT ); Sat, 16 Nov 2019 13:41:50 -0500 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 47FkT31VqMzKmgn; Sat, 16 Nov 2019 19:36:39 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id EsLX5uX4SXyQ; Sat, 16 Nov 2019 19:36:36 +0100 (CET) From: Hauke Mehrtens To: backports@vger.kernel.org Cc: johannes@sipsolutions.net, Hauke Mehrtens Subject: [PATCH 1/3] backports: Add return value to backport_pci_disable_link_state() Date: Sat, 16 Nov 2019 19:36:21 +0100 Message-Id: <20191116183623.8858-1-hauke@hauke-m.de> MIME-Version: 1.0 Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org Since Linux upstream commit 4cfd21885592 ("PCI: let pci_disable_link_state propagate errors") The backport_pci_disable_link_state() function can return an error. This return code is now used by the mt76 driver. Signed-off-by: Hauke Mehrtens --- backport/backport-include/linux/pci.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backport/backport-include/linux/pci.h b/backport/backport-include/linux/pci.h index 84c4e8f6..f0aacbf6 100644 --- a/backport/backport-include/linux/pci.h +++ b/backport/backport-include/linux/pci.h @@ -236,4 +236,13 @@ static inline struct pci_dev *pcie_find_root_port(struct pci_dev *dev) (PCI_IRQ_LEGACY | PCI_IRQ_MSI | PCI_IRQ_MSIX) #endif +#if LINUX_VERSION_IS_LESS(5,3,0) +static inline int backport_pci_disable_link_state(struct pci_dev *pdev, int state) +{ + pci_disable_link_state(pdev, state); + return 0; +} +#define pci_disable_link_state LINUX_BACKPORT(pci_disable_link_state) +#endif /* < 5.3 */ + #endif /* _BACKPORT_LINUX_PCI_H */ From patchwork Sat Nov 16 18:36:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 11247691 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4946F13BD for ; Sat, 16 Nov 2019 18:41:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 33717206F4 for ; Sat, 16 Nov 2019 18:41:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727698AbfKPSlt (ORCPT ); Sat, 16 Nov 2019 13:41:49 -0500 Received: from mout-u-107.mailbox.org ([91.198.250.252]:50104 "EHLO mout-u-107.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727696AbfKPSlt (ORCPT ); Sat, 16 Nov 2019 13:41:49 -0500 X-Greylist: delayed 309 seconds by postgrey-1.27 at vger.kernel.org; Sat, 16 Nov 2019 13:41:49 EST Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 47FkT34JsbzKmkt; Sat, 16 Nov 2019 19:36:39 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id eNeOZ7-IYp-s; Sat, 16 Nov 2019 19:36:36 +0100 (CET) From: Hauke Mehrtens To: backports@vger.kernel.org Cc: johannes@sipsolutions.net, Hauke Mehrtens Subject: [PATCH 2/3] backports: Adapt to changes to skb_get_hash_perturb() Date: Sat, 16 Nov 2019 19:36:22 +0100 Message-Id: <20191116183623.8858-2-hauke@hauke-m.de> In-Reply-To: <20191116183623.8858-1-hauke@hauke-m.de> References: <20191116183623.8858-1-hauke@hauke-m.de> MIME-Version: 1.0 Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org The skb_get_hash_perturb() function now takes a siphash_key_t instead of an u32. This was changed in commit 55667441c84f ("net/flow_dissector: switch to siphash"). Use the correct type in the fq header file depending on the kernel version. Signed-off-by: Hauke Mehrtens --- patches/0091-fq-no-siphash_key_t/fq.patch | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 patches/0091-fq-no-siphash_key_t/fq.patch diff --git a/patches/0091-fq-no-siphash_key_t/fq.patch b/patches/0091-fq-no-siphash_key_t/fq.patch new file mode 100644 index 00000000..95c28a19 --- /dev/null +++ b/patches/0091-fq-no-siphash_key_t/fq.patch @@ -0,0 +1,36 @@ +--- a/include/net/fq.h ++++ b/include/net/fq.h +@@ -69,7 +69,15 @@ struct fq { + struct list_head backlogs; + spinlock_t lock; + u32 flows_cnt; ++#if LINUX_VERSION_IS_GEQ(5,3,10) || \ ++ LINUX_VERSION_IN_RANGE(4,19,83, 4,20,0) || \ ++ LINUX_VERSION_IN_RANGE(4,14,153, 4,15,0) || \ ++ LINUX_VERSION_IN_RANGE(4,9,200, 4,10,0) || \ ++ LINUX_VERSION_IN_RANGE(4,4,200, 4,5,0) + siphash_key_t perturbation; ++#else ++ u32 perturbation; ++#endif + u32 limit; + u32 memory_limit; + u32 memory_usage; +--- a/include/net/fq_impl.h ++++ b/include/net/fq_impl.h +@@ -108,7 +108,15 @@ begin: + + static u32 fq_flow_idx(struct fq *fq, struct sk_buff *skb) + { ++#if LINUX_VERSION_IS_GEQ(5,3,10) || \ ++ LINUX_VERSION_IN_RANGE(4,19,83, 4,20,0) || \ ++ LINUX_VERSION_IN_RANGE(4,14,153, 4,15,0) || \ ++ LINUX_VERSION_IN_RANGE(4,9,200, 4,10,0) || \ ++ LINUX_VERSION_IN_RANGE(4,4,200, 4,5,0) + u32 hash = skb_get_hash_perturb(skb, &fq->perturbation); ++#else ++ u32 hash = skb_get_hash_perturb(skb, fq->perturbation); ++#endif + + return reciprocal_scale(hash, fq->flows_cnt); + } From patchwork Sat Nov 16 18:36:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 11247695 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F120138C for ; Sat, 16 Nov 2019 18:43:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6BAF3206F4 for ; Sat, 16 Nov 2019 18:43:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727697AbfKPSnm (ORCPT ); Sat, 16 Nov 2019 13:43:42 -0500 Received: from mout-u-204.mailbox.org ([91.198.250.253]:18198 "EHLO mout-u-204.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727620AbfKPSnm (ORCPT ); Sat, 16 Nov 2019 13:43:42 -0500 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 47FkT41kpJzQl32; Sat, 16 Nov 2019 19:36:40 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id 76MmBittNoXp; Sat, 16 Nov 2019 19:36:37 +0100 (CET) From: Hauke Mehrtens To: backports@vger.kernel.org Cc: johannes@sipsolutions.net, Hauke Mehrtens Subject: [PATCH 3/3] backports: Add kvcalloc() Date: Sat, 16 Nov 2019 19:36:23 +0100 Message-Id: <20191116183623.8858-3-hauke@hauke-m.de> In-Reply-To: <20191116183623.8858-1-hauke@hauke-m.de> References: <20191116183623.8858-1-hauke@hauke-m.de> MIME-Version: 1.0 Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org kvcalloc() was added in kernel commit 1c542f38ab8d ("mm: Introduce kvcalloc()") and is now used by the fq header filers. Signed-off-by: Hauke Mehrtens --- backport/backport-include/linux/mm.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backport/backport-include/linux/mm.h b/backport/backport-include/linux/mm.h index b28156d3..8ff7d6a6 100644 --- a/backport/backport-include/linux/mm.h +++ b/backport/backport-include/linux/mm.h @@ -50,4 +50,12 @@ static inline void *kvzalloc(size_t size, gfp_t flags) } #endif +#if LINUX_VERSION_IS_LESS(4,18,0) +#define kvcalloc LINUX_BACKPORT(kvcalloc) +static inline void *kvcalloc(size_t n, size_t size, gfp_t flags) +{ + return kvmalloc_array(n, size, flags | __GFP_ZERO); +} +#endif /* < 4.18 */ + #endif /* __BACKPORT_MM_H */