From patchwork Tue Apr 2 11:38:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Fleytman X-Patchwork-Id: 232966 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4448C2C0092 for ; Tue, 2 Apr 2013 22:39:51 +1100 (EST) Received: from localhost ([::1]:42523 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMzZ6-0007Hc-Bg for incoming@patchwork.ozlabs.org; Tue, 02 Apr 2013 07:39:48 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMzYe-0007DL-4s for qemu-devel@nongnu.org; Tue, 02 Apr 2013 07:39:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UMzYX-0007w6-NT for qemu-devel@nongnu.org; Tue, 02 Apr 2013 07:39:20 -0400 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:46798) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMzYX-0007vq-CT for qemu-devel@nongnu.org; Tue, 02 Apr 2013 07:39:13 -0400 Received: by mail-wi0-f169.google.com with SMTP id c10so3071064wiw.4 for ; Tue, 02 Apr 2013 04:39:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=c6PgUhOPSOODYAUJ6vnLePopzWz0tJ/jBY2AfpBhFb8=; b=i1kqhhUfPSK6jQOO2XAvRVMBS5t/sCuTFmWVeSWmZLXebvmHkg8nL2nf6k366FXF3y FIyORZk28DtzAMcLSJIV++MAmzVU4Z3hpeYIEt2hm+0HKqYtPGrN4NZ/lM4LFZPBavTN /1BjT+Ht8l288yVr88O4GyYQ6d6kSHSMOQFLyx9uC5XLJ+sIwwDN3FEVE6zrLNMxEH4i W/MFJvC10SE3M19NxvUEG/3AJ2ZsHWV1IRekupsBT5aj6VeCiGk2VEihrdz9B6hRrtBx gRutUJcoTICJzam+33bXVprva9wHn3Y8yCkzczAOthbHRHe1Fukr2deMO4jwZl4EoTSP fqIg== X-Received: by 10.180.185.239 with SMTP id ff15mr15258780wic.2.1364902752605; Tue, 02 Apr 2013 04:39:12 -0700 (PDT) Received: from Snarl.daynix ([91.205.155.63]) by mx.google.com with ESMTPS id bq19sm2001930wib.7.2013.04.02.04.39.10 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 02 Apr 2013 04:39:11 -0700 (PDT) From: Dmitry Fleytman To: virtualization@lists.linux-foundation.org, qemu-devel@nongnu.org Date: Tue, 2 Apr 2013 14:38:59 +0300 Message-Id: <1364902740-24948-2-git-send-email-dmitry@daynix.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1364902740-24948-1-git-send-email-dmitry@daynix.com> References: <1364902740-24948-1-git-send-email-dmitry@daynix.com> X-Gm-Message-State: ALoCoQmpZs0/hQ9Gq/xKlzOkGq8z7Kjl4CFf2V4jz4BGGs0pJ2krnWKvWS6Tw9h0yyIHGrGbvTap X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::229 Cc: Dmitry Fleytman , Yan Vugenfirer , Ronen Hod , Dmitry Fleytman , "Michael S. Tsirkin" Subject: [Qemu-devel] [PATCH 1/2 V3] virtio-spec: dynamic network offloads configuration X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- virtio-spec.lyx | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) diff --git a/virtio-spec.lyx b/virtio-spec.lyx index 3d2f485..fdba814 100644 --- a/virtio-spec.lyx +++ b/virtio-spec.lyx @@ -60,6 +60,7 @@ \author -1930653948 "Amos Kong" \author -608949062 "Rusty Russell,,," \author -385801441 "Cornelia Huck" cornelia.huck@de.ibm.com +\author 460276516 "Dmitry Fleytman" dfleytma@redhat.com \author 1112500848 "Rusty Russell" rusty@rustcorp.com.au \author 1531152142 "Paolo Bonzini,,," \author 1717892615 "Alexey Zaytsev,,," @@ -4261,6 +4262,20 @@ VIRTIO_NET_F_GUEST_CSUM \end_inset (1) Guest handles packets with partial checksum +\change_inserted 460276516 1363712169 + +\end_layout + +\begin_layout Description + +\change_inserted 460276516 1363712334 +VIRTIO_NET_F_CTRL_GUEST_OFFLOADS +\begin_inset space ~ +\end_inset + +(2) Control channel offloads reconfiguration support. +\change_unchanged + \end_layout \begin_layout Description @@ -5675,6 +5690,134 @@ virtqueue_pairs = 1 \end_layout +\begin_layout Subsection* + +\change_inserted 460276516 1363765850 +Offloads State Configuration +\end_layout + +\begin_layout Standard + +\change_inserted 460276516 1363765861 +If the VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature is negotiated, the driver can + send control commands for dynamic offloads state configuration. +\end_layout + +\begin_layout Subsubsection* + +\change_inserted 460276516 1363765928 +Setting offloads state +\end_layout + +\begin_layout Standard + +\change_inserted 460276516 1363713225 +\begin_inset listings +inline false +status open + +\begin_layout Plain Layout + +\change_inserted 460276516 1363765996 + +u32 offloads; +\end_layout + +\begin_layout Plain Layout + +\change_inserted 460276516 1363765997 + +\end_layout + +\begin_layout Plain Layout + +\change_inserted 460276516 1363766044 + +#define VIRTIO_NET_OFFLOAD_GUEST_CSUM 1 +\end_layout + +\begin_layout Plain Layout + +\change_inserted 460276516 1363766051 + +#define VIRTIO_NET_OFFLOAD_GUEST_TSO4 2 +\end_layout + +\begin_layout Plain Layout + +\change_inserted 460276516 1363766055 + +#define VIRTIO_NET_OFFLOAD_GUEST_TSO6 4 +\end_layout + +\begin_layout Plain Layout + +\change_inserted 460276516 1363766064 + +#define VIRTIO_NET_OFFLOAD_GUEST_ECN 8 +\end_layout + +\begin_layout Plain Layout + +\change_inserted 460276516 1363766035 + +#define VIRTIO_NET_OFFLOAD_GUEST_UFO 16 +\end_layout + +\begin_layout Plain Layout + +\change_inserted 460276516 1363766031 + +\end_layout + +\begin_layout Plain Layout + +\change_inserted 460276516 1363765865 + +#define VIRTIO_NET_CTRL_GUEST_OFFLOADS 5 +\end_layout + +\begin_layout Plain Layout + +\change_inserted 460276516 1363765867 + + #define VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET 0 +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard + +\change_inserted 460276516 1363766082 +The class VIRTIO_NET_CTRL_GUEST_OFFLOADS has one command: VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET + applies the new offloads configuration. +\end_layout + +\begin_layout Standard + +\change_inserted 460276516 1363766435 +u32 value passed as command data is a bitmask, bits set define offloads + to be enabled, bits cleared - offloads to be disabled. +\end_layout + +\begin_layout Standard + +\change_inserted 460276516 1363766757 +There is a corresponding device feature for each offload. + Upon feature negotiation corresponding offload gets enabled to preserve + backward compartibility. +\end_layout + +\begin_layout Standard + +\change_inserted 460276516 1363766720 +Corresponding feature must be negotiated at startup in order to allow dynamic + change of specific offload state. +\end_layout + \begin_layout Chapter* Appendix D: Block Device \end_layout