Skip to content

Commit

Permalink
Merge pull request #1404 from longlimsft/remove_redundant_code
Browse files Browse the repository at this point in the history
Remove redundant code for checking max queue sizes and max sgl sizes
  • Loading branch information
rleon authored Nov 12, 2023
2 parents f16330d + cde5d9c commit 0bffa5d
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 42 deletions.
7 changes: 0 additions & 7 deletions providers/mana/mana.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,6 @@ struct ibv_cq *mana_create_cq(struct ibv_context *context, int cqe,
int cq_size;
int ret;

if (cqe > MAX_SEND_BUFFERS_PER_QUEUE) {
verbs_err(verbs_get_ctx(context), "CQE %d exceeding limit\n",
cqe);
errno = EINVAL;
return NULL;
}

if (!ctx->extern_alloc.alloc || !ctx->extern_alloc.free) {
/*
* This version of driver doesn't support allocating buffers
Expand Down
3 changes: 0 additions & 3 deletions providers/mana/mana.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "manadv.h"

#define MAX_SEND_BUFFERS_PER_QUEUE 256
#define COMP_ENTRY_SIZE 64
#define MANA_IB_TOEPLITZ_HASH_KEY_SIZE_IN_BYTES 40

Expand All @@ -18,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
16 changes: 0 additions & 16 deletions providers/mana/qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +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 (attr->cap.max_send_wr > MAX_SEND_BUFFERS_PER_QUEUE) {
verbs_err(verbs_get_ctx(ibpd->context),
"max_send_wr %d exceeds MAX_SEND_BUFFERS_PER_QUEUE\n",
attr->cap.max_send_wr);
errno = EINVAL;
return NULL;
}

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
16 changes: 0 additions & 16 deletions providers/mana/wq.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +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 (attr->max_wr > MAX_SEND_BUFFERS_PER_QUEUE) {
verbs_err(verbs_get_ctx(context),
"max_wr %d exceeds MAX_SEND_BUFFERS_PER_QUEUE\n",
attr->max_wr);
errno = EINVAL;
return NULL;
}

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 0bffa5d

Please sign in to comment.