Message ID | 20200927194920.103181773@linutronix.de (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Johannes Berg |
Headers | show
Return-Path: <SRS0=HCd0=DE=vger.kernel.org=linux-wireless-owner@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9433F92C for <patchwork-linux-wireless@patchwork.kernel.org>; Sun, 27 Sep 2020 19:57:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6D46C23A33 for <patchwork-linux-wireless@patchwork.kernel.org>; Sun, 27 Sep 2020 19:57:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="lvqAAX6a"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="M/WUbhe6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726865AbgI0T5R (ORCPT <rfc822;patchwork-linux-wireless@patchwork.kernel.org>); Sun, 27 Sep 2020 15:57:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726868AbgI0T5L (ORCPT <rfc822;linux-wireless@vger.kernel.org>); Sun, 27 Sep 2020 15:57:11 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E385C0613D4; Sun, 27 Sep 2020 12:57:10 -0700 (PDT) Message-Id: <20200927194920.103181773@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1601236629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=+Td6yEJdX0u3alrzHn3f95NHXVsu8voDQUxA06qKs/o=; b=lvqAAX6akfP4YZ7xFR4LpOwETarHeBRFLM2QGdZc6nT5AgVB/4sW2QV0rl1zrbXxtvs875 uZ8s+pnZL9IX+9ZQfTf5t6ubPQkkOAQKHI+5xe32z1/so/OlLrIFEAdPXMqAbdUuiLNy5I fw7MItHEk107qSjVOj8KnpKG8kTTP08LGiPqAldfmFKC2LrcUAKL6CyyZnYa2MZMx8KS3B 6g8oqlDFUUUxl3EiGW19U2kDoo63JtxfAx/i53g2+VghRAPyJbTb+QqsHxxgd/RYJaCNl1 OviMTI9zuVPOfs1dRgwlCiQPoBX9PY1w9BIsFYvtkhosg5mXWaHYXe6j6KmRnA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1601236629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=+Td6yEJdX0u3alrzHn3f95NHXVsu8voDQUxA06qKs/o=; b=M/WUbhe6ErdCayGy1R//fNscpvFnmw4BpbV19BilmIiQfA+0Y1FoXJBx98Nu47G3KEOcgz 7H3xxIcvoG/sxZDQ== Date: Sun, 27 Sep 2020 21:48:49 +0200 From: Thomas Gleixner <tglx@linutronix.de> To: LKML <linux-kernel@vger.kernel.org> Cc: Peter Zijlstra <peterz@infradead.org>, Linus Torvalds <torvalds@linuxfoundation.org>, Paul McKenney <paulmck@kernel.org>, Matthew Wilcox <willy@infradead.org>, Sebastian Andrzej Siewior <bigeasy@linutronix.de>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, netdev@vger.kernel.org, Christian Benvenuti <benve@cisco.com>, Govindarajulu Varadarajan <_govind@gmx.com>, Dave Miller <davem@davemloft.net>, Jonathan Corbet <corbet@lwn.net>, Mauro Carvalho Chehab <mchehab+huawei@kernel.org>, linux-doc@vger.kernel.org, Luc Van Oostenryck <luc.vanoostenryck@gmail.com>, Jay Cliburn <jcliburn@gmail.com>, Chris Snook <chris.snook@gmail.com>, Vishal Kulkarni <vishal@chelsio.com>, Jeff Kirsher <jeffrey.t.kirsher@intel.com>, intel-wired-lan@lists.osuosl.org, Shannon Nelson <snelson@pensando.io>, Pensando Drivers <drivers@pensando.io>, Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>, Russell King <linux@armlinux.org.uk>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Solarflare linux maintainers <linux-net-drivers@solarflare.com>, Edward Cree <ecree@solarflare.com>, Martin Habets <mhabets@solarflare.com>, Jon Mason <jdmason@kudzu.us>, Daniel Drake <dsd@gentoo.org>, Ulrich Kunitz <kune@deine-taler.de>, Kalle Valo <kvalo@codeaurora.org>, linux-wireless@vger.kernel.org, linux-usb@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Arend van Spriel <arend.vanspriel@broadcom.com>, Franky Lin <franky.lin@broadcom.com>, Hante Meuleman <hante.meuleman@broadcom.com>, Chi-Hsien Lin <chi-hsien.lin@cypress.com>, Wright Feng <wright.feng@cypress.com>, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, Stanislav Yakovlev <stas.yakovlev@gmail.com>, Stanislaw Gruszka <stf_xl@wp.pl>, Johannes Berg <johannes.berg@intel.com>, Emmanuel Grumbach <emmanuel.grumbach@intel.com>, Luca Coelho <luciano.coelho@intel.com>, Intel Linux Wireless <linuxwifi@intel.com>, Jouni Malinen <j@w1.fi>, Amitkumar Karwar <amitkarwar@gmail.com>, Ganapathi Bhat <ganapathi.bhat@nxp.com>, Xinming Hu <huxinming820@gmail.com>, libertas-dev@lists.infradead.org, Pascal Terjan <pterjan@google.com>, Ping-Ke Shih <pkshih@realtek.com> Subject: [patch 03/35] net: Add netif_rx_any_context() References: <20200927194846.045411263@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: <linux-wireless.vger.kernel.org> X-Mailing-List: linux-wireless@vger.kernel.org |
Series |
net: in_interrupt() cleanup and fixes
|
expand
|
--- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3764,6 +3764,7 @@ void generic_xdp_tx(struct sk_buff *skb, int do_xdp_generic(struct bpf_prog *xdp_prog, struct sk_buff *skb); int netif_rx(struct sk_buff *skb); int netif_rx_ni(struct sk_buff *skb); +int netif_rx_any_context(struct sk_buff *skb); int netif_receive_skb(struct sk_buff *skb); int netif_receive_skb_core(struct sk_buff *skb); void netif_receive_skb_list(struct list_head *head); --- a/net/core/dev.c +++ b/net/core/dev.c @@ -4840,6 +4840,21 @@ int netif_rx_ni(struct sk_buff *skb) } EXPORT_SYMBOL(netif_rx_ni); +int netif_rx_any_context(struct sk_buff *skb) +{ + /* + * If invoked from contexts which do not invoke bottom half + * processing either at return from interrupt or when softrqs are + * reenabled, use netif_rx_ni() which invokes bottomhalf processing + * directly. + */ + if (in_interrupt()) + return netif_rx(skb); + else + return netif_rx_ni(skb); +} +EXPORT_SYMBOL(netif_rx_any_context); + static __latent_entropy void net_tx_action(struct softirq_action *h) { struct softnet_data *sd = this_cpu_ptr(&softnet_data);