Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
7d840a60
Commit
7d840a60
authored
Jun 04, 2018
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
parents
d67b66b4
885892fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
drivers/net/ethernet/mellanox/mlx4/icm.c
drivers/net/ethernet/mellanox/mlx4/icm.c
+12
-6
No files found.
drivers/net/ethernet/mellanox/mlx4/icm.c
View file @
7d840a60
...
...
@@ -43,12 +43,13 @@
#include "fw.h"
/*
* We allocate in page size (default 4KB on many archs) chunks to avoid high
* order memory allocations in fragmented/high usage memory situation.
* We allocate in as big chunks as we can, up to a maximum of 256 KB
* per chunk. Note that the chunks are not necessarily in contiguous
* physical memory.
*/
enum
{
MLX4_ICM_ALLOC_SIZE
=
PAGE_SIZE
,
MLX4_TABLE_CHUNK_SIZE
=
PAGE_SIZE
,
MLX4_ICM_ALLOC_SIZE
=
1
<<
18
,
MLX4_TABLE_CHUNK_SIZE
=
1
<<
18
,
};
static
void
mlx4_free_icm_pages
(
struct
mlx4_dev
*
dev
,
struct
mlx4_icm_chunk
*
chunk
)
...
...
@@ -135,6 +136,7 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages,
struct
mlx4_icm
*
icm
;
struct
mlx4_icm_chunk
*
chunk
=
NULL
;
int
cur_order
;
gfp_t
mask
;
int
ret
;
/* We use sg_set_buf for coherent allocs, which assumes low memory */
...
...
@@ -178,13 +180,17 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages,
while
(
1
<<
cur_order
>
npages
)
--
cur_order
;
mask
=
gfp_mask
;
if
(
cur_order
)
mask
&=
~
__GFP_DIRECT_RECLAIM
;
if
(
coherent
)
ret
=
mlx4_alloc_icm_coherent
(
&
dev
->
persist
->
pdev
->
dev
,
&
chunk
->
mem
[
chunk
->
npages
],
cur_order
,
gfp_
mask
);
cur_order
,
mask
);
else
ret
=
mlx4_alloc_icm_pages
(
&
chunk
->
mem
[
chunk
->
npages
],
cur_order
,
gfp_
mask
,
cur_order
,
mask
,
dev
->
numa_node
);
if
(
ret
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment