Received: from eggs.gnu.org ([2001:4830:134:3::10]:60783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2uxw-00057s-H0 for qemu-devel@nongnu.org; Mon, 13 Jan 2014 22:47:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W2uxq-0005Iq-Ha for qemu-devel@nongnu.org; Mon, 13 Jan 2014 22:47:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:12989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2uxq-0005Il-8G for qemu-devel@nongnu.org; Mon, 13 Jan 2014 22:46:54 -0500 Date: Tue, 14 Jan 2014 11:46:31 +0800 From: Stefan Hajnoczi Message-ID: <20140114034631.GB4803@stefanha-thinkpad.redhat.com> References: <1386936303-7697-1-git-send-email-v.maffione@gmail.com> <1386936303-7697-5-git-send-email-v.maffione@gmail.com> <20140113072852.GE14770@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 4/5] net: add offloadings support to netmap backend List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vincenzo Maffione Cc: marcel.a@redhat.com, Stefan Hajnoczi , Jason Wang , qemu-devel@nongnu.org, lcapitulino@redhat.com, Anthony Liguori , Dmitry Fleytman , Paolo Bonzini , Giuseppe Lettieri , Luigi Rizzo On Mon, Jan 13, 2014 at 04:11:25PM +0100, Vincenzo Maffione wrote: > 2014/1/13 Stefan Hajnoczi > > > On Fri, Dec 13, 2013 at 01:05:02PM +0100, Vincenzo Maffione wrote: > > > +static void netmap_using_vnet_hdr(NetClientState *nc, bool enable) > > > +{ > > > +} > > > > I was trying to figure out whether it's okay for this function to be a > > nop. I've come to the conclusion that it's okay: > > > > If the netdev supports vnet_hdr then we enable vnet_hdr. If not, it > > will not enable it. > > > > Other NICs never enable vnet_hdr even if the netdev supports it. > > > > This interface is basically useless because set_vnet_hdr_len() is > > also needed and provides the same information, i.e. that we are > > transitioning from vnet_hdr off -> on. > > > > The bool argument is misleading since we never use this function to > > disable vnet_hdr. It's impossible to transition on -> off. > > > > I suggest removing using_vnet_hdr() and instead relying solely on > > set_vnet_hdr_len(). Do this as the first patch in the series before > > introducing the function pointers, that way all your following patches > > become simpler. > > > > Completely agree. As usual, I didn't want to change too much the existing > code. > This means that I have to remove the tap_using_vnet_hdr() calls from > virtio-net and vmxnet3 NICs before this patches, haven't I? Yep. I suggest starting this patch series with a few cleanup patches to get the tap_*() interface into shape. Then you can move that cleaned-up interface to NetClient in the second half of the patch series. By doing the cleanup first, you make the second half simpler. Stefan