summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJack Morgenstein <jackm@dev.mellanox.co.il>2008-01-28 10:40:51 +0200
committerRoland Dreier <rolandd@cisco.com>2008-02-06 21:17:45 -0800
commit313abe55a87bc10e55d00f337d609e17ad5f8c9a (patch)
tree833ff3c4b33f83d4ca64ed322c2d8efa21529d71 /include/linux
parent1c69fc2a9012e160c8d459f63df74a6b01db8322 (diff)
mlx4_core: For 64-bit systems, vmap() kernel queue buffers
Since kernel virtual memory is not a problem on 64-bit systems, there is no reason to use our own 2-layer page mapping scheme for large kernel queue buffers on such systems. Instead, map the page list to a single virtually contiguous buffer with vmap(), so that can we access buffer memory via direct indexing. Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il> Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mlx4/device.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index a0afa7511a30..631607788f83 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -189,7 +189,7 @@ struct mlx4_buf_list {
};
struct mlx4_buf {
- union {
+ struct {
struct mlx4_buf_list direct;
struct mlx4_buf_list *page_list;
} u;
@@ -310,7 +310,7 @@ int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct,
void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf);
static inline void *mlx4_buf_offset(struct mlx4_buf *buf, int offset)
{
- if (buf->nbufs == 1)
+ if (BITS_PER_LONG == 64 || buf->nbufs == 1)
return buf->u.direct.buf + offset;
else
return buf->u.page_list[offset >> PAGE_SHIFT].buf +