From: Simon Horman <horms@kernel.org>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Andrew Lunn <andrew@lunn.ch>,
Claudiu Manoil <claudiu.manoil@nxp.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
UNGLinuxDriver@microchip.com,
Jacob Keller <jacob.e.keller@intel.com>
Subject: Re: [PATCH net] net: mscc: ocelot: fix incorrect IFH SRC_PORT field in ocelot_ifh_set_basic()
Date: Fri, 13 Dec 2024 12:13:47 +0000 [thread overview]
Message-ID: <20241213121347.GT2110@kernel.org> (raw)
In-Reply-To: <20241212165546.879567-1-vladimir.oltean@nxp.com>
On Thu, Dec 12, 2024 at 06:55:45PM +0200, Vladimir Oltean wrote:
> Packets injected by the CPU should have a SRC_PORT field equal to the
> CPU port module index in the Analyzer block (ocelot->num_phys_ports).
>
> The blamed commit copied the ocelot_ifh_set_basic() call incorrectly
> from ocelot_xmit_common() in net/dsa/tag_ocelot.c. Instead of calling
> with "x", it calls with BIT_ULL(x), but the field is not a port mask,
> but rather a single port index.
>
> [ side note: this is the technical debt of code duplication :( ]
>
> The error used to be silent and doesn't appear to have other
> user-visible manifestations, but with new changes in the packing
> library, it now fails loudly as follows:
>
> ------------[ cut here ]------------
> Cannot store 0x40 inside bits 46-43 - will truncate
> sja1105 spi2.0: xmit timed out
> WARNING: CPU: 1 PID: 102 at lib/packing.c:98 __pack+0x90/0x198
> sja1105 spi2.0: timed out polling for tstamp
> CPU: 1 UID: 0 PID: 102 Comm: felix_xmit
> Tainted: G W N 6.13.0-rc1-00372-gf706b85d972d-dirty #2605
> Call trace:
> __pack+0x90/0x198 (P)
> __pack+0x90/0x198 (L)
> packing+0x78/0x98
> ocelot_ifh_set_basic+0x260/0x368
> ocelot_port_inject_frame+0xa8/0x250
> felix_port_deferred_xmit+0x14c/0x258
> kthread_worker_fn+0x134/0x350
> kthread+0x114/0x138
>
> The code path pertains to the ocelot switchdev driver and to the felix
> secondary DSA tag protocol, ocelot-8021q. Here seen with ocelot-8021q.
>
> The messenger (packing) is not really to blame, so fix the original
> commit instead.
>
> Fixes: e1b9e80236c5 ("net: mscc: ocelot: fix QoS class for injected packets with "ocelot-8021q"")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2024-12-13 12:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-12 16:55 [PATCH net] net: mscc: ocelot: fix incorrect IFH SRC_PORT field in ocelot_ifh_set_basic() Vladimir Oltean
2024-12-13 12:13 ` Simon Horman [this message]
2024-12-15 21:30 ` patchwork-bot+netdevbpf
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=20241213121347.GT2110@kernel.org \
--to=horms@kernel.org \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andrew@lunn.ch \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jacob.e.keller@intel.com \
--cc=kuba@kernel.org \
--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).