Skip to content

Commit 4a8614a

Browse files
committed
mi: add nvme_mi_submit entry and exit weak functions
These are for the user to implement their own logging. Signed-off-by: Tokunori Ikegami <[email protected]>
1 parent cc645d5 commit 4a8614a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/nvme/mi.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,18 @@ static int nvme_mi_verify_resp_mic(struct nvme_mi_resp *resp)
414414
return resp->mic != ~crc;
415415
}
416416

417+
__attribute__((weak)) void nvme_mi_submit_entry(const nvme_mi_ep_t ep,
418+
const struct nvme_mi_msg_hdr *req) { }
419+
__attribute__((weak)) void nvme_mi_submit_exit(const nvme_mi_ep_t ep,
420+
const struct nvme_mi_msg_hdr *resp) { }
421+
417422
int nvme_mi_submit(nvme_mi_ep_t ep, struct nvme_mi_req *req,
418423
struct nvme_mi_resp *resp)
419424
{
420425
int rc;
421426

427+
nvme_mi_submit_entry(ep, req->hdr);
428+
422429
if (req->hdr_len < sizeof(struct nvme_mi_msg_hdr)) {
423430
errno = EINVAL;
424431
return -1;
@@ -502,6 +509,8 @@ int nvme_mi_submit(nvme_mi_ep_t ep, struct nvme_mi_req *req,
502509
return -1;
503510
}
504511

512+
nvme_mi_submit_exit(ep, resp->hdr);
513+
505514
return 0;
506515
}
507516

0 commit comments

Comments
 (0)