From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] Use guards in virtio-net for easier upstream merging Date: Thu, 04 Dec 2008 09:09:10 -0600 Message-ID: <4937F296.3060902@codemonkey.ws> References: <1228336330-25664-1-git-send-email-aliguori@us.ibm.com> <1228392408.3732.72.camel@blaa> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Avi Kivity To: Mark McLoughlin Return-path: Received: from yx-out-2324.google.com ([74.125.44.30]:58217 "EHLO yx-out-2324.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754239AbYLDPJb (ORCPT ); Thu, 4 Dec 2008 10:09:31 -0500 Received: by yx-out-2324.google.com with SMTP id 8so1725199yxm.1 for ; Thu, 04 Dec 2008 07:09:30 -0800 (PST) In-Reply-To: <1228392408.3732.72.camel@blaa> Sender: kvm-owner@vger.kernel.org List-ID: Mark McLoughlin wrote: > On Wed, 2008-12-03 at 14:32 -0600, Anthony Liguori wrote: > > >> @@ -189,6 +205,9 @@ static void virtio_net_receive(void *opaque, const uint8_t *buf, int size) >> struct virtio_net_hdr_mrg_rxbuf *mhdr = NULL; >> int hdr_len, offset, i; >> >> + if (!virtio_net_can_receive(opaque)) >> + return; >> > > Should pass the buffer size to virtio_net_can_receive() to limit the > work virtqueue_avail_bytes() has to do. > Sure, I have to resubmit anyway because I left tap_vnet disable (didn't refresh before sending patch-doh!). Regards, Anthony Liguori > Cheers, > Mark. > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >