[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL v3 4/7] rdma: core logic
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PULL v3 4/7] rdma: core logic |
Date: |
Wed, 17 Apr 2013 16:09:27 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 |
Il 17/04/2013 13:20, Orit Wasserman ha scritto:
>> +/*
>> + * Virtual address of the above structures used for transmitting
>> + * the RAMBlock descriptions at connection-time.
>> + */
>> +typedef struct RDMALocalBlocks {
>> + int num_blocks;
>> + RDMALocalBlock *block;
>> +} RDMALocalBlocks;
>> +
>
> Why not use some glib container?
> If you need to find a block by offset it will be more simple and efficient.
I think it's okay, the num_blocks is small and static.
>> +static int qemu_rdma_connect(RDMAContext *rdma, Error **errp)
>> +{
>> + RDMAControlHeader head;
>> + RDMACapabilities cap = {
>> + .version = RDMA_CONTROL_VERSION_CURRENT,
>> + .flags = 0,
>> + };
>> + struct rdma_conn_param conn_param = { .initiator_depth = 2,
>> + .retry_count = 5,
>> + .private_data = &cap,
>> + .private_data_len = sizeof(cap),
>> + };
>> + struct rdma_cm_event *cm_event;
>> + int ret;
>> + int idx = 0;
>> + int x;
>> +
>> + if (rdma->chunk_register_destination) {
>> + printf("Server dynamic registration requested.\n");
>
> Debug ?
Right, please remove.
>> + cap.flags |= RDMA_CAPABILITY_CHUNK_REGISTER;
>> + }
>> +
>> + caps_to_network(&cap);
>> +
>> + ret = rdma_connect(rdma->cm_id, &conn_param);
>> + if (ret) {
>> + perror("rdma_connect");
>
> Please use errp and set it ...
All good catches with errp, I completely missed it in my review!
Thanks,
Paolo
- Re: [Qemu-devel] [PULL v3 2/7] rdma: new QEMUFileOps hooks, (continued)