Files
Shay Drory d6c9b4de81 {net/RDMA}/mlx5: Add LAG demux table API and vport demux rules
Downstream patches will introduce SW-only LAG (e.g. shared_fdb without
HW LAG). In this mode the firmware cannot create the LAG demux table,
but vport demuxing is still required.

Move LAG demux flow-table ownership to the LAG layer and introduce APIs
to init/cleanup the demux table and add/delete per-vport rules. Adjust
the RDMA driver to use the new APIs.

In this mode, the LAG layer will create a flow group that matches vport
metadata. Vports that are not native to the LAG master eswitch add the
demux rule during IB representor load and remove it on unload.
The demux rule forward traffic from said vports to their native eswitch
manager via a new dest type - MLX5_FLOW_DESTINATION_TYPE_VHCA_RX.

Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260309093435.1850724-9-tariqt@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2026-03-16 16:23:00 -04:00

22 lines
697 B
C

/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
/* Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */
#ifndef __MLX5_LAG_API_H__
#define __MLX5_LAG_API_H__
#include <linux/types.h>
struct mlx5_core_dev;
struct mlx5_flow_table;
struct mlx5_flow_table_attr;
int mlx5_lag_demux_init(struct mlx5_core_dev *dev,
struct mlx5_flow_table_attr *ft_attr);
void mlx5_lag_demux_cleanup(struct mlx5_core_dev *dev);
int mlx5_lag_demux_rule_add(struct mlx5_core_dev *dev, u16 vport_num,
int vport_index);
void mlx5_lag_demux_rule_del(struct mlx5_core_dev *dev, int vport_index);
int mlx5_lag_get_dev_seq(struct mlx5_core_dev *dev);
#endif /* __MLX5_LAG_API_H__ */