netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net/netif_receive_skb_core: Use migrate_disable()
@ 2021-06-17  7:38 Sebastian Andrzej Siewior
  2021-06-21 19:10 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2021-06-17  7:38 UTC (permalink / raw)
  To: netdev, bpf
  Cc: David S. Miller, Jakub Kicinski, Alexei Starovoitov,
	Daniel Borkmann, Jesper Dangaard Brouer, John Fastabend,
	Andrii Nakryiko, Martin KaFai Lau, Song Liu, Yonghong Song,
	KP Singh, Thomas Gleixner, Steven Rostedt

The preempt disable around do_xdp_generic() has been introduced in
commit
   bbbe211c295ff ("net: rcu lock and preempt disable missing around generic xdp")

For BPF it is enough to use migrate_disable() and the code was updated
as it can be seen in commit
   3c58482a382ba ("bpf: Provide bpf_prog_run_pin_on_cpu() helper")

This is a leftover which was not converted.

Use migrate_disable() before invoking do_xdp_generic().

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 net/core/dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 50531a2d0b20d..e597371281638 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5277,9 +5277,9 @@ static int __netif_receive_skb_core(struct sk_buff **pskb, bool pfmemalloc,
 	if (static_branch_unlikely(&generic_xdp_needed_key)) {
 		int ret2;
 
-		preempt_disable();
+		migrate_disable();
 		ret2 = do_xdp_generic(rcu_dereference(skb->dev->xdp_prog), skb);
-		preempt_enable();
+		migrate_enable();
 
 		if (ret2 != XDP_PASS) {
 			ret = NET_RX_DROP;
-- 
2.32.0


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

* Re: [PATCH net-next] net/netif_receive_skb_core: Use migrate_disable()
  2021-06-17  7:38 [PATCH net-next] net/netif_receive_skb_core: Use migrate_disable() Sebastian Andrzej Siewior
@ 2021-06-21 19:10 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-21 19:10 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: netdev, bpf, davem, kuba, ast, daniel, hawk, john.fastabend,
	andrii, kafai, songliubraving, yhs, kpsingh, tglx, rostedt

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Thu, 17 Jun 2021 09:38:17 +0200 you wrote:
> The preempt disable around do_xdp_generic() has been introduced in
> commit
>    bbbe211c295ff ("net: rcu lock and preempt disable missing around generic xdp")
> 
> For BPF it is enough to use migrate_disable() and the code was updated
> as it can be seen in commit
>    3c58482a382ba ("bpf: Provide bpf_prog_run_pin_on_cpu() helper")
> 
> [...]

Here is the summary with links:
  - [net-next] net/netif_receive_skb_core: Use migrate_disable()
    https://git.kernel.org/netdev/net/c/2b4cd14fd995

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-06-21 19:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17  7:38 [PATCH net-next] net/netif_receive_skb_core: Use migrate_disable() Sebastian Andrzej Siewior
2021-06-21 19:10 ` patchwork-bot+netdevbpf

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