All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: cedric.jehasse@luminex.be
Cc: andrew@lunn.ch, pabeni@redhat.com, horms@kernel.org,
	edumazet@google.com, olteanv@gmail.com, jiri@resnulli.us,
	linux@armlinux.org.uk, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, jhs@mojatatu.com, davem@davemloft.net
Subject: Re: [net-next,v6,2/2] net: dsa: mv88e6xxx: Add partial support for TCAM entries
Date: Fri, 6 Mar 2026 17:11:54 -0800	[thread overview]
Message-ID: <20260306171154.6cb256e1@kernel.org> (raw)
In-Reply-To: <20260307010712.1201087-1-kuba@kernel.org>

On Fri,  6 Mar 2026 17:07:12 -0800 Jakub Kicinski wrote:
> > +	reg |= MV88E6XXX_PORT_PRI_OVERRIDE_TCAM_MODE_96_BYTE;  
>                 ^^^
> 
> Would ORing the TCAM mode work correctly if the firmware has already
> configured the port to 48-byte mode? The TCAM mode field (bits 1:0) in
> the Priority Override register is a 2-bit enumeration where 0=disabled,
> 1=48-byte, 2=96-byte, and 3=reserved.
> 
> If bit 0 is already set (48-byte mode with value 0x0001), ORing with
> 0x0002 produces 0x0003 (reserved mode) instead of the intended 0x0002
> (96-byte mode). The standard pattern for setting an enumerated register
> field is clear-then-set:
> 
>     reg &= ~MV88E6XXX_PORT_PRI_OVERRIDE_TCAM_MODE_MASK;
>     reg |= MV88E6XXX_PORT_PRI_OVERRIDE_TCAM_MODE_96_BYTE;
> 
> In normal operation (hardware reset value 0x0000), the current OR
> produces the correct result. The issue only occurs if firmware or a
> bootloader has pre-configured 48-byte TCAM mode before the Linux driver
> initializes.

FWIW doesn't look possible from looking at the code (we seem to always
disable at init so field should be cleared?) But clearing the field
before setting it seems like a good practice, the rest of the driver
does follow the:

	reg &= ~MASK;
	reg |= val;

pattern. So consider this a stylistic nit pick, I guess..

      reply	other threads:[~2026-03-07  1:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-05  9:56 [PATCH net-next v6 0/2] net: dsa: mv88e6xxx: Add partial support for TCAM entries Cedric Jehasse
2026-03-05  9:56 ` Cedric Jehasse via B4 Relay
2026-03-05  9:56 ` [PATCH net-next v6 1/2] net/sched: cls_flower: remove unions from fl_flow_key Cedric Jehasse
2026-03-05  9:56   ` Cedric Jehasse via B4 Relay
2026-03-05  9:56 ` [PATCH net-next v6 2/2] net: dsa: mv88e6xxx: Add partial support for TCAM entries Cedric Jehasse
2026-03-05  9:56   ` Cedric Jehasse via B4 Relay
2026-03-07  1:07   ` [net-next,v6,2/2] " Jakub Kicinski
2026-03-07  1:11     ` Jakub Kicinski [this message]

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=20260306171154.6cb256e1@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=cedric.jehasse@luminex.be \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.