Skip to content

Commit 8dae419

Browse files
Devesh Sharmajgunthorpe
authored andcommitted
RDMA/bnxt_re: Refactor queue pair creation code
Restructuring the bnxt_re_create_qp function. Listing below the major changes: - Monolithic central part of create_qp where attributes are initialized is now enclosed in one function and this new function has few more sub-functions. - Top level qp limit checking code moved to a function. - GSI QP creation and GSI Shadow qp creation code is handled in a sub function. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Naresh Kumar PBS <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Devesh Sharma <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 5b36132 commit 8dae419

File tree

3 files changed

+428
-217
lines changed

3 files changed

+428
-217
lines changed

drivers/infiniband/hw/bnxt_re/bnxt_re.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ struct bnxt_re_sqp_entries {
104104
struct bnxt_re_qp *qp1_qp;
105105
};
106106

107+
#define BNXT_RE_MAX_GSI_SQP_ENTRIES 1024
108+
struct bnxt_re_gsi_context {
109+
struct bnxt_re_qp *gsi_qp;
110+
struct bnxt_re_qp *gsi_sqp;
111+
struct bnxt_re_ah *gsi_sah;
112+
struct bnxt_re_sqp_entries *sqp_tbl;
113+
};
114+
107115
#define BNXT_RE_MIN_MSIX 2
108116
#define BNXT_RE_MAX_MSIX 9
109117
#define BNXT_RE_AEQ_IDX 0
@@ -165,10 +173,7 @@ struct bnxt_re_dev {
165173
u16 cosq[2];
166174

167175
/* QP for for handling QP1 packets */
168-
u32 sqp_id;
169-
struct bnxt_re_qp *qp1_sqp;
170-
struct bnxt_re_ah *sqp_ah;
171-
struct bnxt_re_sqp_entries sqp_tbl[1024];
176+
struct bnxt_re_gsi_context gsi_ctx;
172177
atomic_t nq_alloc_cnt;
173178
u32 is_virtfn;
174179
u32 num_vfs;

0 commit comments

Comments
 (0)