Message ID | 20241029114622.2989827-7-dario.binacchi@amarulasolutions.com |
---|---|
State | New |
Headers | show
Return-Path: <linux-amarula+bncBCQ4XFG47UFRBIEWQO4QMGQEUTJZMEA@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4F1CF3F380 for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 29 Oct 2024 12:46:41 +0100 (CET) Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a99ef476aadsf391907466b.3 for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 29 Oct 2024 04:46:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1730202401; cv=pass; d=google.com; s=arc-20240605; b=BYM4PjQabfvMEfYbtcyknsnS0sfxAmznVgLq9emEh18UhTCbL+KI7ge36XXThXaiEM Ai82FfQ+BNBirenGCuqDadox781GTP3yOzm4olLP+GwQ7Q7ERWQbxyV6gOHf7BfxYixI 8EH1VGezMO9RIcJTFFfOWPxKeeURgheFmo35xW7EwXCK24UFK8O//W07BFCvPN2Xw6ED MGQl+xb71PID+crJHe23t3rbwx1S5mIwzGwTC/a4oHNLWrMc4B/Cv6jp+5bjaUQfafd0 Z0eGfVsSTu6HbjjiDtSKlYOGZsQfUANu+oeSTTIX8pJ2PgmYvzArAVHaCDfmDxJLoQiM H9Fg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=NMGySHPiPdyQY8WQnND0JdgFZMppjc5wcHJxzUS3diI=; fh=r5VzwhnQWoE56rbJ4I0kPJnDbtzGKstWWaGQXc0h5F8=; b=E47y9TEv0QN+VExEBelhtVXxag2JkQMrQonHqodlDTU+rN0eAdbCev4puLAsJ46nnU Geks45NDgsGFZAYxkV12ACZKH2iC/8qPJeAVQh5VJrG5xVlZ7BCkXtkLpkuBS7S6d448 3mm1x2aBP4kEc016u5RobIB+fDGvNOfKIFlpSZ+ZMGS+FnF3cUBeHgxqW2VOJXrQnimp 0c73vNgoTYjYXNNnrFlIah17QqobM/5XNvAkj1iwaiwqMDUWQRWE4UMEsTWD+SVvNt0e KdLxBRiPW86Ibn8t/1uMCE30RCPoZQ5AOSzo1oy7IzyINGYuJ09pDgBeG/pG5TxHbcJv Xb/Q==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=M1WlgsQq; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1730202401; x=1730807201; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=NMGySHPiPdyQY8WQnND0JdgFZMppjc5wcHJxzUS3diI=; b=l2jGkOVlEguphSw3YPMyjPL0k/xmUSDmM97yL+iQdozon8aZUXTjSoNga+3M1YnJ+V 00OCEdriMTtJVJOMecJ8xzQXg9ROpWu9SSOsCg09pqwRfRKSF7txRc8EQzDARh8xzSGK r9lHK16QqVjWBzq8Po0sXU5L60hLuMBfNvxgQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730202401; x=1730807201; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NMGySHPiPdyQY8WQnND0JdgFZMppjc5wcHJxzUS3diI=; b=BydDlkQGWO72i/912rpW6AmFOO0wFjzXPTVAGopeqHrq/5kzqt4M+H1sLj4Zp+DHVD 71fUxk7A8rVuOlP0MVTy8PnxCEl8ukXnNV3n83Z0bTtZ2e60CeOoRR+HuYUG4MUceI+H KV7gPC/w361Obg5ZmA31ynrNez+SI1U16ZwHu82MPGnxTUPgdMWa31jN02Vgb1ujISB1 6H6OG+3/O9WwWrlMAzWMe9wZwPQHzhRAyLpVcTCL9xqaHjsgPJO8GByKNDzQ5wSZv3RU FtUCw+WZMk57E1M3RoDB2npKBmXp/4dFWjcsP0dFbc9maj5FQCtvrYa2J+I3+sRHzM7z 7ZNg== X-Forwarded-Encrypted: i=2; AJvYcCUalc+fM1wgrkxS4qGRySWVNLxjrWpYRUgzDNEW4HHaiZxdRie4ATCZjLOT5q8v5WFGnE3VfJiSuwNRfDxn@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YzjH99jjdGeu/7JKaXQzaUT7Y5uqa5nhrR4+TQatm1q0zDHocUQ gxkpX2JhZBmA1HV7OJEpys4wNvp8Mo9pF8UCIkhPdzdmQfWMjxhQTNptLjvSbt43SQ== X-Google-Smtp-Source: AGHT+IHrl7MMx2BYmD28NlOOccoYCbcTmclPfx8jZzHmgFqG4+bSUAj9ijZ7qj2762IVhHrXcg12gA== X-Received: by 2002:a17:907:7ea0:b0:a9a:17fb:4c40 with SMTP id a640c23a62f3a-a9de5d6e1e7mr1049138266b.26.1730202400946; Tue, 29 Oct 2024 04:46:40 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:2685:b0:5c9:393c:c093 with SMTP id 4fb4d7f45d1cf-5cb99892356ls324951a12.0.-pod-prod-04-eu; Tue, 29 Oct 2024 04:46:39 -0700 (PDT) X-Received: by 2002:a17:907:1c9d:b0:a9a:5b8d:68ad with SMTP id a640c23a62f3a-a9de615abc0mr1167097066b.48.1730202399311; Tue, 29 Oct 2024 04:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1730202399; cv=none; d=google.com; s=arc-20240605; b=FCqioo/hpoLeuxE6TBL2jtZ37E+oCk8AUTeJpN40BdLiNaUN56MsPL4NaKS4E+M4PV yqprnVRBHodZ1FFo6DqamfO1AIif34auAfs9lJcg+VHMB0dbbLq2LmHEIthnMY8ryYCa Ub0V8GYEf6WnBMUxSW339ZjVGZ5/WnbThrHLHyTbsCdbN6hszbn19zZuzjxgVfLbkhD4 Qk8vPXvzu/TLv8i03lt68bcWM4aFZ94go/YJlxOFkQAJmcdkav4NiG9tASViKTItpJIu bAeyb5UDdf1ZniSJJSsM02LYx8XHv/6sycsuiNO+teX26rtz1jFvJ7j1QRPDmvpchVSU 4Okw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=I7zf1SxmTLYYJKdIBWggPPFkkyvCdLLyYv8BJT477vU=; fh=XNsyLSFywvcB+sAuzGLclJNyI9UUt5fTbiZ5KzXlvNI=; b=e48VpTuY3HcDvY2rl5gO4FY4ENK7A4jGsp8gR8JmbdEQ8KecUxqjj7lYaGInAU6hUK ikyu1yOvb1l9wA4WvqWmCiNbmWFvtYQOsb8CGl+3ppItIMJK41jbt5f27cVhCrimWymK 45wwuwNpv/8y8J6DUQgqZh/e3PrAWPFlvTrYraQ499BEhfpsXwOpOgnr70AlY4QzQ9fL BryhjhEReB9dKKtaS5yxUVTRDQ36ABl3P2ve5zjB/ASyaOxg2NftMIqwkAYvfbno1Ggn YaOvl5rDha4HDSCZztiJD56S4NfWQ1PiGdNeQF+7/Z94jmf81wDWNWw/7IjZzAwOd+5D JIdg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=M1WlgsQq; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id a640c23a62f3a-a9b1ee3da15sor377503366b.5.2024.10.29.04.46.39 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Tue, 29 Oct 2024 04:46:39 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6402:40d5:b0:5c9:4022:872d with SMTP id 4fb4d7f45d1cf-5cbbfa66f3dmr9918447a12.32.1730202398864; Tue, 29 Oct 2024 04:46:38 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.. ([2.196.41.207]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cbb6297a09sm3869301a12.21.2024.10.29.04.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2024 04:46:38 -0700 (PDT) From: Dario Binacchi <dario.binacchi@amarulasolutions.com> To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi <dario.binacchi@amarulasolutions.com>, Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Gal Pressman <gal@nvidia.com>, Jakub Kicinski <kuba@kernel.org>, Kory Maincent <kory.maincent@bootlin.com>, Marc Kleine-Budde <mkl@pengutronix.de>, Paolo Abeni <pabeni@redhat.com>, Rahul Rameshbabu <rrameshbabu@nvidia.com>, Shannon Nelson <shannon.nelson@amd.com>, Vincent Mailhol <mailhol.vincent@wanadoo.fr>, linux-can@vger.kernel.org, netdev@vger.kernel.org Subject: [RFC PATCH v3 6/6] can: dev: update the error types stats (ack, CRC, form, ...) Date: Tue, 29 Oct 2024 12:45:30 +0100 Message-ID: <20241029114622.2989827-7-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241029114622.2989827-1-dario.binacchi@amarulasolutions.com> References: <20241029114622.2989827-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=M1WlgsQq; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
Series |
|
Related |
show
|
diff --git a/drivers/net/can/dev/dev.c b/drivers/net/can/dev/dev.c index 4ad0698b0a74..ed2bdc6fe4a1 100644 --- a/drivers/net/can/dev/dev.c +++ b/drivers/net/can/dev/dev.c @@ -27,16 +27,31 @@ void can_update_bus_error_stats(struct net_device *dev, struct can_frame *cf) priv = netdev_priv(dev); priv->can_stats.bus_error++; - if ((cf->can_id & CAN_ERR_ACK) && cf->data[3] == CAN_ERR_PROT_LOC_ACK) + if ((cf->can_id & CAN_ERR_ACK) && cf->data[3] == CAN_ERR_PROT_LOC_ACK) { + priv->can_stats.ack_error++; tx_errors = true; - else if (cf->data[2] & (CAN_ERR_PROT_BIT1 | CAN_ERR_PROT_BIT0)) + } + + if (cf->data[2] & (CAN_ERR_PROT_BIT1 | CAN_ERR_PROT_BIT0)) { + priv->can_stats.bit_error++; tx_errors = true; + } - if (cf->data[2] & (CAN_ERR_PROT_FORM | CAN_ERR_PROT_STUFF)) + if (cf->data[2] & CAN_ERR_PROT_FORM) { + priv->can_stats.form_error++; rx_errors = true; - else if ((cf->data[2] & CAN_ERR_PROT_BIT) && - (cf->data[3] == CAN_ERR_PROT_LOC_CRC_SEQ)) + } + + if (cf->data[2] & CAN_ERR_PROT_STUFF) { + priv->can_stats.stuff_error++; rx_errors = true; + } + + if ((cf->data[2] & CAN_ERR_PROT_BIT) && + cf->data[3] == CAN_ERR_PROT_LOC_CRC_SEQ) { + priv->can_stats.crc_error++; + rx_errors = true; + } if (rx_errors) dev->stats.rx_errors++;
The patch modifies can_update_bus_error_stats() by also updating the counters related to the types of CAN errors. Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> --- (no changes since v1) drivers/net/can/dev/dev.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-)