From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH v3 17/18] vhost: don't bother copying iovecs in handle_rx(), kill memcpy_toiovecend() Date: Wed, 4 Feb 2015 10:02:27 +0100 Message-ID: <20150204090227.GC9920@redhat.com> References: <20150204063730.GG29656@ZenIV.linux.org.uk> <1423032009-18367-17-git-send-email-viro@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, David Miller , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org To: Al Viro Return-path: Content-Disposition: inline In-Reply-To: <1423032009-18367-17-git-send-email-viro@ZenIV.linux.org.uk> 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 List-Id: netdev.vger.kernel.org > if (likely(mergeable) && > - memcpy_toiovecend(nvq->hdr, (unsigned char *)&headcount, > - offsetof(typeof(hdr), num_buffers), > - sizeof hdr.num_buffers)) { > + copy_to_iter(&headcount, 2, &fixup) != 2) { > vq_err(vq, "Failed num_buffers write"); > vhost_discard_vq_desc(vq, headcount); > break; BTW this will have to be re-based on top of http://mid.gmane.org/1422896842-19186-1-git-send-email-mst@redhat.com taking byte-swap into account.