Skip to content

Commit

Permalink
mana: Remove redundant checks on max_send_sge and max_sge
Browse files Browse the repository at this point in the history
max_send_sge for QP and max_sge for WQ are already checked in the
kernel. There is no need to check here.

Signed-off-by: Long Li <[email protected]>
  • Loading branch information
longlimsft committed Nov 10, 2023
1 parent 3bbc4f7 commit cde5d9c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 18 deletions.
2 changes: 0 additions & 2 deletions providers/mana/mana.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
#define INLINE_OOB_LARGE_SIZE 24

#define GDMA_WQE_ALIGNMENT_UNIT_SIZE 32
#define MAX_TX_WQE_SIZE 512
#define MAX_RX_WQE_SIZE 256

/* The size of a SGE in WQE */
#define SGE_SIZE 16
Expand Down
8 changes: 0 additions & 8 deletions providers/mana/qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,6 @@ static struct ibv_qp *mana_create_qp_raw(struct ibv_pd *ibpd,

cq = container_of(attr->send_cq, struct mana_cq, ibcq);

if (get_wqe_size(attr->cap.max_send_sge) > MAX_TX_WQE_SIZE) {
verbs_err(verbs_get_ctx(ibpd->context),
"max_send_sge %d exceeding queue size limits\n",
attr->cap.max_send_sge);
errno = EINVAL;
return NULL;
}

if (!ctx->extern_alloc.alloc || !ctx->extern_alloc.free) {
verbs_err(verbs_get_ctx(ibpd->context),
"RAW QP requires extern alloc for buffers\n");
Expand Down
8 changes: 0 additions & 8 deletions providers/mana/wq.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@ struct ibv_wq *mana_create_wq(struct ibv_context *context,
struct mana_create_wq_resp wq_resp = {};
struct mana_ib_create_wq *wq_cmd_drv;

if (get_wqe_size(attr->max_sge) > MAX_RX_WQE_SIZE) {
verbs_err(verbs_get_ctx(context),
"max_sge %d exceeding WQE size limit\n",
attr->max_sge);
errno = EINVAL;
return NULL;
}

if (!ctx->extern_alloc.alloc || !ctx->extern_alloc.free) {
verbs_err(verbs_get_ctx(context),
"WQ buffer needs to be externally allocated\n");
Expand Down

0 comments on commit cde5d9c

Please sign in to comment.