Skip to content

Commit 60214cc

Browse files
ikegami-tigaw
authored andcommitted
ocp: set UUID index to get hwcomp log
The index is required by the OCP specification. Signed-off-by: Tokunori Ikegami <[email protected]>
1 parent cea7c35 commit 60214cc

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

plugins/ocp/ocp-hardware-component-log.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "nvme-print.h"
1212
#include "ocp-hardware-component-log.h"
1313
#include "ocp-print.h"
14+
#include "ocp-utils.h"
1415

1516
//#define HWCOMP_DUMMY
1617

@@ -171,21 +172,23 @@ static int get_hwcomp_log_data(struct nvme_dev *dev, struct hwcomp_log *log)
171172
int ret = 0;
172173
size_t desc_offset = offsetof(struct hwcomp_log, desc);
173174
struct nvme_get_log_args args = {
174-
.lpo = desc_offset,
175175
.args_size = sizeof(args),
176176
.fd = dev_fd(dev),
177177
.timeout = NVME_DEFAULT_IOCTL_TIMEOUT,
178178
.lid = LID_HWCOMP,
179179
.nsid = NVME_NSID_ALL,
180+
.log = log,
181+
.len = desc_offset,
180182
};
181183

184+
ocp_get_uuid_index(dev, &args.uuidx);
185+
182186
#ifdef HWCOMP_DUMMY
183187
memcpy(log, hwcomp_dummy, desc_offset);
184188
#else /* HWCOMP_DUMMY */
185-
ret = nvme_get_log_simple(dev_fd(dev), LID_HWCOMP, desc_offset, log);
189+
ret = nvme_get_log_page(dev_fd(dev), NVME_LOG_PAGE_PDU_SIZE, &args);
186190
if (ret) {
187-
print_info_error("error: ocp: failed to get log simple (hwcomp: %02X, ret: %d)\n",
188-
LID_HWCOMP, ret);
191+
print_info_error("error: ocp: failed to get hwcomp log size (ret: %d)\n", ret);
189192
return ret;
190193
}
191194
#endif /* HWCOMP_DUMMY */
@@ -208,6 +211,7 @@ static int get_hwcomp_log_data(struct nvme_dev *dev, struct hwcomp_log *log)
208211
}
209212

210213
args.log = log->desc,
214+
args.lpo = desc_offset,
211215

212216
#ifdef HWCOMP_DUMMY
213217
memcpy(log->desc, &hwcomp_dummy[desc_offset], args.len);

0 commit comments

Comments
 (0)