Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-10 Thread Yuanhan Liu
On Mon, Oct 10, 2016 at 07:39:59AM +0300, Michael S. Tsirkin wrote: > > > > > > 1. why is this memset expensive? > > > > > > > > > > I don't have the exact answer, but just some rough thoughts: > > > > > > > > > > It's an external clib function: there is a call stack and the > > > > > IP register w

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-10 Thread Yuanhan Liu
On Tue, Oct 11, 2016 at 08:39:54AM +0200, Maxime Coquelin wrote: > > > On 10/11/2016 08:04 AM, Yuanhan Liu wrote: > >On Mon, Oct 10, 2016 at 04:54:39PM +0200, Maxime Coquelin wrote: > >> > >> > >>On 10/10/2016 04:42 PM, Yuanhan Liu wrote: > >>>On Mon, Oct 10, 2016 at 02:40:44PM +0200, Maxime Coqu

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-10 Thread Maxime Coquelin
On 10/11/2016 08:04 AM, Yuanhan Liu wrote: On Mon, Oct 10, 2016 at 04:54:39PM +0200, Maxime Coquelin wrote: On 10/10/2016 04:42 PM, Yuanhan Liu wrote: On Mon, Oct 10, 2016 at 02:40:44PM +0200, Maxime Coquelin wrote: At that time, a packet always use 2 descs. Since indirect desc is enabled

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-10 Thread Yuanhan Liu
On Mon, Oct 10, 2016 at 04:54:39PM +0200, Maxime Coquelin wrote: > > > On 10/10/2016 04:42 PM, Yuanhan Liu wrote: > >On Mon, Oct 10, 2016 at 02:40:44PM +0200, Maxime Coquelin wrote: > >At that time, a packet always use 2 descs. Since indirect desc is > >enabled (by default) now, the assum

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-10 Thread Maxime Coquelin
On 10/10/2016 04:42 PM, Yuanhan Liu wrote: On Mon, Oct 10, 2016 at 02:40:44PM +0200, Maxime Coquelin wrote: At that time, a packet always use 2 descs. Since indirect desc is enabled (by default) now, the assumption is not true then. What's worse, it might even slow things a bit down. That shou

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-10 Thread Yuanhan Liu
On Mon, Oct 10, 2016 at 02:40:44PM +0200, Maxime Coquelin wrote: > >>>At that time, a packet always use 2 descs. Since indirect desc is > >>>enabled (by default) now, the assumption is not true then. What's > >>>worse, it might even slow things a bit down. That should also be > >>>part of the reaso

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-10 Thread Wang, Zhihong
> -Original Message- > From: Yuanhan Liu [mailto:yuanhan@linux.intel.com] > Sent: Monday, October 10, 2016 11:59 AM > To: Michael S. Tsirkin > Cc: Maxime Coquelin ; Stephen Hemminger > ; d...@dpdk.org; qemu- > de...@nongnu.org; Wang, Zhihong > Subject: Re:

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-10 Thread Maxime Coquelin
On 10/10/2016 06:22 AM, Yuanhan Liu wrote: On Mon, Oct 10, 2016 at 07:17:06AM +0300, Michael S. Tsirkin wrote: On Mon, Oct 10, 2016 at 12:05:31PM +0800, Yuanhan Liu wrote: On Fri, Sep 30, 2016 at 10:16:43PM +0300, Michael S. Tsirkin wrote: And the same is done is done in DPDK: static inline

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Michael S. Tsirkin
tephen Hemminger > > ; d...@dpdk.org; qemu- > > de...@nongnu.org; Wang, Zhihong > > Subject: Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature > > > > On Mon, Oct 10, 2016 at 06:46:44AM +0300, Michael S. Tsirkin wrote: > > > On Mon, Oct 10, 2016 at

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Michael S. Tsirkin
On Mon, Oct 10, 2016 at 12:22:09PM +0800, Yuanhan Liu wrote: > On Mon, Oct 10, 2016 at 07:17:06AM +0300, Michael S. Tsirkin wrote: > > On Mon, Oct 10, 2016 at 12:05:31PM +0800, Yuanhan Liu wrote: > > > On Fri, Sep 30, 2016 at 10:16:43PM +0300, Michael S. Tsirkin wrote: > > > > > > And the same is d

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Michael S. Tsirkin
tephen Hemminger > > ; d...@dpdk.org; qemu- > > de...@nongnu.org; Wang, Zhihong > > Subject: Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature > > > > On Mon, Oct 10, 2016 at 06:46:44AM +0300, Michael S. Tsirkin wrote: > > > On Mon, Oct 10, 2016 at

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Yuanhan Liu
On Mon, Oct 10, 2016 at 07:17:06AM +0300, Michael S. Tsirkin wrote: > On Mon, Oct 10, 2016 at 12:05:31PM +0800, Yuanhan Liu wrote: > > On Fri, Sep 30, 2016 at 10:16:43PM +0300, Michael S. Tsirkin wrote: > > > > > And the same is done is done in DPDK: > > > > > > > > > > static inline int __attribu

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Michael S. Tsirkin
On Mon, Oct 10, 2016 at 12:05:31PM +0800, Yuanhan Liu wrote: > On Fri, Sep 30, 2016 at 10:16:43PM +0300, Michael S. Tsirkin wrote: > > > > And the same is done is done in DPDK: > > > > > > > > static inline int __attribute__((always_inline)) > > > > copy_desc_to_mbuf(struct virtio_net *dev, struct

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Yuanhan Liu
On Fri, Sep 30, 2016 at 10:16:43PM +0300, Michael S. Tsirkin wrote: > > > And the same is done is done in DPDK: > > > > > > static inline int __attribute__((always_inline)) > > > copy_desc_to_mbuf(struct virtio_net *dev, struct vring_desc *descs, > > > uint16_t max_desc, struct rte_mbuf

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Yuanhan Liu
On Thu, Sep 29, 2016 at 10:05:22PM +0200, Maxime Coquelin wrote: > >so doing this unconditionally would be a spec violation, but if you see > >value in this, we can add a feature bit. > Right it would be a spec violation, so it should be done conditionally. > If a feature bit is to be added, what a

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Michael S. Tsirkin
On Mon, Oct 10, 2016 at 11:37:44AM +0800, Yuanhan Liu wrote: > On Thu, Sep 29, 2016 at 11:21:48PM +0300, Michael S. Tsirkin wrote: > > On Thu, Sep 29, 2016 at 10:05:22PM +0200, Maxime Coquelin wrote: > > > > > > > > > On 09/29/2016 07:57 PM, Michael S. Tsirkin wrote: > > Yes but two points. > >

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Yuanhan Liu
On Mon, Oct 10, 2016 at 06:46:44AM +0300, Michael S. Tsirkin wrote: > On Mon, Oct 10, 2016 at 11:37:44AM +0800, Yuanhan Liu wrote: > > On Thu, Sep 29, 2016 at 11:21:48PM +0300, Michael S. Tsirkin wrote: > > > On Thu, Sep 29, 2016 at 10:05:22PM +0200, Maxime Coquelin wrote: > > > > > > > > > > > >

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Yuanhan Liu
On Mon, Oct 10, 2016 at 06:04:32AM +0300, Michael S. Tsirkin wrote: > > > So I guess at this point, we can teach vhost-user in qemu > > > that version 1 implies any_layout but only for machine types > > > qemu 2.8 and up. It sets a bad precedent but oh well. > > > > It should work. > > > > --

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Michael S. Tsirkin
On Mon, Oct 10, 2016 at 11:03:33AM +0800, Yuanhan Liu wrote: > On Mon, Oct 10, 2016 at 02:20:22AM +0300, Michael S. Tsirkin wrote: > > On Wed, Sep 28, 2016 at 10:28:48AM +0800, Yuanhan Liu wrote: > > > On Tue, Sep 27, 2016 at 10:56:40PM +0300, Michael S. Tsirkin wrote: > > > > On Tue, Sep 27, 2016

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Yuanhan Liu
On Mon, Oct 10, 2016 at 02:20:22AM +0300, Michael S. Tsirkin wrote: > On Wed, Sep 28, 2016 at 10:28:48AM +0800, Yuanhan Liu wrote: > > On Tue, Sep 27, 2016 at 10:56:40PM +0300, Michael S. Tsirkin wrote: > > > On Tue, Sep 27, 2016 at 11:11:58AM +0800, Yuanhan Liu wrote: > > > > On Mon, Sep 26, 2016

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Yuanhan Liu
On Thu, Sep 29, 2016 at 11:21:48PM +0300, Michael S. Tsirkin wrote: > On Thu, Sep 29, 2016 at 10:05:22PM +0200, Maxime Coquelin wrote: > > > > > > On 09/29/2016 07:57 PM, Michael S. Tsirkin wrote: > Yes but two points. > > 1. why is this memset expensive? I don't have the exact answer, but just

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Michael S. Tsirkin
On Wed, Sep 28, 2016 at 10:28:48AM +0800, Yuanhan Liu wrote: > On Tue, Sep 27, 2016 at 10:56:40PM +0300, Michael S. Tsirkin wrote: > > On Tue, Sep 27, 2016 at 11:11:58AM +0800, Yuanhan Liu wrote: > > > On Mon, Sep 26, 2016 at 10:24:55PM +0300, Michael S. Tsirkin wrote: > > > > On Mon, Sep 26, 2016

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-03 Thread Maxime Coquelin
On 09/29/2016 10:21 PM, Michael S. Tsirkin wrote: On Thu, Sep 29, 2016 at 10:05:22PM +0200, Maxime Coquelin wrote: > > > On 09/29/2016 07:57 PM, Michael S. Tsirkin wrote: > > On Thu, Sep 29, 2016 at 05:30:53PM +0200, Maxime Coquelin wrote: > ... > > > > > > Before enabling anything by defau

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-09-30 Thread Michael S. Tsirkin
On Fri, Sep 30, 2016 at 02:05:10PM +0200, Maxime Coquelin wrote: > > > On 09/29/2016 11:23 PM, Maxime Coquelin wrote: > > > > > > On 09/29/2016 10:21 PM, Michael S. Tsirkin wrote: > > > On Thu, Sep 29, 2016 at 10:05:22PM +0200, Maxime Coquelin wrote: > > > > > > > > > > > > On 09/29/2016 07:5

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-09-30 Thread Maxime Coquelin
On 09/29/2016 11:23 PM, Maxime Coquelin wrote: On 09/29/2016 10:21 PM, Michael S. Tsirkin wrote: On Thu, Sep 29, 2016 at 10:05:22PM +0200, Maxime Coquelin wrote: On 09/29/2016 07:57 PM, Michael S. Tsirkin wrote: On Thu, Sep 29, 2016 at 05:30:53PM +0200, Maxime Coquelin wrote: ... Befo

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-09-29 Thread Maxime Coquelin
On 09/29/2016 10:21 PM, Michael S. Tsirkin wrote: On Thu, Sep 29, 2016 at 10:05:22PM +0200, Maxime Coquelin wrote: On 09/29/2016 07:57 PM, Michael S. Tsirkin wrote: On Thu, Sep 29, 2016 at 05:30:53PM +0200, Maxime Coquelin wrote: ... Before enabling anything by default, we should first o

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-09-29 Thread Michael S. Tsirkin
On Thu, Sep 29, 2016 at 10:05:22PM +0200, Maxime Coquelin wrote: > > > On 09/29/2016 07:57 PM, Michael S. Tsirkin wrote: > > On Thu, Sep 29, 2016 at 05:30:53PM +0200, Maxime Coquelin wrote: > ... > > > > > > Before enabling anything by default, we should first optimize the 1 slot > > > case. Ind

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-09-29 Thread Maxime Coquelin
On 09/29/2016 07:57 PM, Michael S. Tsirkin wrote: On Thu, Sep 29, 2016 at 05:30:53PM +0200, Maxime Coquelin wrote: ... Before enabling anything by default, we should first optimize the 1 slot case. Indeed, micro-benchmark using testpmd in txonly[0] shows ~17% perf regression for 64 bytes cas

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-09-29 Thread Michael S. Tsirkin
On Thu, Sep 29, 2016 at 05:30:53PM +0200, Maxime Coquelin wrote: > > > On 09/28/2016 04:28 AM, Yuanhan Liu wrote: > > On Tue, Sep 27, 2016 at 10:56:40PM +0300, Michael S. Tsirkin wrote: > > > On Tue, Sep 27, 2016 at 11:11:58AM +0800, Yuanhan Liu wrote: > > > > On Mon, Sep 26, 2016 at 10:24:55PM +

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-09-29 Thread Maxime Coquelin
On 09/28/2016 04:28 AM, Yuanhan Liu wrote: On Tue, Sep 27, 2016 at 10:56:40PM +0300, Michael S. Tsirkin wrote: On Tue, Sep 27, 2016 at 11:11:58AM +0800, Yuanhan Liu wrote: On Mon, Sep 26, 2016 at 10:24:55PM +0300, Michael S. Tsirkin wrote: On Mon, Sep 26, 2016 at 11:01:58AM -0700, Stephen He

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-09-27 Thread Yuanhan Liu
On Tue, Sep 27, 2016 at 10:56:40PM +0300, Michael S. Tsirkin wrote: > On Tue, Sep 27, 2016 at 11:11:58AM +0800, Yuanhan Liu wrote: > > On Mon, Sep 26, 2016 at 10:24:55PM +0300, Michael S. Tsirkin wrote: > > > On Mon, Sep 26, 2016 at 11:01:58AM -0700, Stephen Hemminger wrote: > > > > I assume that i

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-09-27 Thread Stephen Hemminger
On Tue, 27 Sep 2016 11:11:58 +0800 Yuanhan Liu wrote: > On Mon, Sep 26, 2016 at 10:24:55PM +0300, Michael S. Tsirkin wrote: > > On Mon, Sep 26, 2016 at 11:01:58AM -0700, Stephen Hemminger wrote: > > > I assume that if using Version 1 that the bit will be ignored > > Yes, but I will just quot

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-09-27 Thread Michael S. Tsirkin
On Tue, Sep 27, 2016 at 11:11:58AM +0800, Yuanhan Liu wrote: > On Mon, Sep 26, 2016 at 10:24:55PM +0300, Michael S. Tsirkin wrote: > > On Mon, Sep 26, 2016 at 11:01:58AM -0700, Stephen Hemminger wrote: > > > I assume that if using Version 1 that the bit will be ignored > > Yes, but I will just quo

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-09-26 Thread Yuanhan Liu
On Mon, Sep 26, 2016 at 10:24:55PM +0300, Michael S. Tsirkin wrote: > On Mon, Sep 26, 2016 at 11:01:58AM -0700, Stephen Hemminger wrote: > > I assume that if using Version 1 that the bit will be ignored Yes, but I will just quote what you just said: what if the guest virtio device is a legacy devi

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-09-26 Thread Michael S. Tsirkin
On Mon, Sep 26, 2016 at 11:01:58AM -0700, Stephen Hemminger wrote: > I assume that if using Version 1 that the bit will be ignored > Therein lies a problem. If dpdk tweaks flags, updating it will break guest migration. One way is to require that users specify all flags fully when creating the vi