Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Gal Pressman <galpress@amazon.com>
To: Jason Gunthorpe <jgg@nvidia.com>, Doug Ledford <dledford@redhat.com>
Cc: <linux-rdma@vger.kernel.org>,
	Alexander Matushevsky <matua@amazon.com>,
	Gal Pressman <galpress@amazon.com>,
	Firas JahJah <firasj@amazon.com>,
	Leonid Feschuk <lfesch@amazon.com>,
	Yossi Leybovich <sleybo@amazon.com>,
	Jason Gunthorpe <jgg@ziepe.ca>
Subject: [PATCH for-next 2/2] RDMA/efa: Report userspace version in host info
Date: Tue, 5 Jan 2021 12:43:26 +0200	[thread overview]
Message-ID: <20210105104326.67895-3-galpress@amazon.com> (raw)
In-Reply-To: <20210105104326.67895-1-galpress@amazon.com>

Report the userspace version in the host information set feature admin
command.

Reviewed-by: Firas JahJah <firasj@amazon.com>
Reviewed-by: Leonid Feschuk <lfesch@amazon.com>
Signed-off-by: Gal Pressman <galpress@amazon.com>
---
 drivers/infiniband/hw/efa/efa.h                 | 2 +-
 drivers/infiniband/hw/efa/efa_admin_cmds_defs.h | 3 +++
 drivers/infiniband/hw/efa/efa_main.c            | 4 +++-
 drivers/infiniband/hw/efa/efa_verbs.c           | 2 +-
 include/uapi/rdma/efa-abi.h                     | 3 ++-
 5 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/efa/efa.h b/drivers/infiniband/hw/efa/efa.h
index 9c9cd5867489..e554b53997c4 100644
--- a/drivers/infiniband/hw/efa/efa.h
+++ b/drivers/infiniband/hw/efa/efa.h
@@ -123,7 +123,7 @@ struct efa_ah {
 	u8 id[EFA_GID_SIZE];
 };
 
-void efa_set_host_info(struct efa_dev *dev);
+void efa_set_host_info(struct efa_dev *dev, u8 *userspace_ver);
 int efa_query_device(struct ib_device *ibdev,
 		     struct ib_device_attr *props,
 		     struct ib_udata *udata);
diff --git a/drivers/infiniband/hw/efa/efa_admin_cmds_defs.h b/drivers/infiniband/hw/efa/efa_admin_cmds_defs.h
index b199e4ac6cf9..0822a5d5dcb6 100644
--- a/drivers/infiniband/hw/efa/efa_admin_cmds_defs.h
+++ b/drivers/infiniband/hw/efa/efa_admin_cmds_defs.h
@@ -884,6 +884,9 @@ struct efa_admin_host_info {
 	 * 31:2 : reserved2
 	 */
 	u32 flags;
+
+	/* Userspace version */
+	u8 userspace_ver[32];
 };
 
 /* create_qp_cmd */
diff --git a/drivers/infiniband/hw/efa/efa_main.c b/drivers/infiniband/hw/efa/efa_main.c
index 90a033a6af6c..027f9d0ebf25 100644
--- a/drivers/infiniband/hw/efa/efa_main.c
+++ b/drivers/infiniband/hw/efa/efa_main.c
@@ -191,7 +191,7 @@ static void efa_stats_init(struct efa_dev *dev)
 		atomic64_set(s, 0);
 }
 
-void efa_set_host_info(struct efa_dev *dev)
+void efa_set_host_info(struct efa_dev *dev, u8 *userspace_ver)
 {
 	struct efa_admin_set_feature_resp resp = {};
 	struct efa_admin_set_feature_cmd cmd = {};
@@ -230,6 +230,8 @@ void efa_set_host_info(struct efa_dev *dev)
 		EFA_COMMON_SPEC_VERSION_MINOR);
 	EFA_SET(&hinf->flags, EFA_ADMIN_HOST_INFO_INTREE, 1);
 	EFA_SET(&hinf->flags, EFA_ADMIN_HOST_INFO_GDR, 0);
+	strlcpy(hinf->userspace_ver, userspace_ver,
+		sizeof(hinf->userspace_ver));
 
 	efa_com_set_feature_ex(&dev->edev, &resp, &cmd, EFA_ADMIN_HOST_INFO,
 			       hinf_dma, bufsz);
diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c
index 5c12bdc28ef0..d3e3787a9e1e 100644
--- a/drivers/infiniband/hw/efa/efa_verbs.c
+++ b/drivers/infiniband/hw/efa/efa_verbs.c
@@ -1696,7 +1696,7 @@ int efa_alloc_ucontext(struct ib_ucontext *ibucontext, struct ib_udata *udata)
 	}
 
 	if (!test_and_set_bit(EFA_FLAGS_HOST_INFO_SET_BIT, dev->flags))
-		efa_set_host_info(dev);
+		efa_set_host_info(dev, cmd.userspace_ver);
 
 	err = efa_user_comp_handshake(ibucontext, &cmd);
 	if (err)
diff --git a/include/uapi/rdma/efa-abi.h b/include/uapi/rdma/efa-abi.h
index f89fbb5b1e8d..28a8e3f982a0 100644
--- a/include/uapi/rdma/efa-abi.h
+++ b/include/uapi/rdma/efa-abi.h
@@ -27,7 +27,8 @@ enum {
 
 struct efa_ibv_alloc_ucontext_cmd {
 	__u32 comp_mask;
-	__u8 reserved_20[4];
+	__u8 userspace_ver[32];
+	__u8 reserved_120[4];
 };
 
 enum efa_ibv_user_cmds_supp_udata {
-- 
2.30.0


  parent reply	other threads:[~2021-01-05 10:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05 10:43 [PATCH for-next 0/2] Host information userspace version Gal Pressman
2021-01-05 10:43 ` [PATCH for-next 1/2] RDMA/efa: Move host info set to first ucontext allocation Gal Pressman
2021-01-05 11:21   ` Leon Romanovsky
2021-01-05 12:22     ` Gal Pressman
2021-01-05 12:40       ` Leon Romanovsky
2021-01-05 13:39         ` Gal Pressman
2021-01-05 10:43 ` Gal Pressman [this message]
2021-01-19  7:17 ` [PATCH for-next 0/2] Host information userspace version Gal Pressman
2021-01-19  8:46   ` Leon Romanovsky
2021-01-19  9:10     ` Gal Pressman
2021-01-19 11:58       ` Leon Romanovsky
2021-01-19 13:19         ` Gal Pressman
2021-01-19 13:34           ` Leon Romanovsky
2021-01-21 18:35   ` Jason Gunthorpe
2021-01-21 19:40     ` Gal Pressman
2021-01-27 16:57       ` Jason Gunthorpe
2021-01-27 17:53         ` Gal Pressman
2021-02-28  9:56           ` Gal Pressman
2021-03-02  0:04             ` 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=20210105104326.67895-3-galpress@amazon.com \
    --to=galpress@amazon.com \
    --cc=dledford@redhat.com \
    --cc=firasj@amazon.com \
    --cc=jgg@nvidia.com \
    --cc=jgg@ziepe.ca \
    --cc=lfesch@amazon.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=matua@amazon.com \
    --cc=sleybo@amazon.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox