diff options
author | Eli Cohen <eli@mellanox.co.il> | 2011-12-12 23:15:24 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-13 13:56:07 -0500 |
commit | c82e9aa0a8bcf7a1643ccb71678bab57f3cb4bc6 (patch) | |
tree | d19f8112999c2a587bd33d68dd52653a95c1c6e9 /drivers/net/ethernet/mellanox/mlx4/eq.c | |
parent | acba2420f9d20082b17d0cbeb1137fcffe0f5b7e (diff) |
mlx4_core: resource tracking for HCA resources used by guests
The resource tracker is used to track usage of HCA resources by the different
guests.
Virtual functions (VFs) are attached to guest operating systems but
resources are allocated from the same pool and are assigned to VFs. It is
essential that hostile/buggy guests not be able to affect the operation of
other VFs, possibly attached to other guest OSs since ConnectX firmware is not
tolerant to misuse of resources.
The resource tracker module associates each resource with a VF and maintains
state information for the allocated object. It also defines allowed state
transitions and enforces them.
Relationships between resources are also referred to. For example, CQs are
pointed to by QPs, so it is forbidden to destroy a CQ if a QP refers to it.
ICM memory is always accessible through the primary function and hence it is
allocated by the owner of the primary function.
When a guest dies, an FLR is generated for all the VFs it owns and all the
resources it used are freed.
The tracked resource types are: QPs, CQs, SRQs, MPTs, MTTs, MACs, RES_EQs,
and XRCDNs.
Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/eq.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/eq.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c index 7416ef20c203..1e9b55eb7217 100644 --- a/drivers/net/ethernet/mellanox/mlx4/eq.c +++ b/drivers/net/ethernet/mellanox/mlx4/eq.c | |||
@@ -53,30 +53,6 @@ enum { | |||
53 | MLX4_EQ_ENTRY_SIZE = 0x20 | 53 | MLX4_EQ_ENTRY_SIZE = 0x20 |
54 | }; | 54 | }; |
55 | 55 | ||
56 | /* | ||
57 | * Must be packed because start is 64 bits but only aligned to 32 bits. | ||
58 | */ | ||
59 | struct mlx4_eq_context { | ||
60 | __be32 flags; | ||
61 | u16 reserved1[3]; | ||
62 | __be16 page_offset; | ||
63 | u8 log_eq_size; | ||
64 | u8 reserved2[4]; | ||
65 | u8 eq_period; | ||
66 | u8 reserved3; | ||
67 | u8 eq_max_count; | ||
68 | u8 reserved4[3]; | ||
69 | u8 intr; | ||
70 | u8 log_page_size; | ||
71 | u8 reserved5[2]; | ||
72 | u8 mtt_base_addr_h; | ||
73 | __be32 mtt_base_addr_l; | ||
74 | u32 reserved6[2]; | ||
75 | __be32 consumer_index; | ||
76 | __be32 producer_index; | ||
77 | u32 reserved7[4]; | ||
78 | }; | ||
79 | |||
80 | #define MLX4_EQ_STATUS_OK ( 0 << 28) | 56 | #define MLX4_EQ_STATUS_OK ( 0 << 28) |
81 | #define MLX4_EQ_STATUS_WRITE_FAIL (10 << 28) | 57 | #define MLX4_EQ_STATUS_WRITE_FAIL (10 << 28) |
82 | #define MLX4_EQ_OWNER_SW ( 0 << 24) | 58 | #define MLX4_EQ_OWNER_SW ( 0 << 24) |
@@ -135,19 +111,6 @@ static struct mlx4_eqe *next_slave_event_eqe(struct mlx4_slave_event_eq *slave_e | |||
135 | eqe : NULL; | 111 | eqe : NULL; |
136 | } | 112 | } |
137 | 113 | ||
138 | /* dummies for now */ | ||
139 | void mlx4_delete_all_resources_for_slave(struct mlx4_dev *dev, int slave) | ||
140 | { | ||
141 | } | ||
142 | |||
143 | int mlx4_get_slave_from_resource_id(struct mlx4_dev *dev, | ||
144 | enum mlx4_resource type, | ||
145 | int res_id, int *slave) | ||
146 | { | ||
147 | return -ENOENT; | ||
148 | } | ||
149 | /* end dummies */ | ||
150 | |||
151 | void mlx4_gen_slave_eqe(struct work_struct *work) | 114 | void mlx4_gen_slave_eqe(struct work_struct *work) |
152 | { | 115 | { |
153 | struct mlx4_mfunc_master_ctx *master = | 116 | struct mlx4_mfunc_master_ctx *master = |