From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cornelia Huck Subject: Re: [PATCH 2/2] vhost: disentangle vring endianness stuff from the core code Date: Wed, 10 Feb 2016 14:23:33 +0100 Message-ID: <20160210142333.744e4446.cornelia.huck@de.ibm.com> References: <20160113170934.23705.62626.stgit@bahia.huguette.org> <20160113170947.23705.95216.stgit@bahia.huguette.org> <20160210132240-mutt-send-email-mst@redhat.com> <20160210140843.64ea5aa1@bahia.huguette.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20160210140843.64ea5aa1@bahia.huguette.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Greg Kurz Cc: netdev@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, "Michael S. Tsirkin" List-Id: virtualization@lists.linuxfoundation.org On Wed, 10 Feb 2016 14:08:43 +0100 Greg Kurz wrote: > But you are right, there is a bug: we should rollback if vhost_init_used() > fails. Something like below: > > err_used: > vq->private_data = oldsock; > vhost_net_enable_vq(n, vq); > + vhost_adjust_vring_endian(vq); Shouldn't we switch back before we reenable? Or have I lost myself in this maze here again? > if (ubufs) > vhost_net_ubuf_put_wait_and_free(ubufs); > err_ubufs: