pre-reserve MPTs for FC
PATCH 1/10 pre-reserve MPTs for FC
From: Yevgeny Petrilin <yevgenyp-VPRAkNaXOzVS1MOuV/[email protected]>
Date: Sun, 16 Nov 2008 10:25:59 +0200
Subject: [PATCH] mlx4: Fibre Channel support
As we did with QPs, some of the MPTs are pre-reserved
(the MPTs that are mapped for FEXCHs, 2*64K of them).
So needed to split the operation of allocating an MPT to two:
The allocation of a bit from the bitmap
The actual creation of the entry (and it's MTT).
So, mr_alloc_reserved() is the second part, where you know which MPT number was allocated. mr_alloc() is the one that allocates a number from the bitmap.
Normal users keep using the original mr_alloc().
For FEXCH, when we know the pre-reserved MPT entry, we call mr_alloc_reserved() directly.
Same with the mr_free() and corresponding mr_free_reserved(). The first will just put back the bit, the later will actually destroy the entry, but will leave the bit set.
map_phys_fmr_fbo() is very much like the original map_phys_fmr() allows setting an FBO (First Byte Offset) for the MPT allows setting the data length for the MPT
does not increase the higher bits of the key after every map.
drivers/net/mlx4/main.c | 4 +- drivers/net/mlx4/mr.c | 128 +++++++++++++++++++++++++++++++++++++----- include/linux/mlx4/device.h | 21 +++++++- include/linux/mlx4/qp.h | 11 +++- 4 files changed, 144 insertions(+), 20 deletions(-)
From: Yevgeny Petrilin <yevgenyp-VPRAkNaXOzVS1MOuV/[email protected]>
Date: Sun, 16 Nov 2008 10:25:59 +0200
Subject: [PATCH] mlx4: Fibre Channel support
As we did with QPs, some of the MPTs are pre-reserved
(the MPTs that are mapped for FEXCHs, 2*64K of them).
So needed to split the operation of allocating an MPT to two:
The allocation of a bit from the bitmap
The actual creation of the entry (and it's MTT).
So, mr_alloc_reserved() is the second part, where you know which MPT number was allocated. mr_alloc() is the one that allocates a number from the bitmap.
Normal users keep using the original mr_alloc().
For FEXCH, when we know the pre-reserved MPT entry, we call mr_alloc_reserved() directly.
Same with the mr_free() and corresponding mr_free_reserved(). The first will just put back the bit, the later will actually destroy the entry, but will leave the bit set.
map_phys_fmr_fbo() is very much like the original map_phys_fmr()
allows setting an FBO (First Byte Offset) for the MPT allows setting the data length for the MPT
does not increase the higher bits of the key after every map.
drivers/net/mlx4/main.c | 4 +- drivers/net/mlx4/mr.c | 128 +++++++++++++++++++++++++++++++++++++----- include/linux/mlx4/device.h | 21 +++++++- include/linux/mlx4/qp.h | 11 +++- 4 files changed, 144 insertions(+), 20 deletions(-)
drivers/net/mlx4/main.c +2 -2
@@ -79,12 +79,12 @@ static char mlx4_version[] __devinitdata =DRV_VERSION " (" DRV_RELDATE ")\n" ;static struct mlx4_profile default_profile = { - .num_qp =1 <<17 , + .num_qp =1 <<18 , .num_srq =1 <<16 , .rdmarc_per_qp =1 <<4 , .num_cq =1 <<16 , .num_mcg =1 <<13 , - .num_mpt =1 <<17 , + .num_mpt =1 <<19 , .num_mtt =1 <<20 , };
drivers/net/mlx4/mr.c +112 -16
209 lines not on this page · raw message
include/linux/mlx4/device.h +11 -0
@@ -424,8 +432,12 @@ int mlx4_mtt_init(struct mlx4_dev *dev, int npages, int page_shift,void mlx4_mtt_cleanup (struct mlx4_dev *dev,struct mlx4_mtt *mtt);u64 mlx4_mtt_addr (struct mlx4_dev *dev,struct mlx4_mtt *mtt); +int mlx4_mr_alloc_reserved (struct mlx4_dev *dev,u32 mridx,u32 pd, +u64 iova,u64 size,u32 access,int npages, +int page_shift,struct mlx4_mr *mr);int mlx4_mr_alloc (struct mlx4_dev *dev,u32 pd,u64 iova,u64 size,u32 access,int npages,int page_shift,struct mlx4_mr *mr); +void mlx4_mr_free_reserved (struct mlx4_dev *dev,struct mlx4_mr *mr);void mlx4_mr_free (struct mlx4_dev *dev,struct mlx4_mr *mr);int mlx4_mr_enable (struct mlx4_dev *dev,struct mlx4_mr *mr); int mlx4_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
@@ -471,13 +483,20 @@ void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index);int mlx4_register_vlan (struct mlx4_dev *dev,u8 port,u16 vlan,int *index);void mlx4_unregister_vlan (struct mlx4_dev *dev,u8 port,int index); +int mlx4_map_phys_fmr_fbo (struct mlx4_dev *dev,struct mlx4_fmr *fmr, +u64 *page_list,int npages,u64 iova,u32 fbo, +u32 len,u32 *lkey,u32 *rkey,int same_key);int mlx4_map_phys_fmr (struct mlx4_dev *dev,struct mlx4_fmr *fmr,u64 *page_list,int npages,u64 iova,u32 *lkey,u32 *rkey); +int mlx4_fmr_alloc_reserved (struct mlx4_dev *dev,u32 mridx,u32 pd, +u32 access,int max_pages,int max_maps, +u8 page_shift,struct mlx4_fmr *fmr);int mlx4_fmr_alloc (struct mlx4_dev *dev,u32 pd,u32 access,int max_pages,int max_maps,u8 page_shift,struct mlx4_fmr *fmr);int mlx4_fmr_enable (struct mlx4_dev *dev,struct mlx4_fmr *fmr);void mlx4_fmr_unmap (struct mlx4_dev *dev,struct mlx4_fmr *fmr,u32 *lkey,u32 *rkey); +int mlx4_fmr_free_reserved (struct mlx4_dev *dev,struct mlx4_fmr *fmr);int mlx4_fmr_free (struct mlx4_dev *dev,struct mlx4_fmr *fmr);int mlx4_SYNC_TPT (struct mlx4_dev *dev);
include/linux/mlx4/qp.h +10 -1
@@ -151,7 +151,16 @@ struct mlx4_qp_context {u8 reserved4[2 ];u8 mtt_base_addr_h;__be32 mtt_base_addr_l; -u32 reserved5[10 ]; +u8 VE ; +u8 reserved5; +__be16 VFT_id_prio; +u8 reserved6; +u8 exch_size; +__be16 exch_base; +u8 VFT_hop_cnt; +u8 my_fc_id_idx; +__be16 reserved7; +u32 reserved8[7 ]; };/* Which firmware version adds support for NEC (NoErrorCompletion) bit */
_______________________________________________
ewg mailing list [email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg