netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] qmi_wwan: Do not call netif_rx from rx_fixup
@ 2021-06-15 10:01 Kristian Evensen
  2021-06-15 10:03 ` Kristian Evensen
  2021-06-15 18:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Kristian Evensen @ 2021-06-15 10:01 UTC (permalink / raw)
  To: netdev, bjorn; +Cc: Kristian Evensen

When the QMI_WWAN_FLAG_PASS_THROUGH is set, netif_rx() is called from
qmi_wwan_rx_fixup(). When the call to netif_rx() is successful (which is
most of the time), usbnet_skb_return() is called (from rx_process()).
usbnet_skb_return() will then call netif_rx() a second time for the same
skb.

Simplify the code and avoid the redundant netif_rx() call by changing
qmi_wwan_rx_fixup() to always return 1 when QMI_WWAN_FLAG_PASS_THROUGH
is set. We then leave it up to the existing infrastructure to call
netif_rx().

Suggested-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
---
 drivers/net/usb/qmi_wwan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index db8d3a4f2678..b39553a56250 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -621,7 +621,7 @@ static int qmi_wwan_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
 
 	if (info->flags & QMI_WWAN_FLAG_PASS_THROUGH) {
 		skb->protocol = htons(ETH_P_MAP);
-		return (netif_rx(skb) == NET_RX_SUCCESS);
+		return 1;
 	}
 
 	switch (skb->data[0] & 0xf0) {
-- 
2.25.1


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

* Re: [PATCH] qmi_wwan: Do not call netif_rx from rx_fixup
  2021-06-15 10:01 [PATCH] qmi_wwan: Do not call netif_rx from rx_fixup Kristian Evensen
@ 2021-06-15 10:03 ` Kristian Evensen
  2021-06-15 18:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Kristian Evensen @ 2021-06-15 10:03 UTC (permalink / raw)
  To: Network Development, Bjørn Mork

Hi all,

I forgot to set the correct subject prefix. I intended for this patch
to target "net". Sorry about that.

Kristian

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

* Re: [PATCH] qmi_wwan: Do not call netif_rx from rx_fixup
  2021-06-15 10:01 [PATCH] qmi_wwan: Do not call netif_rx from rx_fixup Kristian Evensen
  2021-06-15 10:03 ` Kristian Evensen
@ 2021-06-15 18:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-15 18:30 UTC (permalink / raw)
  To: Kristian Evensen; +Cc: netdev, bjorn

Hello:

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

On Tue, 15 Jun 2021 12:01:51 +0200 you wrote:
> When the QMI_WWAN_FLAG_PASS_THROUGH is set, netif_rx() is called from
> qmi_wwan_rx_fixup(). When the call to netif_rx() is successful (which is
> most of the time), usbnet_skb_return() is called (from rx_process()).
> usbnet_skb_return() will then call netif_rx() a second time for the same
> skb.
> 
> Simplify the code and avoid the redundant netif_rx() call by changing
> qmi_wwan_rx_fixup() to always return 1 when QMI_WWAN_FLAG_PASS_THROUGH
> is set. We then leave it up to the existing infrastructure to call
> netif_rx().
> 
> [...]

Here is the summary with links:
  - qmi_wwan: Do not call netif_rx from rx_fixup
    https://git.kernel.org/netdev/net/c/057d49334c02

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] 3+ messages in thread

end of thread, other threads:[~2021-06-15 18:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15 10:01 [PATCH] qmi_wwan: Do not call netif_rx from rx_fixup Kristian Evensen
2021-06-15 10:03 ` Kristian Evensen
2021-06-15 18:30 ` 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).