net: make SO_BUSY_POLL available to all users
Subsystems (3)
PATCH 1/1 net: make SO_BUSY_POLL available to all users
After commit 217f69743681 ("net: busy-poll: allow preemption in sk_busy_loop()"), a thread willing to use busy polling is not hurting other threads anymore in a non preempt kernel.
I think it is safe to remove CAP_NET_ADMIN check.
Signed-off-by Eric Dumazet <[email protected]>
--- net/core/sock.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
net/core/sock.c +4 -9
@@ -1396,15 +1396,10 @@ int sk_setsockopt(struct sock *sk, int level, int optname,#ifdef CONFIG_NET_RX_BUSY_POLL case SO_BUSY_POLL : -/* allow unprivileged users to decrease the value */ -if ((val > sk->sk_ll_usec) && !sockopt_capable (CAP_NET_ADMIN )) - ret = -EPERM ; -else { -if (val <0 ) - ret = -EINVAL ; -else -WRITE_ONCE (sk->sk_ll_usec, val); - } +if (val <0 ) + ret = -EINVAL ; +else +WRITE_ONCE (sk->sk_ll_usec, val);break ;case SO_PREFER_BUSY_POLL :if (valbool && !sockopt_capable (CAP_NET_ADMIN ))
Signature · 1 line
2.40.0.577.gac1e443424-goog
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Thu, 6 Apr 2023 19:46:34 +0000 you wrote:
After commit
217f69743681("net: busy-poll: allow preemption insk_busy_loop()"), a thread willing to use busy polling is not hurting other threads anymore in a non preempt kernel.I think it is safe to remove
CAP_NET_ADMINcheck.Signed-off-by Eric Dumazet <[email protected]>[...]
Here is the summary with links:
- [net-next] net: make SO_BUSY_POLL available to all users
https://git.kernel.org/netdev/net-next/c/48b7ea1d22dd
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html