Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
ehca_mrmw.c File Reference
#include <linux/slab.h>
#include <rdma/ib_umem.h>
#include "ehca_iverbs.h"
#include "ehca_mrmw.h"
#include "hcp_if.h"
#include "hipz_hw.h"

Go to the source code of this file.

Data Structures

struct  ehca_dir_bmap
 
struct  ehca_top_bmap
 
struct  ehca_bmap
 

Macros

#define NUM_CHUNKS(length, chunk_size)   (((length) + (chunk_size - 1)) / (chunk_size))
 
#define MAX_RPAGES   512
 
#define EHCA_SECTSHIFT   SECTION_SIZE_BITS
 
#define EHCA_SECTSIZE   (1UL << EHCA_SECTSHIFT)
 
#define EHCA_HUGEPAGESHIFT   34
 
#define EHCA_HUGEPAGE_SIZE   (1UL << EHCA_HUGEPAGESHIFT)
 
#define EHCA_HUGEPAGE_PFN_MASK   ((EHCA_HUGEPAGE_SIZE - 1) >> PAGE_SHIFT)
 
#define EHCA_INVAL_ADDR   0xFFFFFFFFFFFFFFFFULL
 
#define EHCA_DIR_INDEX_SHIFT   13 /* 8k Entries in 64k block */
 
#define EHCA_TOP_INDEX_SHIFT   (EHCA_DIR_INDEX_SHIFT * 2)
 
#define EHCA_MAP_ENTRIES   (1 << EHCA_DIR_INDEX_SHIFT)
 
#define EHCA_TOP_MAP_SIZE   (0x10000) /* currently fixed map size */
 
#define EHCA_DIR_MAP_SIZE   (0x10000)
 
#define EHCA_ENT_MAP_SIZE   (0x10000)
 
#define EHCA_INDEX_MASK   (EHCA_MAP_ENTRIES - 1)
 
#define EHCA_MR_PGSHIFT4K   12
 
#define EHCA_MR_PGSHIFT64K   16
 
#define EHCA_MR_PGSHIFT1M   20
 
#define EHCA_MR_PGSHIFT16M   24
 
#define ehca_bmap_valid(entry)   ((u64)entry != (u64)EHCA_INVAL_ADDR)
 

Enumerations

enum  ehca_mr_pgsize { EHCA_MR_PGSIZE4K = 0x1000L, EHCA_MR_PGSIZE64K = 0x10000L, EHCA_MR_PGSIZE1M = 0x100000L, EHCA_MR_PGSIZE16M = 0x1000000L }
 

Functions

struct ib_mrehca_get_dma_mr (struct ib_pd *pd, int mr_access_flags)
 
struct ib_mrehca_reg_phys_mr (struct ib_pd *pd, struct ib_phys_buf *phys_buf_array, int num_phys_buf, int mr_access_flags, u64 *iova_start)
 
struct ib_mrehca_reg_user_mr (struct ib_pd *pd, u64 start, u64 length, u64 virt, int mr_access_flags, struct ib_udata *udata)
 
int ehca_rereg_phys_mr (struct ib_mr *mr, int mr_rereg_mask, struct ib_pd *pd, struct ib_phys_buf *phys_buf_array, int num_phys_buf, int mr_access_flags, u64 *iova_start)
 
int ehca_query_mr (struct ib_mr *mr, struct ib_mr_attr *mr_attr)
 
int ehca_dereg_mr (struct ib_mr *mr)
 
struct ib_mwehca_alloc_mw (struct ib_pd *pd)
 
int ehca_bind_mw (struct ib_qp *qp, struct ib_mw *mw, struct ib_mw_bind *mw_bind)
 
int ehca_dealloc_mw (struct ib_mw *mw)
 
struct ib_fmrehca_alloc_fmr (struct ib_pd *pd, int mr_access_flags, struct ib_fmr_attr *fmr_attr)
 
int ehca_map_phys_fmr (struct ib_fmr *fmr, u64 *page_list, int list_len, u64 iova)
 
int ehca_unmap_fmr (struct list_head *fmr_list)
 
int ehca_dealloc_fmr (struct ib_fmr *fmr)
 
int ehca_reg_mr (struct ehca_shca *shca, struct ehca_mr *e_mr, u64 *iova_start, u64 size, int acl, struct ehca_pd *e_pd, struct ehca_mr_pginfo *pginfo, u32 *lkey, u32 *rkey, enum ehca_reg_type reg_type)
 
int ehca_reg_mr_rpages (struct ehca_shca *shca, struct ehca_mr *e_mr, struct ehca_mr_pginfo *pginfo)
 
int ehca_rereg_mr_rereg1 (struct ehca_shca *shca, struct ehca_mr *e_mr, u64 *iova_start, u64 size, u32 acl, struct ehca_pd *e_pd, struct ehca_mr_pginfo *pginfo, u32 *lkey, u32 *rkey)
 
int ehca_rereg_mr (struct ehca_shca *shca, struct ehca_mr *e_mr, u64 *iova_start, u64 size, int acl, struct ehca_pd *e_pd, struct ehca_mr_pginfo *pginfo, u32 *lkey, u32 *rkey)
 
int ehca_unmap_one_fmr (struct ehca_shca *shca, struct ehca_mr *e_fmr)
 
int ehca_reg_smr (struct ehca_shca *shca, struct ehca_mr *e_origmr, struct ehca_mr *e_newmr, u64 *iova_start, int acl, struct ehca_pd *e_pd, u32 *lkey, u32 *rkey)
 
int ehca_reg_internal_maxmr (struct ehca_shca *shca, struct ehca_pd *e_pd, struct ehca_mr **e_maxmr)
 
int ehca_reg_maxmr (struct ehca_shca *shca, struct ehca_mr *e_newmr, u64 *iova_start, int acl, struct ehca_pd *e_pd, u32 *lkey, u32 *rkey)
 
int ehca_dereg_internal_maxmr (struct ehca_shca *shca)
 
int ehca_mr_chk_buf_and_calc_size (struct ib_phys_buf *phys_buf_array, int num_phys_buf, u64 *iova_start, u64 *size)
 
int ehca_fmr_check_page_list (struct ehca_mr *e_fmr, u64 *page_list, int list_len)
 
int ehca_set_pagebuf (struct ehca_mr_pginfo *pginfo, u32 number, u64 *kpage)
 
int ehca_mr_is_maxmr (u64 size, u64 *iova_start)
 
void ehca_mrmw_map_acl (int ib_acl, u32 *hipz_acl)
 
void ehca_mrmw_set_pgsize_hipz_acl (u32 pgsize, u32 *hipz_acl)
 
void ehca_mrmw_reverse_map_acl (const u32 *hipz_acl, int *ib_acl)
 
void ehca_mr_deletenew (struct ehca_mr *mr)
 
int ehca_init_mrmw_cache (void)
 
void ehca_cleanup_mrmw_cache (void)
 
void ehca_destroy_busmap (void)
 
int ehca_create_busmap (void)
 

Variables

struct ib_dma_mapping_ops ehca_dma_mapping_ops
 

Macro Definition Documentation

#define ehca_bmap_valid (   entry)    ((u64)entry != (u64)EHCA_INVAL_ADDR)

Definition at line 1531 of file ehca_mrmw.c.

#define EHCA_DIR_INDEX_SHIFT   13 /* 8k Entries in 64k block */

Definition at line 64 of file ehca_mrmw.c.

#define EHCA_DIR_MAP_SIZE   (0x10000)

Definition at line 68 of file ehca_mrmw.c.

#define EHCA_ENT_MAP_SIZE   (0x10000)

Definition at line 69 of file ehca_mrmw.c.

#define EHCA_HUGEPAGE_PFN_MASK   ((EHCA_HUGEPAGE_SIZE - 1) >> PAGE_SHIFT)

Definition at line 62 of file ehca_mrmw.c.

#define EHCA_HUGEPAGE_SIZE   (1UL << EHCA_HUGEPAGESHIFT)

Definition at line 61 of file ehca_mrmw.c.

#define EHCA_HUGEPAGESHIFT   34

Definition at line 60 of file ehca_mrmw.c.

#define EHCA_INDEX_MASK   (EHCA_MAP_ENTRIES - 1)

Definition at line 70 of file ehca_mrmw.c.

#define EHCA_INVAL_ADDR   0xFFFFFFFFFFFFFFFFULL

Definition at line 63 of file ehca_mrmw.c.

#define EHCA_MAP_ENTRIES   (1 << EHCA_DIR_INDEX_SHIFT)

Definition at line 66 of file ehca_mrmw.c.

#define EHCA_MR_PGSHIFT16M   24

Definition at line 102 of file ehca_mrmw.c.

#define EHCA_MR_PGSHIFT1M   20

Definition at line 101 of file ehca_mrmw.c.

#define EHCA_MR_PGSHIFT4K   12

Definition at line 99 of file ehca_mrmw.c.

#define EHCA_MR_PGSHIFT64K   16

Definition at line 100 of file ehca_mrmw.c.

#define EHCA_SECTSHIFT   SECTION_SIZE_BITS

Definition at line 58 of file ehca_mrmw.c.

#define EHCA_SECTSIZE   (1UL << EHCA_SECTSHIFT)

Definition at line 59 of file ehca_mrmw.c.

#define EHCA_TOP_INDEX_SHIFT   (EHCA_DIR_INDEX_SHIFT * 2)

Definition at line 65 of file ehca_mrmw.c.

#define EHCA_TOP_MAP_SIZE   (0x10000) /* currently fixed map size */

Definition at line 67 of file ehca_mrmw.c.

#define MAX_RPAGES   512

Definition at line 55 of file ehca_mrmw.c.

#define NUM_CHUNKS (   length,
  chunk_size 
)    (((length) + (chunk_size - 1)) / (chunk_size))

Definition at line 51 of file ehca_mrmw.c.

Enumeration Type Documentation

Enumerator:
EHCA_MR_PGSIZE4K 
EHCA_MR_PGSIZE64K 
EHCA_MR_PGSIZE1M 
EHCA_MR_PGSIZE16M 

Definition at line 92 of file ehca_mrmw.c.

Function Documentation

struct ib_fmr* ehca_alloc_fmr ( struct ib_pd pd,
int  mr_access_flags,
struct ib_fmr_attr fmr_attr 
)
read

Definition at line 765 of file ehca_mrmw.c.

struct ib_mw* ehca_alloc_mw ( struct ib_pd pd)
read

Definition at line 691 of file ehca_mrmw.c.

int ehca_bind_mw ( struct ib_qp qp,
struct ib_mw mw,
struct ib_mw_bind mw_bind 
)

Definition at line 731 of file ehca_mrmw.c.

void ehca_cleanup_mrmw_cache ( void  )

Definition at line 2306 of file ehca_mrmw.c.

int ehca_create_busmap ( void  )

Definition at line 2452 of file ehca_mrmw.c.

int ehca_dealloc_fmr ( struct ib_fmr fmr)

Definition at line 981 of file ehca_mrmw.c.

int ehca_dealloc_mw ( struct ib_mw mw)

Definition at line 743 of file ehca_mrmw.c.

int ehca_dereg_internal_maxmr ( struct ehca_shca shca)

Definition at line 1729 of file ehca_mrmw.c.

int ehca_dereg_mr ( struct ib_mr mr)

Definition at line 644 of file ehca_mrmw.c.

void ehca_destroy_busmap ( void  )

Definition at line 2346 of file ehca_mrmw.c.

int ehca_fmr_check_page_list ( struct ehca_mr e_fmr,
u64 page_list,
int  list_len 
)

Definition at line 1821 of file ehca_mrmw.c.

struct ib_mr* ehca_get_dma_mr ( struct ib_pd pd,
int  mr_access_flags 
)
read

Definition at line 156 of file ehca_mrmw.c.

int ehca_init_mrmw_cache ( void  )

Definition at line 2286 of file ehca_mrmw.c.

int ehca_map_phys_fmr ( struct ib_fmr fmr,
u64 page_list,
int  list_len,
u64  iova 
)

Definition at line 855 of file ehca_mrmw.c.

int ehca_mr_chk_buf_and_calc_size ( struct ib_phys_buf phys_buf_array,
int  num_phys_buf,
u64 iova_start,
u64 size 
)

Definition at line 1769 of file ehca_mrmw.c.

void ehca_mr_deletenew ( struct ehca_mr mr)

Definition at line 2271 of file ehca_mrmw.c.

int ehca_mr_is_maxmr ( u64  size,
u64 iova_start 
)

Definition at line 2202 of file ehca_mrmw.c.

void ehca_mrmw_map_acl ( int  ib_acl,
u32 hipz_acl 
)

Definition at line 2217 of file ehca_mrmw.c.

void ehca_mrmw_reverse_map_acl ( const u32 hipz_acl,
int ib_acl 
)

Definition at line 2247 of file ehca_mrmw.c.

void ehca_mrmw_set_pgsize_hipz_acl ( u32  pgsize,
u32 hipz_acl 
)

Definition at line 2236 of file ehca_mrmw.c.

int ehca_query_mr ( struct ib_mr mr,
struct ib_mr_attr mr_attr 
)

Definition at line 597 of file ehca_mrmw.c.

int ehca_reg_internal_maxmr ( struct ehca_shca shca,
struct ehca_pd e_pd,
struct ehca_mr **  e_maxmr 
)

Definition at line 1609 of file ehca_mrmw.c.

int ehca_reg_maxmr ( struct ehca_shca shca,
struct ehca_mr e_newmr,
u64 iova_start,
int  acl,
struct ehca_pd e_pd,
u32 lkey,
u32 rkey 
)

Definition at line 1687 of file ehca_mrmw.c.

int ehca_reg_mr ( struct ehca_shca shca,
struct ehca_mr e_mr,
u64 iova_start,
u64  size,
int  acl,
struct ehca_pd e_pd,
struct ehca_mr_pginfo pginfo,
u32 lkey,
u32 rkey,
enum ehca_reg_type  reg_type 
)

Definition at line 1021 of file ehca_mrmw.c.

int ehca_reg_mr_rpages ( struct ehca_shca shca,
struct ehca_mr e_mr,
struct ehca_mr_pginfo pginfo 
)

Definition at line 1099 of file ehca_mrmw.c.

struct ib_mr* ehca_reg_phys_mr ( struct ib_pd pd,
struct ib_phys_buf phys_buf_array,
int  num_phys_buf,
int  mr_access_flags,
u64 iova_start 
)
read

Definition at line 199 of file ehca_mrmw.c.

int ehca_reg_smr ( struct ehca_shca shca,
struct ehca_mr e_origmr,
struct ehca_mr e_newmr,
u64 iova_start,
int  acl,
struct ehca_pd e_pd,
u32 lkey,
u32 rkey 
)

Definition at line 1471 of file ehca_mrmw.c.

struct ib_mr* ehca_reg_user_mr ( struct ib_pd pd,
u64  start,
u64  length,
u64  virt,
int  mr_access_flags,
struct ib_udata udata 
)
read

Definition at line 313 of file ehca_mrmw.c.

int ehca_rereg_mr ( struct ehca_shca shca,
struct ehca_mr e_mr,
u64 iova_start,
u64  size,
int  acl,
struct ehca_pd e_pd,
struct ehca_mr_pginfo pginfo,
u32 lkey,
u32 rkey 
)

Definition at line 1288 of file ehca_mrmw.c.

int ehca_rereg_mr_rereg1 ( struct ehca_shca shca,
struct ehca_mr e_mr,
u64 iova_start,
u64  size,
u32  acl,
struct ehca_pd e_pd,
struct ehca_mr_pginfo pginfo,
u32 lkey,
u32 rkey 
)
inline

Definition at line 1197 of file ehca_mrmw.c.

int ehca_rereg_phys_mr ( struct ib_mr mr,
int  mr_rereg_mask,
struct ib_pd pd,
struct ib_phys_buf phys_buf_array,
int  num_phys_buf,
int  mr_access_flags,
u64 iova_start 
)

Definition at line 443 of file ehca_mrmw.c.

int ehca_set_pagebuf ( struct ehca_mr_pginfo pginfo,
u32  number,
u64 kpage 
)

Definition at line 2170 of file ehca_mrmw.c.

int ehca_unmap_fmr ( struct list_head fmr_list)

Definition at line 923 of file ehca_mrmw.c.

int ehca_unmap_one_fmr ( struct ehca_shca shca,
struct ehca_mr e_fmr 
)

Definition at line 1383 of file ehca_mrmw.c.

Variable Documentation

struct ib_dma_mapping_ops ehca_dma_mapping_ops
Initial value:
= {
.mapping_error = ehca_dma_mapping_error,
.map_single = ehca_dma_map_single,
.unmap_single = ehca_dma_unmap_single,
.map_page = ehca_dma_map_page,
.unmap_page = ehca_dma_unmap_page,
.map_sg = ehca_dma_map_sg,
.unmap_sg = ehca_dma_unmap_sg,
.dma_address = ehca_dma_address,
.dma_len = ehca_dma_len,
.sync_single_for_cpu = ehca_dma_sync_single_for_cpu,
.sync_single_for_device = ehca_dma_sync_single_for_device,
.alloc_coherent = ehca_dma_alloc_coherent,
.free_coherent = ehca_dma_free_coherent,
}

Definition at line 2645 of file ehca_mrmw.c.