From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMHN2-0004Kh-PB for qemu-devel@nongnu.org; Wed, 18 Sep 2013 09:00:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMHMx-0003Qk-IF for qemu-devel@nongnu.org; Wed, 18 Sep 2013 09:00:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMHMx-0003Qd-5U for qemu-devel@nongnu.org; Wed, 18 Sep 2013 09:00:35 -0400 From: Juan Quintela In-Reply-To: <9683795de456be26be098f36807d1d4da3027cd0.1378261891.git.yamahata@private.email.ne.jp> (Isaku Yamahata's message of "Wed, 4 Sep 2013 11:32:20 +0900") References: <5d53d839653bf4fd24d5cb56f6d24d3dc3f8f8a5.1378261891.git.yamahata@private.email.ne.jp> <5d53d839653bf4fd24d5cb56f6d24d3dc3f8f8a5.1378261891.git.yamahata@private.email.ne.jp> <9683795de456be26be098f36807d1d4da3027cd0.1378261891.git.yamahata@private.email.ne.jp> Date: Wed, 18 Sep 2013 15:00:24 +0200 Message-ID: <87vc1yuvx3.fsf@elfo.elfo> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 2/2] rdma: simplify qemu_rdma_register_and_get_keys() Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: owasserm@redhat.com, mrhines@us.ibm.com, qemu-devel@nongnu.org, pbonzini@redhat.com Isaku Yamahata wrote: > Signed-off-by: Isaku Yamahata 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.