Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/nvme/nvme_qpair.c
| Context not available. | |||||
| * will be in a list pointed to by the command (prp2). | * will be in a list pointed to by the command (prp2). | ||||
| */ | */ | ||||
| prpsz = sizeof(uint64_t) * | prpsz = sizeof(uint64_t) * | ||||
| howmany(ctrlr->max_xfer_size, ctrlr->page_size); | (howmany(ctrlr->max_xfer_size, ctrlr->page_size) + 1); | ||||
imp: I don't think this is not quite right. For exactly a max_xfer_size, we'd put the first buffer… | |||||
kevansUnsubmitted Not Done Inline ActionsTo clarify, after reading the context a little bit: are you saying that the page for the PRP list is already accounted for in this calculation because it's effectively offset by one page out of that max_xfer_size data going into PRP1? @mengzhuo1203_gmail.com I think it would be helpful if you could walk us through how you came to the conclusion that this was the problem, so that we can better understand the side effect the addition here has that fixed the hardware you're working with. kevans: To clarify, after reading the context a little bit: are you saying that the page for the PRP… | |||||
impUnsubmitted Not Done Inline ActionsSo for max xfer, we need maxxfer/pagesize +1 PRPs. The first one goes in PRP1. PRP2 pounts to a page with maxxfer/pagesize entries. I don't see how we'd need +1 here which is computing the space for the prp2 indorect page(s). imp: So for max xfer, we need maxxfer/pagesize +1 PRPs. The first one goes in PRP1. PRP2 pounts to a… | |||||
| prpmemsz = qpair->num_trackers * prpsz; | prpmemsz = qpair->num_trackers * prpsz; | ||||
| allocsz = cmdsz + cplsz + prpmemsz; | allocsz = cmdsz + cplsz + prpmemsz; | ||||
| Context not available. | |||||
I don't think this is not quite right. For exactly a max_xfer_size, we'd put the first buffer into PRP1, and then the rest int he page pointed to by PRP2. Since we have the extra pointer here, the calculation is exact, even when the I/O isn't aligned.