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
Cc: Rao Shoaib <rao.shoaib@oracle.com>
Subject: [PATCH v1 1/1] rxe: calculate inline data size based on requested values
Date: Wed, 23 Oct 2019 10:32:37 -0700 [thread overview]
Message-ID: <1571851957-3524-2-git-send-email-rao.shoaib@oracle.com> (raw)
In-Reply-To: <1571851957-3524-1-git-send-email-rao.shoaib@oracle.com>
From: Rao Shoaib <rao.shoaib@oracle.com>
rxe driver has a hard coded value for the size of inline data, where as
mlx5 driver calculates number of SGE's and inline data size based on the
values in the qp request. This patch modifies rxe driver to do the same
so that applications can work seamlessly across drivers.
Signed-off-by: Rao Shoaib <rao.shoaib@oracle.com>
---
drivers/infiniband/sw/rxe/rxe_param.h | 2 +-
drivers/infiniband/sw/rxe/rxe_qp.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/sw/rxe/rxe_param.h b/drivers/infiniband/sw/rxe/rxe_param.h
index 1b596fb..657f9303 100644
--- a/drivers/infiniband/sw/rxe/rxe_param.h
+++ b/drivers/infiniband/sw/rxe/rxe_param.h
@@ -68,7 +68,6 @@ enum rxe_device_param {
RXE_HW_VER = 0,
RXE_MAX_QP = 0x10000,
RXE_MAX_QP_WR = 0x4000,
- RXE_MAX_INLINE_DATA = 400,
RXE_DEVICE_CAP_FLAGS = IB_DEVICE_BAD_PKEY_CNTR
| IB_DEVICE_BAD_QKEY_CNTR
| IB_DEVICE_AUTO_PATH_MIG
@@ -81,6 +80,7 @@ enum rxe_device_param {
| IB_DEVICE_MEM_MGT_EXTENSIONS,
RXE_MAX_SGE = 32,
RXE_MAX_SGE_RD = 32,
+ RXE_MAX_INLINE_DATA = RXE_MAX_SGE * sizeof(struct ib_sge),
RXE_MAX_CQ = 16384,
RXE_MAX_LOG_CQE = 15,
RXE_MAX_MR = 2 * 1024,
diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c
index aeea994..45b5da5 100644
--- a/drivers/infiniband/sw/rxe/rxe_qp.c
+++ b/drivers/infiniband/sw/rxe/rxe_qp.c
@@ -229,6 +229,7 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp,
{
int err;
int wqe_size;
+ unsigned int inline_size;
err = sock_create_kern(&init_net, AF_INET, SOCK_DGRAM, 0, &qp->sk);
if (err < 0)
@@ -244,6 +245,9 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp,
sizeof(struct rxe_send_wqe) +
qp->sq.max_inline);
+ inline_size = wqe_size - sizeof(struct rxe_send_wqe);
+ qp->sq.max_inline = inline_size;
+ init->cap.max_inline_data = inline_size;
qp->sq.queue = rxe_queue_init(rxe,
&qp->sq.max_wr,
wqe_size);
--
1.8.3.1
next prev parent reply other threads:[~2019-10-23 17:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-23 17:32 [PATCH v1 0/1] rxe driver should dynamically caclculate inline data size rao Shoaib
2019-10-23 17:32 ` rao Shoaib [this message]
2019-10-29 19:11 ` [PATCH v1 1/1] rxe: calculate inline data size based on requested values Jason Gunthorpe
2019-10-29 19:31 ` Rao Shoaib
2019-10-29 19:44 ` Jason Gunthorpe
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=1571851957-3524-2-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.