From 6c9d2f4d76647a588cb173c1a847443b04aa8be7 Mon Sep 17 00:00:00 2001 From: rusty Date: Fri, 16 Aug 2013 03:20:21 +0000 Subject: As submitted to virtio-comment list: https://lists.oasis-open.org/archives/virtio-comment/201308/msg00009.html (Edited into plain text) From: Dmitry Fleytman Virtio-net driver currently negotiates network offloads on startup via features mechanism and have no ability to disable and re-enable offloads 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 Signed-off-by: Rusty Russell git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@14 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652 --- virtio-spec.txt | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/virtio-spec.txt b/virtio-spec.txt index d762461..a3ee054 100644 --- a/virtio-spec.txt +++ b/virtio-spec.txt @@ -1132,6 +1132,9 @@ features. VIRTIO_NET_F_GUEST_CSUM (1) Guest handles packets with partial checksum + VIRTIO_NET_F_CTRL_GUEST_OFFLOADS (2) Control channel offloads + reconfiguration support. + VIRTIO_NET_F_MAC (5) Device has given MAC address. VIRTIO_NET_F_GSO (6) (Deprecated) device handles packets with @@ -1473,6 +1476,38 @@ Processing this notification involves: 2. Sending VIRTIO_NET_CTRL_ANNOUNCE_ACK command through control vq. +2.5.1.5.3.4 Offloads State Configuration + +If the VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature is negotiated, the driver can +send control commands for dynamic offloads state configuration. + +2.5.1.5.4.3.1 Setting Offloads State + + u64 offloads; + + #define VIRTIO_NET_F_GUEST_CSUM 1 + #define VIRTIO_NET_F_GUEST_TSO4 7 + #define VIRTIO_NET_F_GUEST_TSO6 8 + #define VIRTIO_NET_F_GUEST_ECN 9 + #define VIRTIO_NET_F_GUEST_UFO 10 + + #define VIRTIO_NET_CTRL_GUEST_OFFLOADS 5 + #define VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET 0 + +The class VIRTIO_NET_CTRL_GUEST_OFFLOADS has one command: +VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET applies the new offloads configuration. + +u64 value passed as command data is a bitmask, bits set define +offloads to be enabled, bits cleared - offloads to be disabled. + +There is a corresponding device feature for each offload. Upon feature +negotiation corresponding offload gets enabled to preserve backward +compartibility. + +Corresponding feature must be negotiated at startup in order to allow dynamic +change of specific offload state. + + 2.5.2 Block Device ================== -- cgit v1.2.3