libcxgb4: fix firmware version string
PATCH 1/1 libcxgb4: fix firmware version string
c4iw_query_device() was incorrectly unpacking the 64b version number from the driver. This resulted in ibv_devinfo showing garbage fw verion strings.
Signed-off-by Steve Wise <[email protected]>
---
Testing out the new process. :)
--- libcxgb4/src/verbs.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
libcxgb4/src/verbs.c +6 -5
@@ -52,7 +52,7 @@ int c4iw_query_device(struct ibv_context *context, struct ibv_device_attr *attr) {struct ibv_query_device cmd;uint64_t raw_fw_ver; -unsigned major, minor, sub_minor; +u8 major, minor, sub_minor, build;int ret; ret = ibv_cmd_query_device(context, attr, &raw_fw_ver, &cmd,
@@ -60,12 +60,13 @@ int c4iw_query_device(struct ibv_context *context, struct ibv_device_attr *attr)if (ret)return ret; - major = (raw_fw_ver >>32 ) &0xffff ; - minor = (raw_fw_ver >>16 ) &0xffff ; - sub_minor = raw_fw_ver &0xffff ; + major = (raw_fw_ver >>24 ) &0xff ; + minor = (raw_fw_ver >>16 ) &0xff ; + sub_minor = (raw_fw_ver >>8 ) &0xff ; + build = raw_fw_ver &0xff ;snprintf (attr->fw_ver,sizeof attr->fw_ver, -"%d.%d.%d" , major, minor, sub_minor); +"%d.%d.%d.%d" , major, minor, sub_minor, build);return 0 ; }
Signature · 6 lines
2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20160922201503.CFB88E08CA-/[email protected]
Leon Romanovsky
AppliedQuoted 9 lines · Steve Wise
c4iw_query_device()was incorrectly unpacking the 64b version number from the driver. This resulted inibv_devinfoshowing garbage fw verion strings.Signed-off-by Steve Wise <[email protected]>---
Testing out the new process. :)
Thanks, applied.