vhost/nvme: fix doorbell buffer size calculation
The existing code was using sizeof() on a calculation that already returned the right size, so this would originally just memset() 4 bytes instead of the whole region. The spec requires the doorbell buffer to be exactly one physical memory page, and our controller emulation chooses MPS so that only 4096-byte pages are supported, so just zero out the page and drop the calculation entirely. Change-Id: I71db1bebf0a4d5dbe55fd411786e19a8d6802c20 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/408730 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
d2b764f4d7
commit
130307862b
@ -566,8 +566,8 @@ vhost_nvme_doorbell_buffer_config(struct spdk_vhost_nvme_dev *nvme,
|
||||
return -1;
|
||||
}
|
||||
/* zeroed the doorbell buffer memory */
|
||||
memset((void *)nvme->dbbuf_dbs, 0, sizeof((nvme->num_sqs + 1) * 8));
|
||||
memset((void *)nvme->dbbuf_eis, 0, sizeof((nvme->num_sqs + 1) * 8));
|
||||
memset((void *)nvme->dbbuf_dbs, 0, 4096);
|
||||
memset((void *)nvme->dbbuf_eis, 0, 4096);
|
||||
|
||||
cpl->status.sc = 0;
|
||||
cpl->status.sct = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user