summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
diff options
context:
space:
mode:
authorHadar Hen Zion2016-07-01 13:51:08 +0200
committerDavid S. Miller2016-07-02 20:40:41 +0200
commit127ea380acc9de16c2cbd57ed99475944c9917ec (patch)
treeb509e40f830bdf00166fb120053a1169240f1ffb /drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
parentnet/mlx5e: Add support for multiple profiles (diff)
downloadkernel-qcow2-linux-127ea380acc9de16c2cbd57ed99475944c9917ec.tar.gz
kernel-qcow2-linux-127ea380acc9de16c2cbd57ed99475944c9917ec.tar.xz
kernel-qcow2-linux-127ea380acc9de16c2cbd57ed99475944c9917ec.zip
net/mlx5: Add Representors registration API
Introduce E-Switch registration/unregister representors functions. Those functions are called by the mlx5e driver when the PF NIC is created upon pci probe action regardless of the E-Switch mode (NONE, LEGACY or OFFLOADS). Adding basic E-Switch database that will hold the vport represntors upon creation. This patch doesn't add any new functionality. Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/eswitch.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/eswitch.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
index 7843f981509d..ffe5eaba626d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
@@ -156,9 +156,17 @@ enum {
SRIOV_OFFLOADS
};
+
+struct mlx5_eswitch_rep {
+ u16 vport;
+ void *priv_data;
+ bool valid;
+};
+
struct mlx5_esw_offload {
struct mlx5_flow_table *ft_offloads;
struct mlx5_flow_group *vport_rx_group;
+ struct mlx5_eswitch_rep *vport_reps;
};
struct mlx5_eswitch {
@@ -208,6 +216,10 @@ mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, int vport, u32 tirn)
int mlx5_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode);
int mlx5_devlink_eswitch_mode_get(struct devlink *devlink, u16 *mode);
+void mlx5_eswitch_register_vport_rep(struct mlx5_eswitch *esw,
+ struct mlx5_eswitch_rep *rep);
+void mlx5_eswitch_unregister_vport_rep(struct mlx5_eswitch *esw,
+ int vport);
#define MLX5_DEBUG_ESWITCH_MASK BIT(3)