Skip to content

Commit

Permalink
connectx4: Request alignment on memory.dma_alloc()
Browse files Browse the repository at this point in the history
Alignment was already checked with an assertion but this would not
necessarily succeed.
  • Loading branch information
lukego committed Jun 8, 2016
1 parent f349c41 commit 8c55f66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/apps/mellanox/connectx4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ ConnectX4.__index = ConnectX4
--utils

local function alloc_pages(pages)
local ptr, phy = memory.dma_alloc(4096 * pages)
local ptr, phy = memory.dma_alloc(4096 * pages, 4096)
assert(band(phy, 0xfff) == 0) --the phy address must be 4K-aligned
return cast('uint32_t*', ptr), phy
end
Expand Down Expand Up @@ -732,7 +732,7 @@ function ConnectX4:new(arg)

-- PRM: Execute MANAGE_PAGES to provide the HCA with all required
-- init-pages. This can be done by multiple MANAGE_PAGES commands.
local bp_ptr, bp_phy = memory.dma_alloc(4096 * boot_pages)
local bp_ptr, bp_phy = memory.dma_alloc(4096 * boot_pages, 4096)
assert(band(bp_phy, 0xfff) == 0) --the phy address must be 4K-aligned
cmdq:alloc_pages(bp_phy, boot_pages)

Expand Down

0 comments on commit 8c55f66

Please sign in to comment.