aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHadar Hen Zion <hadarh@mellanox.com>2012-09-05 18:50:49 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-07 12:55:59 -0400
commit7fb40f87c4195ec1728527f30bc744c47a45b366 (patch)
tree4a7356fc76c4db03731d7354c66f7b158682d295 /include
parenta8edc3bf05a3465726afdf635a820761fae0d50b (diff)
net/mlx4_core: Add security check / enforcement for flow steering rules set for VMs
Since VFs may be mapped to VMs which aren't trusted entities, flow steering rules attached through the wrapper on behalf of VFs must be checked to make sure that their L2 specification relate to MAC address assigned to that VF, and add L2 specification if its missing. Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mlx4/device.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 244ba902ab7..6e1b0f973a0 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -798,6 +798,17 @@ enum mlx4_net_trans_rule_id {
798 798
799extern const u16 __sw_id_hw[]; 799extern const u16 __sw_id_hw[];
800 800
801static inline int map_hw_to_sw_id(u16 header_id)
802{
803
804 int i;
805 for (i = 0; i < MLX4_NET_TRANS_RULE_NUM; i++) {
806 if (header_id == __sw_id_hw[i])
807 return i;
808 }
809 return -EINVAL;
810}
811
801enum mlx4_net_trans_promisc_mode { 812enum mlx4_net_trans_promisc_mode {
802 MLX4_FS_PROMISC_NONE = 0, 813 MLX4_FS_PROMISC_NONE = 0,
803 MLX4_FS_PROMISC_UPLINK, 814 MLX4_FS_PROMISC_UPLINK,