Skip to content

Commit 34f4c95

Browse files
Guy Levijgunthorpe
authored andcommitted
IB/mlx5: Use fragmented QP's buffer for in-kernel users
The current implementation of create QP requires contiguous memory, such a requirement is problematic once the memory is fragmented or the system is low in memory, it causes failures in dma_zalloc_coherent(). This patch takes advantage of the new mlx5_core API which allocates a fragmented buffer. This makes the QP creation much more resilient to memory fragmentation. Data-path code was adapted to the fact that WQEs can cross buffers. We also use the opportunity to fix some cosmetic legacy coding convention errors which were in the feature scope. Signed-off-by: Guy Levi <guyle@mellanox.com> Reviewed-by: Majd Dibbiny <majd@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
1 parent 20e5a59 commit 34f4c95

File tree

2 files changed

+241
-167
lines changed

2 files changed

+241
-167
lines changed

drivers/infiniband/hw/mlx5/mlx5_ib.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ enum mlx5_ib_rq_flags {
257257
};
258258

259259
struct mlx5_ib_wq {
260+
struct mlx5_frag_buf_ctrl fbc;
260261
u64 *wrid;
261262
u32 *wr_data;
262263
struct wr_list *w_list;
@@ -275,7 +276,7 @@ struct mlx5_ib_wq {
275276
unsigned tail;
276277
u16 cur_post;
277278
u16 last_poll;
278-
void *qend;
279+
void *cur_edge;
279280
};
280281

281282
enum mlx5_ib_wq_flags {

0 commit comments

Comments
 (0)