lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 14 Sep 2020 10:24:52 -0700
From:   Wei Wang <weiwan@...gle.com>
To:     "David S . Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Cc:     Jakub Kicinski <kuba@...nel.org>,
        Eric Dumazet <edumazet@...gle.com>,
        Paolo Abeni <pabeni@...hat.com>,
        Hannes Frederic Sowa <hannes@...essinduktion.org>,
        Felix Fietkau <nbd@....name>, Wei Wang <weiwan@...gle.com>
Subject: [RFC PATCH net-next 5/6] net: process RPS/RFS work in kthread context

From: Paolo Abeni <pabeni@...hat.com>

This patch adds the missing part to handle RFS/RPS in the napi thread
handler and makes sure RPS/RFS works properly when using kthread to do
napi poll.

Signed-off-by: Paolo Abeni <pabeni@...hat.com>
Signed-off-by: Wei Wang <weiwan@...gle.com>
---
 net/core/dev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/net/core/dev.c b/net/core/dev.c
index be676c21bdc4..ab8af727058b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6820,6 +6820,7 @@ static int napi_thread_wait(struct napi_struct *napi)
 static int napi_threaded_poll(void *data)
 {
 	struct napi_struct *napi = data;
+	struct softnet_data *sd;
 	void *have;
 
 	while (!napi_thread_wait(napi)) {
@@ -6835,6 +6836,12 @@ static int napi_threaded_poll(void *data)
 			__kfree_skb_flush();
 			local_bh_enable();
 
+			sd = this_cpu_ptr(&softnet_data);
+			if (sd_has_rps_ipi_waiting(sd)) {
+				local_irq_disable();
+				net_rps_action_and_irq_enable(sd);
+			}
+
 			if (!repoll)
 				break;
 
-- 
2.28.0.618.gf4bc123cb7-goog

Powered by blists - more mailing lists