netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Vlad Buslov <vladbu@nvidia.com>
Cc: Saeed Mahameed <saeed@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>,
	Saeed Mahameed <saeedm@nvidia.com>, <netdev@vger.kernel.org>,
	Tariq Toukan <tariqt@nvidia.com>, Gal Pressman <gal@nvidia.com>
Subject: Re: [net-next 07/15] net/mlx5: Bridge, expose FDB state via debugfs
Date: Mon, 19 Jun 2023 11:28:49 -0700	[thread overview]
Message-ID: <20230619112849.06252444@kernel.org> (raw)
In-Reply-To: <87v8fjvnhq.fsf@nvidia.com>

On Mon, 19 Jun 2023 11:37:30 +0300 Vlad Buslov wrote:
> On Sat 17 Jun 2023 at 00:48, Jakub Kicinski <kuba@kernel.org> wrote:
> > On Fri, 16 Jun 2023 13:11:05 -0700 Saeed Mahameed wrote:  
> >> $ cat mlx5/0000\:08\:00.0/esw/bridge/bridge1/fdb
> >> DEV              MAC               VLAN              PACKETS                BYTES              LASTUSE FLAGS
> >> enp8s0f0_1       e4:0a:05:08:00:06    2                    2                  204           4295567112   0x0
> >> enp8s0f0_0       e4:0a:05:08:00:03    2                    3                  278           4295567112   0x0  
> >
> > The flags here are the only thing that's mlx5 specific?  
> 
> Not exactly. This debugfs exposes the state of our bridge offload layer.
> For example, when VF representors from different eswitches are added to
> the same bridge every FDB entry on such bridge will have multiple
> underlying offloaded steering rules (one per eswitch instance connected
> to the bridge). User will observe the entries in all connected 'fdb'
> debugfs' (all except the 'main' entry will have flag
> MLX5_ESW_BRIDGE_FLAG_PEER set) and their corresponding counters will
> increment only on the eswitch instance that is actually processing the
> packets, which depends on the mode (when bonding device is added to the
> bridge in single FDB LAG mode all traffic appears on eswitch 0, without
> it the the traffic is on the eswitch of parent uplink of the VF). I
> understand that this is rather convoluted but this is exactly why we are
> going with debugfs.
> 
> > Why not add an API for dumping this kind of stats that other drivers
> > can reuse?  
> 
> As explained in previous paragraph we would like to expose internal mlx5
> bridge layer for debug purposes, not to design generic bridge FDB
> counter interface. Also, the debugging needs of our implementation may
> not correspond to other drivers because we don't have a 'hardware
> switch' on our NIC, so we do things like learning and ageing in
> software, and have to deal with multiple possible mode of operations
> (single FDB vs merged eswitch from previous example, etc.).

Looks like my pw-bot shenanigans backfired / crashed, patches didn't
get marked as Changes Requested and Dave applied the series :S

I understand the motivation but the information is easy enough to
understand to potentially tempt a user to start depending on it for
production needs. Then another vendor may get asked to implement
similar but not exactly the same set of stats etc. etc.

Do you have customer who will need this?

At the very least please follow up to make the files readable to only
root. Normal users should never look at debugfs IMO.

  reply	other threads:[~2023-06-19 18:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16 20:10 [pull request][net-next 00/15] mlx5 updates 2023-06-16 Saeed Mahameed
2023-06-16 20:10 ` [net-next 01/15] net/mlx5: Ack on sync_reset_request only if PF can do reset_now Saeed Mahameed
2023-06-18 18:00   ` patchwork-bot+netdevbpf
2023-06-16 20:11 ` [net-next 02/15] net/mlx5: Expose timeout for sync reset unload stage Saeed Mahameed
2023-06-16 20:11 ` [net-next 03/15] net/mlx5: Check DTOR entry value is not zero Saeed Mahameed
2023-06-16 20:11 ` [net-next 04/15] net/mlx5: Handle sync reset unload event Saeed Mahameed
2023-06-16 20:11 ` [net-next 05/15] net/mlx5: Create eswitch debugfs root directory Saeed Mahameed
2023-06-16 20:11 ` [net-next 06/15] net/mlx5: Bridge, pass net device when linking vport to bridge Saeed Mahameed
2023-06-16 20:11 ` [net-next 07/15] net/mlx5: Bridge, expose FDB state via debugfs Saeed Mahameed
2023-06-17  7:48   ` Jakub Kicinski
2023-06-19  8:37     ` Vlad Buslov
2023-06-19 18:28       ` Jakub Kicinski [this message]
2023-06-19 18:34         ` Vlad Buslov
2023-06-19 19:05           ` Jakub Kicinski
2023-06-19 19:13             ` Vlad Buslov
2023-06-16 20:11 ` [net-next 08/15] net/mlx5: E-Switch, remove redundant else statements Saeed Mahameed
2023-06-16 20:11 ` [net-next 09/15] net/mlx5e: Remove mlx5e_dbg() and msglvl support Saeed Mahameed
2023-06-16 20:11 ` [net-next 10/15] net/mlx5: Expose bits for local loopback counter Saeed Mahameed
2023-06-16 20:11 ` [net-next 11/15] net/mlx5e: Add local loopback counter to vport stats Saeed Mahameed
2023-06-16 20:11 ` [net-next 12/15] net/mlx5: Fix the macro for accessing EC VF vports Saeed Mahameed
2023-06-16 20:11 ` [net-next 13/15] net/mlx5: DR, update query of HCA caps for EC VFs Saeed Mahameed
2023-06-16 20:11 ` [net-next 14/15] net/mlx5: Add header file for events Saeed Mahameed
2023-06-16 20:11 ` [net-next 15/15] net/mlx5: Remove unused ecpu field from struct mlx5_sf_table Saeed Mahameed

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=20230619112849.06252444@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeed@kernel.org \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    --cc=vladbu@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;
as well as URLs for NNTP newsgroup(s).