From mboxrd@z Thu Jan 1 00:00:00 1970 From: Huawei Xie Subject: [PATCH v6 24/25] lib/librte_vhost: add TODO/FIXME for identified issues. Date: Thu, 9 Oct 2014 02:54:58 +0800 Message-ID: <1412794499-4332-25-git-send-email-huawei.xie@intel.com> References: <1412794499-4332-1-git-send-email-huawei.xie@intel.com> To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1412794499-4332-1-git-send-email-huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 1) FIXME:concurrent calls to vhost set mem table from different guests could cause mem_temp to be overrided. 2) TODO:cmpset cost quite some cpu cyles. allow app to disable this feature if there is no contention in real workload. 3) FIXME:fix scatter gather mbuf copy to vhost vring chained buffers Signed-off-by: Huawei Xie --- lib/librte_vhost/vhost-net-cdev.c | 1 + lib/librte_vhost/vhost_rxtx.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/librte_vhost/vhost-net-cdev.c b/lib/librte_vhost/vhost-net-cdev.c index e5875eb..91ff0d8 100644 --- a/lib/librte_vhost/vhost-net-cdev.c +++ b/lib/librte_vhost/vhost-net-cdev.c @@ -214,6 +214,7 @@ vhost_net_ioctl(fuse_req_t req, int cmd, void *arg, break; case VHOST_SET_MEM_TABLE: + /*TODO fix race condition.*/ LOG_DEBUG(VHOST_CONFIG, "(%"PRIu64") IOCTL: VHOST_SET_MEM_TABLE\n", ctx.fh); static struct vhost_memory mem_temp; diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c index 2a1171a..84ec0e8 100644 --- a/lib/librte_vhost/vhost_rxtx.c +++ b/lib/librte_vhost/vhost_rxtx.c @@ -93,6 +93,7 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id, res_end_idx = res_base_idx + count; /* vq->last_used_idx_res is atomically updated. */ + /* TODO: Allow to disable cmpset if no concurrency in application. */ success = rte_atomic16_cmpset(&vq->last_used_idx_res, res_base_idx, res_end_idx); } while (unlikely(success == 0)); @@ -146,6 +147,7 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id, vq->used->ring[res_cur_idx & (vq->size - 1)].len = packet_len; /* Copy mbuf data to buffer */ + /* FIXME for sg mbuf and the case that desc couldn't hold the mbuf data */ rte_memcpy((void *)(uintptr_t)buff_addr, rte_pktmbuf_mtod(buff, const void *), rte_pktmbuf_data_len(buff)); -- 1.8.1.4