Isaku Yamahata <[email protected]> wrote:
> Signed-off-by: Isaku Yamahata <[email protected]>
I don't understand this bit:
> + uint8_t *chunk_start = ram_chunk_start(block, chunk);
> + uint8_t *chunk_end = ram_chunk_end(block, chunk);
Here we are getting just the length of a chunk
> sge.length = length;
>
> chunk = ram_chunk_index(block->local_host_addr, (uint8_t *) sge.addr);
> - chunk_start = ram_chunk_start(block, chunk);
>
> if (block->is_ram_block) {
> chunks = length / (1UL << RDMA_REG_CHUNK_SHIFT);
> @@ -1884,8 +1883,6 @@ retry:
> DDPRINTF("Writing %" PRIu64 " chunks, (%" PRIu64 " MB)\n",
> chunks + 1, (chunks + 1) * (1UL << RDMA_REG_CHUNK_SHIFT) / 1024 /
> 1024);
>
> - chunk_end = ram_chunk_end(block, chunk + chunks);
> -
But here chuck_end was the length of a list of chucks.
> @@ -3076,11 +3069,9 @@ static int qemu_rdma_registration_handle(QEMUFile *f,
> void *opaque,
> host_addr = block->local_host_addr +
> (reg->key.chunk * (1UL << RDMA_REG_CHUNK_SHIFT));
> }
> - chunk_start = ram_chunk_start(block, chunk);
> - chunk_end = ram_chunk_end(block, chunk + reg->chunks);
> if (qemu_rdma_register_and_get_keys(rdma, block,
> (uint8_t *)host_addr, NULL, ®_result->rkey,
> - chunk, chunk_start, chunk_end)) {
> + chunk)) {
Same here.
I am missing something obvious?
PD. No, I don't claim to understand RDMA.