lkml.org 
[lkml]   [2019]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.19 030/321] can: rx-offload: can_rx_offload_offload_one(): increment rx_fifo_errors on queue overflow or OOM
    Date
    From: Marc Kleine-Budde <mkl@pengutronix.de>

    [ Upstream commit 4e9016bee3bf0c24963097edace034ff205b565c ]

    If the rx-offload skb_queue is full or the skb allocation fails (due to OOM),
    the mailbox contents is discarded.

    This patch adds the incrementing of the rx_fifo_errors statistics counter.

    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/net/can/rx-offload.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    diff --git a/drivers/net/can/rx-offload.c b/drivers/net/can/rx-offload.c
    index e32b65599a5f2..16af09c71cfed 100644
    --- a/drivers/net/can/rx-offload.c
    +++ b/drivers/net/can/rx-offload.c
    @@ -134,8 +134,10 @@ static struct sk_buff *can_rx_offload_offload_one(struct can_rx_offload *offload

    ret = offload->mailbox_read(offload, &cf_overflow,
    &timestamp, n);
    - if (ret)
    + if (ret) {
    offload->dev->stats.rx_dropped++;
    + offload->dev->stats.rx_fifo_errors++;
    + }

    return NULL;
    }
    --
    2.20.1


    \
     
     \ /
      Last update: 2019-12-03 23:46    [W:4.132 / U:1.144 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site