mlx4_core: mtts resources units changed to offset

In the previous implementation mtts are managed by:
1. order     - log(mtt segments), 'mtt segment' groups several mtts together.
2. first_seg - segment location relative to mtt table.
In the current implementation:
1. order     - log(mtts) rather than segments
2. offset    - mtt index in mtt table

Note: The actual mtt allocation is made in segments but it is
      transparent to callers.

Rational: The mtt resource holders are not interested on how the allocation
          of mtt is done, but rather on how they will use it.

Signed-off-by: Marcel Apfelbaum <marcela@dev.mellanox.co.il>
Reviewed-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Marcel Apfelbaum
2011-12-13 04:16:56 +00:00
committed by David S. Miller
parent 5b4c4d3686
commit 2b8fb2867c
7 changed files with 92 additions and 99 deletions

View File

@@ -272,8 +272,7 @@ struct mlx4_caps {
int num_comp_vectors;
int comp_pool;
int num_mpts;
int num_mtt_segs;
int mtts_per_seg;
int num_mtts;
int fmr_reserved_mtts;
int reserved_mtts;
int reserved_mrws;
@@ -323,7 +322,7 @@ struct mlx4_buf {
};
struct mlx4_mtt {
u32 first_seg;
u32 offset;
int order;
int page_shift;
};