diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2019-10-09 16:15:07 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-05 11:19:42 +0300 |
commit | a85ce0107d6bd14f78424de2fac4420d46f15d4e (patch) | |
tree | f3d966c511158fd4a400fa3405c8bf6ffea67770 | |
parent | b83d4e4899d647bab00e1f5f544a8e4900120a7d (diff) | |
download | linux-a85ce0107d6bd14f78424de2fac4420d46f15d4e.tar.xz |
can: rx-offload: can_rx_offload_offload_one(): increment rx_fifo_errors on queue overflow or OOM
[ 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>
-rw-r--r-- | drivers/net/can/rx-offload.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/can/rx-offload.c b/drivers/net/can/rx-offload.c index e32b65599a5f..16af09c71cfe 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, ×tamp, n); - if (ret) + if (ret) { offload->dev->stats.rx_dropped++; + offload->dev->stats.rx_fifo_errors++; + } return NULL; } |