lkml.org 
[lkml]   [2021]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.12 046/110] qmi_wwan: Do not call netif_rx from rx_fixup
    Date
    From: Kristian Evensen <kristian.evensen@gmail.com>

    [ Upstream commit 057d49334c02a79af81c30a8d240e641bd6f1741 ]

    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>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    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 6700f1970b24..bc55ec739af9 100644
    --- a/drivers/net/usb/qmi_wwan.c
    +++ b/drivers/net/usb/qmi_wwan.c
    @@ -575,7 +575,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.30.2
    \
     
     \ /
      Last update: 2021-06-28 16:22    [W:2.313 / U:0.140 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site