diff options
author | Mohamad Haj Yahia <mohamad@mellanox.com> | 2016-05-03 17:13:58 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-04 14:04:47 -0400 |
commit | dfcb1ed3c3315902e33da0fc5b0ae4c6d5086a23 (patch) | |
tree | 595dce0fc71cb768e57dfcd9e9ed909dc6ea4cb9 /drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | |
parent | 5742df0f7dbe54728145bf1136540c09c7fcb0d1 (diff) |
net/mlx5: E-Switch, Vport ingress/egress ACLs rules for VST mode
Configure ingress and egress vport ACL rules according to
vlan and qos admin parameters.
Ingress ACL flow table rules:
1) drop any tagged packet sent from the VF
2) allow other traffic (default behavior)
Egress ACL flow table rules:
1) allow only tagged traffic with vlan_tag=vst_vid.
2) drop other traffic.
Signed-off-by: Mohamad Haj Yahia <mohamad@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.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h index e6972074c3f7..30d55ace4786 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h @@ -94,13 +94,16 @@ struct vport_ingress { struct mlx5_flow_group *allow_spoofchk_only_grp; struct mlx5_flow_group *allow_untagged_only_grp; struct mlx5_flow_group *drop_grp; - + struct mlx5_flow_rule *allow_rule; + struct mlx5_flow_rule *drop_rule; }; struct vport_egress { struct mlx5_flow_table *acl; struct mlx5_flow_group *allowed_vlans_grp; struct mlx5_flow_group *drop_grp; + struct mlx5_flow_rule *allowed_vlan; + struct mlx5_flow_rule *drop_rule; }; struct mlx5_vport { @@ -113,6 +116,8 @@ struct mlx5_vport { struct vport_ingress ingress; struct vport_egress egress; + u16 vlan; + u8 qos; bool enabled; u16 enabled_events; }; @@ -137,6 +142,10 @@ struct mlx5_eswitch { struct mlx5_vport *vports; int total_vports; int enabled_vports; + /* Synchronize between vport change events + * and async SRIOV admin state changes + */ + struct mutex state_lock; }; /* E-Switch API */ |