From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53351) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNLnq-00058G-0U for qemu-devel@nongnu.org; Wed, 03 Apr 2013 07:24:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNLnl-0005ML-Jp for qemu-devel@nongnu.org; Wed, 03 Apr 2013 07:24:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNLnl-0005KF-8i for qemu-devel@nongnu.org; Wed, 03 Apr 2013 07:24:25 -0400 Date: Wed, 3 Apr 2013 14:25:15 +0300 From: "Michael S. Tsirkin" Message-ID: <20130403112515.GC19122@redhat.com> References: <1364902740-24948-1-git-send-email-dmitry@daynix.com> <1364902740-24948-2-git-send-email-dmitry@daynix.com> <87ehes5s18.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ehes5s18.fsf@rustcorp.com.au> Subject: Re: [Qemu-devel] [PATCH 1/2 V3] virtio-spec: dynamic network offloads configuration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Rusty Russell Cc: qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org, Yan Vugenfirer , Ronen Hod , Dmitry Fleytman , Dmitry Fleytman On Wed, Apr 03, 2013 at 11:50:19AM +1030, Rusty Russell wrote: > Dmitry Fleytman writes: > > From: Dmitry Fleytman > > > > Virtio-net driver currently negotiates network offloads > > on startup via features mechanism and have no ability to > > change offloads state later. > > This patch introduced a new control command that allows > > to configure device network offloads state dynamically. > > The patch also introduces a new feature flag > > VIRTIO_NET_F_CTRL_GUEST_OFFLOADS. > > > > Signed-off-by: Dmitry Fleytman > > (BTW, I like to be CC'd on these things directly, so I don't miss them) > > The idea is fine. > > But I dislike the duplication of constants: let's just use the feature > bits directly: > > #define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */ > #define VIRTIO_NET_F_GUEST_TSO4 7 /* Guest can handle TSOv4 in. */ > #define VIRTIO_NET_F_GUEST_TSO6 8 /* Guest can handle TSOv6 in. */ > #define VIRTIO_NET_F_GUEST_ECN 9 /* Guest can handle TSO[6] w/ ECN in. */ > #define VIRTIO_NET_F_GUEST_UFO 10 /* Guest can handle UFO in. */ > > You want this, because you have to test against them anyway before > trying to re-enable them. > > And secondly, it'll be much clearer if you don't say "change" but > "disable and re-enable", which is what's actually allowed. > > Thanks, > Rusty. Okay and let's make command it bigger, say 64 bit then, in case we add lots of feature bits in the future?