public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Ido Schimmel <idosch@nvidia.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"petrm@nvidia.com" <petrm@nvidia.com>,
	"jiri@nvidia.com" <jiri@nvidia.com>,
	"danieller@nvidia.com" <danieller@nvidia.com>,
	"vadimp@nvidia.com" <vadimp@nvidia.com>
Subject: Re: [PATCH net-next 02/12] mlxsw: spectrum_span: Ignore VLAN entries not used by the bridge in mirroring
Date: Tue, 22 Feb 2022 17:26:32 +0000	[thread overview]
Message-ID: <20220222172632.ohyamkkiztspp5zl@skbuf> (raw)
In-Reply-To: <20220222171703.499645-3-idosch@nvidia.com>

On Tue, Feb 22, 2022 at 07:16:53PM +0200, Ido Schimmel wrote:
> Only VLAN entries installed on the bridge device itself should be
> considered when checking whether a packet with a specific VLAN can be
> mirrored via a bridge device. VLAN entries only used to keep context
> (i.e., entries with 'BRIDGE_VLAN_INFO_BRENTRY' unset) should be ignored.
> 
> Fix this by preventing mirroring when the VLAN entry does not have the
> 'BRIDGE_VLAN_INFO_BRENTRY' flag set.
> 
> Fixes: ddaff5047003 ("mlxsw: spectrum: remove guards against !BRIDGE_VLAN_INFO_BRENTRY")
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> Reviewed-by: Petr Machata <petrm@nvidia.com>
> ---

Sorry, I didn't realize br_vlan_get_info() doesn't have a
br_vlan_should_use() check. Maybe we should add it, for the same
consideration that a !BRENTRY master VLAN is still a data structure
private to the bridge, that shouldn't be revealed to other modules?

Anyway, this works too.

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

> Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
>  drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
> index 5459490c7790..b73466470f75 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
> @@ -269,7 +269,8 @@ mlxsw_sp_span_entry_bridge_8021q(const struct net_device *br_dev,
>  
>  	if (!vid && WARN_ON(br_vlan_get_pvid(br_dev, &vid)))
>  		return NULL;
> -	if (!vid || br_vlan_get_info(br_dev, vid, &vinfo))
> +	if (!vid || br_vlan_get_info(br_dev, vid, &vinfo) ||
> +	    !(vinfo.flags & BRIDGE_VLAN_INFO_BRENTRY))
>  		return NULL;
>  
>  	edev = br_fdb_find_port(br_dev, dmac, vid);
> -- 
> 2.33.1
>

  reply	other threads:[~2022-02-22 17:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22 17:16 [PATCH net-next 00/12] mlxsw: Various updates Ido Schimmel
2022-02-22 17:16 ` [PATCH net-next 01/12] mlxsw: core: Prevent trap group setting if driver does not support EMAD Ido Schimmel
2022-02-22 17:16 ` [PATCH net-next 02/12] mlxsw: spectrum_span: Ignore VLAN entries not used by the bridge in mirroring Ido Schimmel
2022-02-22 17:26   ` Vladimir Oltean [this message]
2022-02-22 17:16 ` [PATCH net-next 03/12] mlxsw: core_thermal: Avoid creation of virtual hwmon objects by thermal module Ido Schimmel
2022-02-22 17:16 ` [PATCH net-next 04/12] mlxsw: core_hwmon: Fix variable names for hwmon attributes Ido Schimmel
2022-02-22 17:16 ` [PATCH net-next 05/12] mlxsw: core_thermal: Rename labels according to naming convention Ido Schimmel
2022-02-22 17:16 ` [PATCH net-next 06/12] mlxsw: core_thermal: Remove obsolete API for query resource Ido Schimmel
2022-02-22 17:16 ` [PATCH net-next 07/12] mlxsw: reg: Add "mgpir_" prefix to MGPIR fields comments Ido Schimmel
2022-02-22 17:16 ` [PATCH net-next 08/12] mlxsw: core: Remove unnecessary asserts Ido Schimmel
2022-02-22 17:17 ` [PATCH net-next 09/12] mlxsw: spectrum: Remove SP{1,2,3} defines for FW minor and subminor Ido Schimmel
2022-02-22 17:17 ` [PATCH net-next 10/12] mlxsw: core: Unify method of trap support validation Ido Schimmel
2022-02-22 17:17 ` [PATCH net-next 11/12] mlxsw: Remove resource query check Ido Schimmel
2022-02-22 17:17 ` [PATCH net-next 12/12] mlxsw: core: Add support for OSFP transceiver modules Ido Schimmel
2022-02-23 12:50 ` [PATCH net-next 00/12] mlxsw: Various updates 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=20220222172632.ohyamkkiztspp5zl@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=danieller@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=idosch@nvidia.com \
    --cc=jiri@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@nvidia.com \
    --cc=vadimp@nvidia.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