From: Hauke Mehrtens <hauke@hauke-m.de>
To: backports@vger.kernel.org
Cc: johannes@sipsolutions.net, Hauke Mehrtens <hauke@hauke-m.de>
Subject: [PATCH 2/3] backports: Adapt to changes to skb_get_hash_perturb()
Date: Sat, 16 Nov 2019 19:36:22 +0100 [thread overview]
Message-ID: <20191116183623.8858-2-hauke@hauke-m.de> (raw)
In-Reply-To: <20191116183623.8858-1-hauke@hauke-m.de>
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 <hauke@hauke-m.de>
---
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);
+ }
--
2.20.1
--
To unsubscribe from this list: send the line "unsubscribe backports" in
next prev parent reply other threads:[~2019-11-16 18:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-16 18:36 [PATCH 1/3] backports: Add return value to backport_pci_disable_link_state() Hauke Mehrtens
2019-11-16 18:36 ` Hauke Mehrtens [this message]
2019-11-19 9:00 ` [PATCH 2/3] backports: Adapt to changes to skb_get_hash_perturb() Johannes Berg
2019-11-16 18:36 ` [PATCH 3/3] backports: Add kvcalloc() Hauke Mehrtens
2019-11-19 8:59 ` Johannes Berg
2019-11-19 19:12 ` Hauke Mehrtens
2019-11-19 19:38 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191116183623.8858-2-hauke@hauke-m.de \
--to=hauke@hauke-m.de \
--cc=backports@vger.kernel.org \
--cc=johannes@sipsolutions.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).