Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: in_irq() cleanup

Replace the obsolete and ambiguos macro in_irq() with new
macro in_hardirq().

Signed-off-by: Changbin Du <changbin.du@gmail.com>
Link: https://lore.kernel.org/r/20210813145749.86512-1-changbin.du@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Changbin Du and committed by
Jakub Kicinski
afa79d08 39a0876d

+8 -8
+1 -1
include/linux/netdevice.h
··· 3956 3956 /* 3957 3957 * It is not allowed to call kfree_skb() or consume_skb() from hardware 3958 3958 * interrupt context or with hardware interrupts being disabled. 3959 - * (in_irq() || irqs_disabled()) 3959 + * (in_hardirq() || irqs_disabled()) 3960 3960 * 3961 3961 * We provide four helpers that can be used in following contexts : 3962 3962 *
+2 -2
net/core/bpf_sk_storage.c
··· 416 416 BPF_CALL_4(bpf_sk_storage_get_tracing, struct bpf_map *, map, struct sock *, sk, 417 417 void *, value, u64, flags) 418 418 { 419 - if (in_irq() || in_nmi()) 419 + if (in_hardirq() || in_nmi()) 420 420 return (unsigned long)NULL; 421 421 422 422 return (unsigned long)____bpf_sk_storage_get(map, sk, value, flags); ··· 425 425 BPF_CALL_2(bpf_sk_storage_delete_tracing, struct bpf_map *, map, 426 426 struct sock *, sk) 427 427 { 428 - if (in_irq() || in_nmi()) 428 + if (in_hardirq() || in_nmi()) 429 429 return -EPERM; 430 430 431 431 return ____bpf_sk_storage_delete(map, sk);
+1 -1
net/core/dev.c
··· 3107 3107 3108 3108 void __dev_kfree_skb_any(struct sk_buff *skb, enum skb_free_reason reason) 3109 3109 { 3110 - if (in_irq() || irqs_disabled()) 3110 + if (in_hardirq() || irqs_disabled()) 3111 3111 __dev_kfree_skb_irq(skb, reason); 3112 3112 else 3113 3113 dev_kfree_skb(skb);
+3 -3
net/core/skbuff.c
··· 156 156 void *data; 157 157 158 158 fragsz = SKB_DATA_ALIGN(fragsz); 159 - if (in_irq() || irqs_disabled()) { 159 + if (in_hardirq() || irqs_disabled()) { 160 160 nc = this_cpu_ptr(&netdev_alloc_cache); 161 161 data = page_frag_alloc_align(nc, fragsz, GFP_ATOMIC, align_mask); 162 162 } else { ··· 502 502 if (sk_memalloc_socks()) 503 503 gfp_mask |= __GFP_MEMALLOC; 504 504 505 - if (in_irq() || irqs_disabled()) { 505 + if (in_hardirq() || irqs_disabled()) { 506 506 nc = this_cpu_ptr(&netdev_alloc_cache); 507 507 data = page_frag_alloc(nc, len, gfp_mask); 508 508 pfmemalloc = nc->pfmemalloc; ··· 724 724 { 725 725 skb_dst_drop(skb); 726 726 if (skb->destructor) { 727 - WARN_ON(in_irq()); 727 + WARN_ON(in_hardirq()); 728 728 skb->destructor(skb); 729 729 } 730 730 #if IS_ENABLED(CONFIG_NF_CONNTRACK)
+1 -1
net/nfc/rawsock.c
··· 140 140 { 141 141 struct sock *sk = (struct sock *) context; 142 142 143 - BUG_ON(in_irq()); 143 + BUG_ON(in_hardirq()); 144 144 145 145 pr_debug("sk=%p err=%d\n", sk, err); 146 146