All of lore.kernel.org
 help / color / mirror / Atom feed
From: rao Shoaib <rao.shoaib@oracle.com>
To: monis@mellanox.com, dledford@redhat.com, sean.hefty@intel.com,
	hal.rosenstock@gmail.com, linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org, rao.shoaib@oracle.com
Subject: [PATCH v2 2/2] SGE buffer and max_inline data must have same size
Date: Mon, 18 Nov 2019 11:54:39 -0800	[thread overview]
Message-ID: <1574106879-19211-3-git-send-email-rao.shoaib@oracle.com> (raw)
In-Reply-To: <1574106879-19211-1-git-send-email-rao.shoaib@oracle.com>

From: Rao Shoaib <rao.shoaib@oracle.com>

SGE buffer size and max_inline data should be same. Maximum of the
two values requested is used.

Signed-off-by: Rao Shoaib <rao.shoaib@oracle.com>
---
 drivers/infiniband/sw/rxe/rxe_qp.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c
index 323e43d..1062f60 100644
--- a/drivers/infiniband/sw/rxe/rxe_qp.c
+++ b/drivers/infiniband/sw/rxe/rxe_qp.c
@@ -238,18 +238,17 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp,
 		return err;
 	qp->sk->sk->sk_user_data = qp;
 
-	qp->sq.max_wr		= init->cap.max_send_wr;
-	qp->sq.max_sge		= init->cap.max_send_sge;
-	qp->sq.max_inline	= init->cap.max_inline_data;
-
-	wqe_size = max_t(int, sizeof(struct rxe_send_wqe) +
-			 qp->sq.max_sge * sizeof(struct ib_sge),
-			 sizeof(struct rxe_send_wqe) +
-			 qp->sq.max_inline);
-
-	qp->sq.queue = rxe_queue_init(rxe,
-				      &qp->sq.max_wr,
-				      wqe_size);
+	wqe_size = max_t(int, init->cap.max_send_sge * sizeof(struct ib_sge),
+			 init->cap.max_inline_data);
+	qp->sq.max_sge = wqe_size/sizeof(struct ib_sge);
+	qp->sq.max_inline = wqe_size;
+
+	wqe_size += sizeof(struct rxe_send_wqe);
+
+	qp->sq.max_wr = init->cap.max_send_wr;
+
+	qp->sq.queue = rxe_queue_init(rxe, &qp->sq.max_wr, wqe_size);
+
 	if (!qp->sq.queue)
 		return -ENOMEM;
 
-- 
1.8.3.1


      parent reply	other threads:[~2019-11-18 19:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-18 19:54 [PATCH v2 0/2] rxe should use same buffer size for SGE's and inline data rao Shoaib
2019-11-18 19:54 ` [PATCH v2 1/2] Introduce maximum WQE size to check limits rao Shoaib
2019-11-19 20:31   ` Jason Gunthorpe
2019-11-19 22:38     ` Rao Shoaib
2019-11-19 23:13       ` Jason Gunthorpe
2019-11-19 23:55         ` Rao Shoaib
2019-11-20  0:08           ` Jason Gunthorpe
2019-12-17 19:38             ` Rao Shoaib
2019-12-19 18:25               ` Jason Gunthorpe
2019-12-19 18:37                 ` Rao Shoaib
2020-01-13 18:35                 ` Rao Shoaib
2020-01-13 18:47                   ` Jason Gunthorpe
2020-01-13 19:16                     ` Rao Shoaib
2019-11-18 19:54 ` rao Shoaib [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1574106879-19211-3-git-send-email-rao.shoaib@oracle.com \
    --to=rao.shoaib@oracle.com \
    --cc=dledford@redhat.com \
    --cc=hal.rosenstock@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=monis@mellanox.com \
    --cc=sean.hefty@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.