@@ -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);
@@ -884,6 +884,9 @@ struct efa_admin_host_info {
* 31:2 : reserved2
*/
u32 flags;
+
+ /* Userspace version */
+ u8 userspace_ver[32];
};
/* create_qp_cmd */
@@ -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);
@@ -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)
@@ -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 {