summaryrefslogtreecommitdiffstats
path: root/sys/contrib
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2013-09-29 00:35:03 +0000
committeralfred <alfred@FreeBSD.org>2013-09-29 00:35:03 +0000
commit91eb2b78a7e56a727c14039b1a0e05969398f2b5 (patch)
tree2c8631892ad121ada16a812ddbfd631e44299298 /sys/contrib
parent7e9b42c4d312afe32b30e8c1e60ccd6a47158fe3 (diff)
downloadFreeBSD-src-91eb2b78a7e56a727c14039b1a0e05969398f2b5.zip
FreeBSD-src-91eb2b78a7e56a727c14039b1a0e05969398f2b5.tar.gz
Update OFED to Linux 3.7 and update Mellanox drivers.
Update the OFED Infiniband core to the version supplied in Linux version 3.7. The update to OFED is nearly all additional defines and functions with the exception of the addition of additional parameters to ib_register_device() and the reg_user_mr callback. In addition the ibcore (Infiniband core) and ipoib (IP over Infiniband) have both been made into completely loadable modules to facilitate testing of the OFED stack in FreeBSD. Finally the Mellanox Infiniband drivers are now updated to the latest version shipping with Linux 3.7. Submitted by: Mellanox FreeBSD driver team: Oded Shanoon (odeds mellanox.com), Meny Yossefi (menyy mellanox.com), Orit Moskovich (oritm mellanox.com) Approved by: re
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/rdma/ib_umem.h74
1 files changed, 59 insertions, 15 deletions
diff --git a/sys/contrib/rdma/ib_umem.h b/sys/contrib/rdma/ib_umem.h
index 50dd5da..9e1abbb 100644
--- a/sys/contrib/rdma/ib_umem.h
+++ b/sys/contrib/rdma/ib_umem.h
@@ -28,21 +28,17 @@
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
- *
- * $FreeBSD$
*/
#ifndef IB_UMEM_H
#define IB_UMEM_H
-struct ib_ucontext;
+#include <linux/list.h>
+#include <linux/scatterlist.h>
+#include <linux/workqueue.h>
+#include <linux/dma-attrs.h>
-struct ib_umem_chunk {
- TAILQ_ENTRY(ib_umem_chunk) entry;
- int nents;
- int nmap;
- struct rdma_scatterlist page_list[0];
-};
+struct ib_ucontext;
struct ib_umem {
struct ib_ucontext *context;
@@ -50,28 +46,76 @@ struct ib_umem {
int offset;
int page_size;
int writable;
- TAILQ_HEAD(, ib_umem_chunk) chunk_list;
-#ifdef notyet
+ int hugetlb;
+ struct list_head chunk_list;
struct work_struct work;
struct mm_struct *mm;
-#endif
unsigned long diff;
};
+/* contiguous memory structure */
+struct ib_cmem {
+
+ struct ib_ucontext *context;
+ size_t length;
+ /* Link list of contiguous blocks being part of that cmem */
+ struct list_head ib_cmem_block;
+
+ /* Order of cmem block, 2^ block_order will equal number
+ of physical pages per block
+ */
+ unsigned long block_order;
+ /* Refernce counter for that memory area
+ - When value became 0 pages will be returned to the kernel.
+ */
+ struct kref refcount;
+};
+
+
+struct ib_cmem_block {
+
+ struct list_head list;
+ /* page will point to the page struct of the head page
+ in the current compound page.
+ block order is saved once as part of ib_cmem.
+ */
+ struct page *page;
+};
+
+
+
+struct ib_umem_chunk {
+ struct list_head list;
+ int nents;
+ int nmap;
+ struct dma_attrs attrs;
+ struct scatterlist page_list[0];
+};
+
#ifdef CONFIG_INFINIBAND_USER_MEM
struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
- size_t size, int access);
+ size_t size, int access, int dmasync);
void ib_umem_release(struct ib_umem *umem);
int ib_umem_page_count(struct ib_umem *umem);
+int ib_cmem_map_contiguous_pages_to_vma(struct ib_cmem *ib_cmem,
+ struct vm_area_struct *vma);
+struct ib_cmem *ib_cmem_alloc_contiguous_pages(struct ib_ucontext *context,
+ unsigned long total_size,
+ unsigned long page_size_order);
+void ib_cmem_release_contiguous_pages(struct ib_cmem *cmem);
+int ib_umem_map_to_vma(struct ib_umem *umem,
+ struct vm_area_struct *vma);
+
#else /* CONFIG_INFINIBAND_USER_MEM */
+#include <linux/err.h>
static inline struct ib_umem *ib_umem_get(struct ib_ucontext *context,
unsigned long addr, size_t size,
- int access) {
- return ERR_PTR(EINVAL);
+ int access, int dmasync) {
+ return ERR_PTR(-EINVAL);
}
static inline void ib_umem_release(struct ib_umem *umem) { }
static inline int ib_umem_page_count(struct ib_umem *umem) { return 0; }
OpenPOWER on IntegriCloud