From: Saeed Mahameed <saeed@kernel.org>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
"Hans J. Schultz" <netdev@kapio-technology.com>
Subject: Re: [PATCH net-next 2/3] net: dsa: mv88e6xxx: replace ATU violation prints with trace points
Date: Wed, 7 Dec 2022 16:14:16 -0800 [thread overview]
Message-ID: <Y5EsWNfVQrl8Nb71@x130> (raw)
In-Reply-To: <20221207233954.3619276-3-vladimir.oltean@nxp.com>
On 08 Dec 01:39, Vladimir Oltean wrote:
>In applications where the switch ports must perform 802.1X based
>authentication and are therefore locked, ATU violation interrupts are
>quite to be expected as part of normal operation. The problem is that
>they currently spam the kernel log, even if rate limited.
>
+1
>Create a series of trace points, all derived from the same event class,
>which log these violations to the kernel's trace buffer, which is both
>much faster and much easier to ignore than printing to a serial console.
>
>I've deliberately stopped reporting the portvec, since in my experience
>it contains redundant information with the spid (port) field: portvec ==
>1 << spid.
>
>New usage model:
>
>$ trace-cmd list | grep mv88e6xxx
>mv88e6xxx
>mv88e6xxx:mv88e6xxx_atu_full_violation
>mv88e6xxx:mv88e6xxx_atu_miss_violation
>mv88e6xxx:mv88e6xxx_atu_member_violation
>mv88e6xxx:mv88e6xxx_atu_age_out_violation
>$ trace-cmd record -e mv88e6xxx sleep 10
>
>Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
>---
> drivers/net/dsa/mv88e6xxx/Makefile | 4 ++
> drivers/net/dsa/mv88e6xxx/global1_atu.c | 21 ++++----
> drivers/net/dsa/mv88e6xxx/trace.c | 6 +++
> drivers/net/dsa/mv88e6xxx/trace.h | 68 +++++++++++++++++++++++++
> 4 files changed, 87 insertions(+), 12 deletions(-)
> create mode 100644 drivers/net/dsa/mv88e6xxx/trace.c
> create mode 100644 drivers/net/dsa/mv88e6xxx/trace.h
>
>diff --git a/drivers/net/dsa/mv88e6xxx/Makefile b/drivers/net/dsa/mv88e6xxx/Makefile
>index c8eca2b6f959..49bf358b9c4f 100644
>--- a/drivers/net/dsa/mv88e6xxx/Makefile
>+++ b/drivers/net/dsa/mv88e6xxx/Makefile
>@@ -15,3 +15,7 @@ mv88e6xxx-objs += port_hidden.o
> mv88e6xxx-$(CONFIG_NET_DSA_MV88E6XXX_PTP) += ptp.o
> mv88e6xxx-objs += serdes.o
> mv88e6xxx-objs += smi.o
>+mv88e6xxx-objs += trace.o
>+
>+# for tracing framework to find trace.h
>+CFLAGS_trace.o := -I$(src)
>diff --git a/drivers/net/dsa/mv88e6xxx/global1_atu.c b/drivers/net/dsa/mv88e6xxx/global1_atu.c
>index a9e2ff7d0e52..6ba65b723b42 100644
>--- a/drivers/net/dsa/mv88e6xxx/global1_atu.c
>+++ b/drivers/net/dsa/mv88e6xxx/global1_atu.c
>@@ -12,6 +12,7 @@
>
> #include "chip.h"
> #include "global1.h"
>+#include "trace.h"
>
> /* Offset 0x01: ATU FID Register */
>
>@@ -429,29 +430,25 @@ static irqreturn_t mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id)
> spid = entry.state;
>
> if (val & MV88E6XXX_G1_ATU_OP_AGE_OUT_VIOLATION) {
>- dev_err_ratelimited(chip->dev,
>- "ATU age out violation for %pM fid %u\n",
>- entry.mac, fid);
>+ trace_mv88e6xxx_atu_age_out_violation(chip->dev, spid,
>+ entry.mac, fid);
no stats here? tracepoints are disabled by default and this event will go
unnoticed, users usually monitor light weight indicators such as stats, then
turn on tracepoints to see what's actually happening..
> }
>
next prev parent reply other threads:[~2022-12-08 0:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-07 23:39 [PATCH net-next 0/3] Trace points for mv88e6xxx Vladimir Oltean
2022-12-07 23:39 ` [PATCH net-next 1/3] net: dsa: mv88e6xxx: read FID when handling ATU violations Vladimir Oltean
2022-12-07 23:39 ` [PATCH net-next 2/3] net: dsa: mv88e6xxx: replace ATU violation prints with trace points Vladimir Oltean
2022-12-08 0:14 ` Saeed Mahameed [this message]
2022-12-08 14:49 ` Vladimir Oltean
2022-12-08 15:22 ` netdev
2022-12-08 15:27 ` Vladimir Oltean
2022-12-08 15:35 ` netdev
2022-12-09 0:26 ` Saeed Mahameed
2022-12-08 18:33 ` netdev
2022-12-08 19:31 ` Vladimir Oltean
2022-12-07 23:39 ` [PATCH net-next 3/3] net: dsa: mv88e6xxx: replace VTU " Vladimir Oltean
2022-12-08 12:32 ` [PATCH net-next 0/3] Trace points for mv88e6xxx netdev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y5EsWNfVQrl8Nb71@x130 \
--to=saeed@kernel.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@kapio-technology.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vladimir.oltean@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).