[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-03-07 Thread Yuanhan Liu
On Mon, Mar 07, 2016 at 02:59:55AM +, Xie, Huawei wrote: > On 3/7/2016 10:47 AM, Yuanhan Liu wrote: > > On Mon, Mar 07, 2016 at 02:32:46AM +, Xie, Huawei wrote: > >> On 3/4/2016 10:15 AM, Yuanhan Liu wrote: > >>> On Thu, Mar 03, 2016 at 04:30:42PM +, Xie, Huawei wrote: > On

[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-03-07 Thread Yuanhan Liu
On Mon, Mar 07, 2016 at 02:32:46AM +, Xie, Huawei wrote: > On 3/4/2016 10:15 AM, Yuanhan Liu wrote: > > On Thu, Mar 03, 2016 at 04:30:42PM +, Xie, Huawei wrote: > >> On 2/18/2016 9:48 PM, Yuanhan Liu wrote: > >>> + mbuf_avail = 0; > >>> + mbuf_offset = 0; > >>> + while (desc_avail ||

[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-03-07 Thread Yuanhan Liu
On Mon, Mar 07, 2016 at 02:19:54AM +, Xie, Huawei wrote: > On 3/4/2016 10:19 AM, Yuanhan Liu wrote: > > On Thu, Mar 03, 2016 at 04:21:19PM +, Xie, Huawei wrote: > >> On 2/18/2016 9:48 PM, Yuanhan Liu wrote: > >>> The current rte_vhost_dequeue_burst() implementation is a bit messy > >>> and

[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-03-07 Thread Xie, Huawei
On 2/18/2016 9:48 PM, Yuanhan Liu wrote: > + mbuf_avail = 0; > + mbuf_offset = 0; one cs nit, put it at the definition.

[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-03-07 Thread Xie, Huawei
On 3/4/2016 10:30 AM, Yuanhan Liu wrote: > On Thu, Mar 03, 2016 at 05:40:14PM +, Xie, Huawei wrote: >> On 2/18/2016 9:48 PM, Yuanhan Liu wrote: >>> The current rte_vhost_dequeue_burst() implementation is a bit messy >> [...] >>> + >>> uint16_t >>> rte_vhost_dequeue_burst(struct virtio_net

[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-03-07 Thread Xie, Huawei
On 3/7/2016 10:47 AM, Yuanhan Liu wrote: > On Mon, Mar 07, 2016 at 02:32:46AM +, Xie, Huawei wrote: >> On 3/4/2016 10:15 AM, Yuanhan Liu wrote: >>> On Thu, Mar 03, 2016 at 04:30:42PM +, Xie, Huawei wrote: On 2/18/2016 9:48 PM, Yuanhan Liu wrote: > + mbuf_avail = 0; > +

[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-03-07 Thread Xie, Huawei
On 3/4/2016 10:10 AM, Yuanhan Liu wrote: > On Thu, Mar 03, 2016 at 05:19:42PM +, Xie, Huawei wrote: >> On 2/18/2016 9:48 PM, Yuanhan Liu wrote: >>> [...] >> CCed changchun, the author for the chained handling of desc and mbuf. >> The change makes the code more readable, but i think the

[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-03-07 Thread Xie, Huawei
On 3/4/2016 10:15 AM, Yuanhan Liu wrote: > On Thu, Mar 03, 2016 at 04:30:42PM +, Xie, Huawei wrote: >> On 2/18/2016 9:48 PM, Yuanhan Liu wrote: >>> + mbuf_avail = 0; >>> + mbuf_offset = 0; >>> + while (desc_avail || (desc->flags & VRING_DESC_F_NEXT) != 0) { >>> + /* This desc

[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-03-07 Thread Xie, Huawei
On 3/4/2016 10:19 AM, Yuanhan Liu wrote: > On Thu, Mar 03, 2016 at 04:21:19PM +, Xie, Huawei wrote: >> On 2/18/2016 9:48 PM, Yuanhan Liu wrote: >>> The current rte_vhost_dequeue_burst() implementation is a bit messy >>> and logic twisted. And you could see repeat code here and there: it >>>

[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-03-04 Thread Yuanhan Liu
On Thu, Mar 03, 2016 at 05:40:14PM +, Xie, Huawei wrote: > On 2/18/2016 9:48 PM, Yuanhan Liu wrote: > > The current rte_vhost_dequeue_burst() implementation is a bit messy > [...] > > + > > uint16_t > > rte_vhost_dequeue_burst(struct virtio_net *dev, uint16_t queue_id, > > struct

[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-03-04 Thread Yuanhan Liu
On Thu, Mar 03, 2016 at 04:21:19PM +, Xie, Huawei wrote: > On 2/18/2016 9:48 PM, Yuanhan Liu wrote: > > The current rte_vhost_dequeue_burst() implementation is a bit messy > > and logic twisted. And you could see repeat code here and there: it > > invokes rte_pktmbuf_alloc() three times at

[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-03-04 Thread Yuanhan Liu
On Thu, Mar 03, 2016 at 04:30:42PM +, Xie, Huawei wrote: > On 2/18/2016 9:48 PM, Yuanhan Liu wrote: > > + mbuf_avail = 0; > > + mbuf_offset = 0; > > + while (desc_avail || (desc->flags & VRING_DESC_F_NEXT) != 0) { > > + /* This desc reachs to its end, get the next one */ > > +

[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-03-04 Thread Yuanhan Liu
On Thu, Mar 03, 2016 at 05:19:42PM +, Xie, Huawei wrote: > On 2/18/2016 9:48 PM, Yuanhan Liu wrote: > > [...] > CCed changchun, the author for the chained handling of desc and mbuf. > The change makes the code more readable, but i think the following > commit message is simple and enough.

[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-03-03 Thread Xie, Huawei
On 2/18/2016 9:48 PM, Yuanhan Liu wrote: > The current rte_vhost_dequeue_burst() implementation is a bit messy [...] > + > uint16_t > rte_vhost_dequeue_burst(struct virtio_net *dev, uint16_t queue_id, > struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t count) > { > -

[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-03-03 Thread Xie, Huawei
On 2/18/2016 9:48 PM, Yuanhan Liu wrote: > [...] CCed changchun, the author for the chained handling of desc and mbuf. The change makes the code more readable, but i think the following commit message is simple and enough. > > while (this_desc_is_not_drained_totally || has_next_desc) { >

[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-03-03 Thread Xie, Huawei
On 2/18/2016 9:48 PM, Yuanhan Liu wrote: > + mbuf_avail = 0; > + mbuf_offset = 0; > + while (desc_avail || (desc->flags & VRING_DESC_F_NEXT) != 0) { > + /* This desc reachs to its end, get the next one */ > + if (desc_avail == 0) { > + desc

[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-03-03 Thread Xie, Huawei
On 2/18/2016 9:48 PM, Yuanhan Liu wrote: > The current rte_vhost_dequeue_burst() implementation is a bit messy > and logic twisted. And you could see repeat code here and there: it > invokes rte_pktmbuf_alloc() three times at three different places! > > However, rte_vhost_dequeue_burst() acutally

[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-02-18 Thread Yuanhan Liu
The current rte_vhost_dequeue_burst() implementation is a bit messy and logic twisted. And you could see repeat code here and there: it invokes rte_pktmbuf_alloc() three times at three different places! However, rte_vhost_dequeue_burst() acutally does a simple job: copy the packet data from vring