Deleted Added
full compact
mlx4_ib_doorbell.c (219820) mlx4_ib_doorbell.c (278886)
1/*
2 * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 31 unchanged lines hidden (view full) ---

40 unsigned long user_virt;
41 int refcnt;
42};
43
44int mlx4_ib_db_map_user(struct mlx4_ib_ucontext *context, unsigned long virt,
45 struct mlx4_db *db)
46{
47 struct mlx4_ib_user_db_page *page;
1/*
2 * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 31 unchanged lines hidden (view full) ---

40 unsigned long user_virt;
41 int refcnt;
42};
43
44int mlx4_ib_db_map_user(struct mlx4_ib_ucontext *context, unsigned long virt,
45 struct mlx4_db *db)
46{
47 struct mlx4_ib_user_db_page *page;
48 struct ib_umem_chunk *chunk;
49 int err = 0;
50
51 mutex_lock(&context->db_page_mutex);
52
53 list_for_each_entry(page, &context->db_page_list, list)
54 if (page->user_virt == (virt & PAGE_MASK))
55 goto found;
56

--- 11 unchanged lines hidden (view full) ---

68 err = PTR_ERR(page->umem);
69 kfree(page);
70 goto out;
71 }
72
73 list_add(&page->list, &context->db_page_list);
74
75found:
48 int err = 0;
49
50 mutex_lock(&context->db_page_mutex);
51
52 list_for_each_entry(page, &context->db_page_list, list)
53 if (page->user_virt == (virt & PAGE_MASK))
54 goto found;
55

--- 11 unchanged lines hidden (view full) ---

67 err = PTR_ERR(page->umem);
68 kfree(page);
69 goto out;
70 }
71
72 list_add(&page->list, &context->db_page_list);
73
74found:
76 chunk = list_entry(page->umem->chunk_list.next, struct ib_umem_chunk, list);
77 db->dma = sg_dma_address(chunk->page_list) + (virt & ~PAGE_MASK);
75 db->dma = sg_dma_address(page->umem->sg_head.sgl) + (virt & ~PAGE_MASK);
78 db->u.user_page = page;
79 ++page->refcnt;
80
81out:
82 mutex_unlock(&context->db_page_mutex);
83
84 return err;
85}

--- 13 unchanged lines hidden ---
76 db->u.user_page = page;
77 ++page->refcnt;
78
79out:
80 mutex_unlock(&context->db_page_mutex);
81
82 return err;
83}

--- 13 unchanged lines hidden ---