netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Tobias Waldekranz <tobias@waldekranz.com>
Cc: davem@davemloft.net, maxime.chevallier@bootlin.com,
	marcin.s.wojtas@gmail.com, linux@armlinux.org.uk, andrew@lunn.ch,
	edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org
Subject: Re: [PATCH v4 net] net: mvpp2: Prevent parser TCAM memory corruption
Date: Mon, 31 Mar 2025 16:51:37 -0700	[thread overview]
Message-ID: <20250331165137.467fbea1@kernel.org> (raw)
In-Reply-To: <20250327103139.567970-1-tobias@waldekranz.com>

On Thu, 27 Mar 2025 11:30:49 +0100 Tobias Waldekranz wrote:
> +static void mvpp2_prs_mac_promisc_set_unlocked(struct mvpp2 *priv, int port,

Could be subjective but I tend to call things _locked, not _unlocked.
As it the function is called in context in which the state is already
locked. Could you change? Another way would be to just prepend two
underscores to the name..

> +					       enum mvpp2_prs_l2_cast l2_cast,
> +					       bool add)
>  {
>  	struct mvpp2_prs_entry pe;
>  	unsigned char cast_match;
>  	unsigned int ri;
>  	int tid;
>  
> +	lockdep_assert_held(&priv->prs_spinlock);
> +
>  	if (l2_cast == MVPP2_PRS_L2_UNI_CAST) {
>  		cast_match = MVPP2_PRS_UCAST_VAL;
>  		tid = MVPP2_PE_MAC_UC_PROMISCUOUS;

> @@ -522,6 +541,14 @@ void mvpp2_prs_mac_promisc_set(struct mvpp2 *priv, int port,
>  	mvpp2_prs_hw_write(priv, &pe);
>  }
>  
> +void mvpp2_prs_mac_promisc_set(struct mvpp2 *priv, int port,
> +			       enum mvpp2_prs_l2_cast l2_cast, bool add)
> +{
> +		spin_lock_bh(&priv->prs_spinlock);
> +		mvpp2_prs_mac_promisc_set_unlocked(priv, port, l2_cast, add);
> +		spin_unlock_bh(&priv->prs_spinlock);

nit2: this is indented too much

> +}
-- 
pw-bot: cr

      reply	other threads:[~2025-03-31 23:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-27 10:30 [PATCH v4 net] net: mvpp2: Prevent parser TCAM memory corruption Tobias Waldekranz
2025-03-31 23:51 ` 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=20250331165137.467fbea1@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=linux@armlinux.org.uk \
    --cc=marcin.s.wojtas@gmail.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tobias@waldekranz.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).