From e0f5fdca1ca9d1659b920827e5cf6dbad20e5391 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Sat, 16 Apr 2005 15:26:30 -0700 Subject: [PATCH] IB/mthca: add fast memory region implementation Implement fast memory regions (FMRs), where the driver writes directly into the HCA's translation tables rather than requiring a firmware command. For Tavor, MTTs for FMR are separate from regular MTTs, and are reserved at driver initialization. This is done to limit the amount of virtual memory needed to map the MTTs. For Arbel, there's no such limitation, and all MTTs and MPTs may be used for FMR or for regular MR. Signed-off-by: Michael S. Tsirkin Signed-off-by: Roland Dreier Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/infiniband/hw/mthca/mthca_provider.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'drivers/infiniband/hw/mthca/mthca_provider.h') diff --git a/drivers/infiniband/hw/mthca/mthca_provider.h b/drivers/infiniband/hw/mthca/mthca_provider.h index 0598f3905d9a..619710f95a87 100644 --- a/drivers/infiniband/hw/mthca/mthca_provider.h +++ b/drivers/infiniband/hw/mthca/mthca_provider.h @@ -60,6 +60,24 @@ struct mthca_mr { u32 first_seg; }; +struct mthca_fmr { + struct ib_fmr ibmr; + struct ib_fmr_attr attr; + int order; + u32 first_seg; + int maps; + union { + struct { + struct mthca_mpt_entry __iomem *mpt; + u64 __iomem *mtts; + } tavor; + struct { + struct mthca_mpt_entry *mpt; + __be64 *mtts; + } arbel; + } mem; +}; + struct mthca_pd { struct ib_pd ibpd; u32 pd_num; @@ -218,6 +236,11 @@ struct mthca_sqp { dma_addr_t header_dma; }; +static inline struct mthca_fmr *to_mfmr(struct ib_fmr *ibmr) +{ + return container_of(ibmr, struct mthca_fmr, ibmr); +} + static inline struct mthca_mr *to_mmr(struct ib_mr *ibmr) { return container_of(ibmr, struct mthca_mr, ibmr); -- cgit v1.2.1