From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [PATCH 1/2 V3] virtio-spec: dynamic network offloads configuration Date: Wed, 03 Apr 2013 11:50:19 +1030 Message-ID: <87ehes5s18.fsf@rustcorp.com.au> References: <1364902740-24948-1-git-send-email-dmitry@daynix.com> <1364902740-24948-2-git-send-email-dmitry@daynix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1364902740-24948-2-git-send-email-dmitry@daynix.com> 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: Dmitry Fleytman , virtualization@lists.linux-foundation.org, qemu-devel@nongnu.org Cc: Yan Vugenfirer , Ronen Hod , Dmitry Fleytman , "Michael S. Tsirkin" List-Id: virtualization@lists.linuxfoundation.org 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. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55150) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNHW4-0004Bx-R0 for qemu-devel@nongnu.org; Wed, 03 Apr 2013 02:49:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNHW3-0004sF-1D for qemu-devel@nongnu.org; Wed, 03 Apr 2013 02:49:52 -0400 Received: from ozlabs.org ([2402:b800:7003:1:1::1]:49115) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNHW2-0004qO-IN for qemu-devel@nongnu.org; Wed, 03 Apr 2013 02:49:50 -0400 From: Rusty Russell In-Reply-To: <1364902740-24948-2-git-send-email-dmitry@daynix.com> References: <1364902740-24948-1-git-send-email-dmitry@daynix.com> <1364902740-24948-2-git-send-email-dmitry@daynix.com> Date: Wed, 03 Apr 2013 11:50:19 +1030 Message-ID: <87ehes5s18.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Dmitry Fleytman , virtualization@lists.linux-foundation.org, qemu-devel@nongnu.org Cc: Yan Vugenfirer , Ronen Hod , Dmitry Fleytman , "Michael S. Tsirkin" 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.