lkml.org 
[lkml]   [2021]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/4] can: esd_402_pci: do not increase rx statistics when generating a CAN rx error message frame
Date
The CAN error message frames (i.e. error skb) are an interface
specific to socket CAN. The payload of the CAN error message frames
does not correspond to any actual data sent on the wire. Only an error
flag and a delimiter are transmitted when an error occurs (c.f. ISO
11898-1 section 10.4.4.2 "Error flag").

For this reason, it makes no sense to increment the rx_packets and
rx_bytes fields of struct net_device_stats because no actual payload
were transmitted on the wire.

This patch brings the esd_402_pci driver in line with the other CAN
drivers which have been changed after a suggestion of Vincent Mailhol.

Suggested-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Stefan Mätje <stefan.maetje@esd.eu>
---
drivers/net/can/esd/esdacc.c | 6 ------
1 file changed, 6 deletions(-)

diff --git a/drivers/net/can/esd/esdacc.c b/drivers/net/can/esd/esdacc.c
index 13f7397dfc4e..f74248662cd6 100644
--- a/drivers/net/can/esd/esdacc.c
+++ b/drivers/net/can/esd/esdacc.c
@@ -555,8 +555,6 @@ static void handle_core_msg_overrun(struct acc_core *core,

skb_hwtstamps(skb)->hwtstamp = acc_ts2ktime(priv->ov, msg->ts);

- stats->rx_packets++;
- stats->rx_bytes += cf->len;
netif_rx(skb);
}

@@ -613,8 +611,6 @@ static void handle_core_msg_buserr(struct acc_core *core,

skb_hwtstamps(skb)->hwtstamp = acc_ts2ktime(priv->ov, msg->ts);

- stats->rx_packets++;
- stats->rx_bytes += cf->len;
netif_rx(skb);
}

@@ -668,8 +664,6 @@ handle_core_msg_errstatechange(struct acc_core *core,

skb_hwtstamps(skb)->hwtstamp = acc_ts2ktime(priv->ov, msg->ts);

- stats->rx_packets++;
- stats->rx_bytes += cf->len;
netif_rx(skb);
} else {
stats->rx_dropped++;
--
2.25.1
\
 
 \ /
  Last update: 2021-12-01 23:04    [W:0.309 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site