summaryrefslogtreecommitdiffstats
path: root/include/linux/mlx5/driver.h
diff options
context:
space:
mode:
authorMark Bloch <markb@mellanox.com>2018-01-16 14:04:14 +0000
committerSaeed Mahameed <saeedm@mellanox.com>2018-02-23 12:36:38 -0800
commit57cbd893c4c575a24594fa6c0835247506ce26e2 (patch)
tree6c3c525723a8da115fece1f09c0368197ebc5ed0 /include/linux/mlx5/driver.h
parent22215908d81f61d293e8b128e819a8437f37cc20 (diff)
downloadlinux-57cbd893c4c575a24594fa6c0835247506ce26e2.tar.gz
linux-57cbd893c4c575a24594fa6c0835247506ce26e2.tar.bz2
linux-57cbd893c4c575a24594fa6c0835247506ce26e2.zip
net/mlx5: E-Switch, Move representors definition to a global scope
In preparation for IB representors, move representors structs to a global scope, also expose functions needed for registration, unregistration, eswitch mode and creating a flow rule to direct traffic from SQs to the right VF. Signed-off-by: Mark Bloch <markb@mellanox.com> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'include/linux/mlx5/driver.h')
-rw-r--r--include/linux/mlx5/driver.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index bfea26af6de5..4814cad7456e 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -1224,6 +1224,12 @@ static inline int mlx5_core_is_pf(struct mlx5_core_dev *dev)
return !(dev->priv.pci_dev_data & MLX5_PCI_DEV_IS_VF);
}
+#define MLX5_TOTAL_VPORTS(mdev) (1 + pci_sriov_get_totalvfs((mdev)->pdev))
+#define MLX5_VPORT_MANAGER(mdev) \
+ (MLX5_CAP_GEN(mdev, vport_group_manager) && \
+ (MLX5_CAP_GEN(mdev, port_type) == MLX5_CAP_PORT_TYPE_ETH) && \
+ mlx5_core_is_pf(mdev))
+
static inline int mlx5_get_gid_table_len(u16 param)
{
if (param > 4) {