🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by Simon Horman Mon, 30 Nov 2026 19:52
Re: [PATCH net-next V2 1/5] net/mlx5: E-switch, add match-metadata allocator for nested VF/SF eswitches
#24770
Author: Simon Horman
Date: Mon, 30 Nov 2026 19:52
41 lines
10246 bytes
On Fri, Nov 20, 2026 at 09:59:54AM +0200, Tariq Toukan wrote:
> From: Shay Drory <shayd@nvidia.com>
> 
> The eswitch source-port match metadata is laid out as 4 bits of PFNUM
> and 12 bits of a unique id (ESW_SOURCE_PORT_METADATA_BITS). PFNUM is the
> native_port_num reported in HCA_CAP, so all VFs/SFs of the same PF share
> a single PFNUM. Each VF/SF eswitch allocates its id from its own
> vport_metadata_ida, restarting from the lowest value, so two VFs/SFs of
> the same PF can end up with identical metadata. Once their eswitches
> share an FDB (virt LAG), that metadata no longer uniquely identifies the
> source port.
> 
> Add a dedicated allocator for nested (virt LAG) eswitches that replaces
> the PFNUM field with the VF/SF's slot in the LAG (its xarray index in
> ldev->fns). That index is unique per function within the LAG, so
> combined with a per-VF/SF id it yields unique metadata regardless of
> which PF the VFs/SFs belong to. The split is 8 bits for the virt LAG
> index - which fits the U8_MAX cap on the LAG xarray - and the remaining
> 8 bits for the id; the two still sum to ESW_SOURCE_PORT_METADATA_BITS,
> so nothing downstream of the match changes. Describe the nested layout
> next to the reg_c_0 layout in include/linux/mlx5/eswitch.h.
> 
> The PFNUM value 0xf is reserved for internal port offload, which stamps
> it into reg_c_0 and matches it with the same mask used for vport
> metadata. That offload is gated on switchdev mode only, so it can be
> used on a nested eswitch as well. Cap the LAG index accordingly.
> 
> Select the nested layout for a non-PF eswitch, unless it is virt LAG
> capable but not a LAG member, e.g. one refused as a late joiner and left
> standalone. Such a device keeps the PFNUM layout: it does not pair with
> the eswitches of the LAG members, so its metadata is never compared
> against theirs. PFs, which never report the virt LAG capabilities, keep
> the PFNUM layout.
> 
> Signed-off-by: Shay Drory <shayd@nvidia.com>
> Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
> Reviewed-by: Mark Bloch <mbloch@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>

Reviewed-by: Simon Horman <horms@kernel.org>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads