linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] net/fq_impl: use skb_get_hash instead of skb_get_hash_perturb
@ 2020-07-26 13:09 Felix Fietkau
  2020-07-26 13:09 ` [PATCH 2/2] mac80211: calculcate skb hash early when using itxq Felix Fietkau
  2020-08-11  9:40 ` [PATCH 1/2] net/fq_impl: use skb_get_hash instead of skb_get_hash_perturb Toke Høiland-Jørgensen
  0 siblings, 2 replies; 4+ messages in thread
From: Felix Fietkau @ 2020-07-26 13:09 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes

This avoids unnecessary regenerating of the skb flow hash

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 include/net/fq.h      | 1 -
 include/net/fq_impl.h | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/net/fq.h b/include/net/fq.h
index 2ad85e683041..e39f3f8d5f8a 100644
--- a/include/net/fq.h
+++ b/include/net/fq.h
@@ -69,7 +69,6 @@ struct fq {
 	struct list_head backlogs;
 	spinlock_t lock;
 	u32 flows_cnt;
-	siphash_key_t	perturbation;
 	u32 limit;
 	u32 memory_limit;
 	u32 memory_usage;
diff --git a/include/net/fq_impl.h b/include/net/fq_impl.h
index 38a9a3d1222b..e73d74d2fabf 100644
--- a/include/net/fq_impl.h
+++ b/include/net/fq_impl.h
@@ -108,7 +108,7 @@ static struct sk_buff *fq_tin_dequeue(struct fq *fq,
 
 static u32 fq_flow_idx(struct fq *fq, struct sk_buff *skb)
 {
-	u32 hash = skb_get_hash_perturb(skb, &fq->perturbation);
+	u32 hash = skb_get_hash(skb);
 
 	return reciprocal_scale(hash, fq->flows_cnt);
 }
@@ -308,7 +308,6 @@ static int fq_init(struct fq *fq, int flows_cnt)
 	INIT_LIST_HEAD(&fq->backlogs);
 	spin_lock_init(&fq->lock);
 	fq->flows_cnt = max_t(u32, flows_cnt, 1);
-	get_random_bytes(&fq->perturbation, sizeof(fq->perturbation));
 	fq->quantum = 300;
 	fq->limit = 8192;
 	fq->memory_limit = 16 << 20; /* 16 MBytes */
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] mac80211: calculcate skb hash early when using itxq
  2020-07-26 13:09 [PATCH 1/2] net/fq_impl: use skb_get_hash instead of skb_get_hash_perturb Felix Fietkau
@ 2020-07-26 13:09 ` Felix Fietkau
  2020-08-11  9:39   ` Toke Høiland-Jørgensen
  2020-08-11  9:40 ` [PATCH 1/2] net/fq_impl: use skb_get_hash instead of skb_get_hash_perturb Toke Høiland-Jørgensen
  1 sibling, 1 reply; 4+ messages in thread
From: Felix Fietkau @ 2020-07-26 13:09 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes

This avoids flow separation issues when using software encryption

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 net/mac80211/tx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index a4e7ef6b0457..7cb73416a372 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3951,6 +3951,7 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb,
 	if (local->ops->wake_tx_queue) {
 		u16 queue = __ieee80211_select_queue(sdata, sta, skb);
 		skb_set_queue_mapping(skb, queue);
+		skb_get_hash(skb);
 	}
 
 	if (sta) {
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] mac80211: calculcate skb hash early when using itxq
  2020-07-26 13:09 ` [PATCH 2/2] mac80211: calculcate skb hash early when using itxq Felix Fietkau
@ 2020-08-11  9:39   ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 4+ messages in thread
From: Toke Høiland-Jørgensen @ 2020-08-11  9:39 UTC (permalink / raw)
  To: Felix Fietkau, linux-wireless; +Cc: johannes

Felix Fietkau <nbd@nbd.name> writes:

> This avoids flow separation issues when using software encryption

Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] net/fq_impl: use skb_get_hash instead of skb_get_hash_perturb
  2020-07-26 13:09 [PATCH 1/2] net/fq_impl: use skb_get_hash instead of skb_get_hash_perturb Felix Fietkau
  2020-07-26 13:09 ` [PATCH 2/2] mac80211: calculcate skb hash early when using itxq Felix Fietkau
@ 2020-08-11  9:40 ` Toke Høiland-Jørgensen
  1 sibling, 0 replies; 4+ messages in thread
From: Toke Høiland-Jørgensen @ 2020-08-11  9:40 UTC (permalink / raw)
  To: Felix Fietkau, linux-wireless; +Cc: johannes

Felix Fietkau <nbd@nbd.name> writes:

> This avoids unnecessary regenerating of the skb flow hash

Ah, I had been meaning to look at this, but didn't get around to it
before I went on holiday; thanks for taking care of it! :)

Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-11  9:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-26 13:09 [PATCH 1/2] net/fq_impl: use skb_get_hash instead of skb_get_hash_perturb Felix Fietkau
2020-07-26 13:09 ` [PATCH 2/2] mac80211: calculcate skb hash early when using itxq Felix Fietkau
2020-08-11  9:39   ` Toke Høiland-Jørgensen
2020-08-11  9:40 ` [PATCH 1/2] net/fq_impl: use skb_get_hash instead of skb_get_hash_perturb Toke Høiland-Jørgensen

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).