net/mlx5_core,mlx5_ib: Do not use vmap() on coherent memory
As David Daney pointed in mlx4_core driver [1], mlx5_core is also misusing the DMA-API. This patch is removing the code that vmap() memory allocated by dma_alloc_coherent(). After this patch, users of this drivers might fail allocating resources on memory fragmeneted systems. This will be fixed later on. [1] - https://patchwork.ozlabs.org/patch/458531/ CC: David Daney <david.daney@cavium.com> Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8ed9b5e1c8
commit
64ffaa2159
6 changed files with 20 additions and 91 deletions
|
|
@ -334,8 +334,6 @@ struct mlx5_buf_list {
|
|||
|
||||
struct mlx5_buf {
|
||||
struct mlx5_buf_list direct;
|
||||
struct mlx5_buf_list *page_list;
|
||||
int nbufs;
|
||||
int npages;
|
||||
int size;
|
||||
u8 page_shift;
|
||||
|
|
@ -586,11 +584,7 @@ struct mlx5_pas {
|
|||
|
||||
static inline void *mlx5_buf_offset(struct mlx5_buf *buf, int offset)
|
||||
{
|
||||
if (likely(BITS_PER_LONG == 64 || buf->nbufs == 1))
|
||||
return buf->direct.buf + offset;
|
||||
else
|
||||
return buf->page_list[offset >> PAGE_SHIFT].buf +
|
||||
(offset & (PAGE_SIZE - 1));
|
||||
}
|
||||
|
||||
extern struct workqueue_struct *mlx5_core_wq;
|
||||
|
|
@ -669,8 +663,7 @@ void mlx5_health_cleanup(void);
|
|||
void __init mlx5_health_init(void);
|
||||
void mlx5_start_health_poll(struct mlx5_core_dev *dev);
|
||||
void mlx5_stop_health_poll(struct mlx5_core_dev *dev);
|
||||
int mlx5_buf_alloc(struct mlx5_core_dev *dev, int size, int max_direct,
|
||||
struct mlx5_buf *buf);
|
||||
int mlx5_buf_alloc(struct mlx5_core_dev *dev, int size, struct mlx5_buf *buf);
|
||||
void mlx5_buf_free(struct mlx5_core_dev *dev, struct mlx5_buf *buf);
|
||||
struct mlx5_cmd_mailbox *mlx5_alloc_cmd_mailbox_chain(struct mlx5_core_dev *dev,
|
||||
gfp_t flags, int npages);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue