From cfd3af1a6a313b24e6407ca6ef55533521aa2f57 Mon Sep 17 00:00:00 2001 From: Xiao Wang Date: Fri, 10 Aug 2012 09:03:42 -0300 Subject: [RHEL6 qemu-kvm PATCH 2/9] e1000: Fix multi-descriptor packet checksum offload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RH-Author: Xiao Wang Message-id: <1344589429-3229-3-git-send-email-jasowang@redhat.com> Patchwork-id: 40678 O-Subject: [RHEL6.4 qemu-kvm 2/9] e1000: Fix multi-descriptor packet checksum offload Bugzilla: 607510 819915 RH-Acked-by: Michael S. Tsirkin RH-Acked-by: Alex Williamson RH-Acked-by: Vlad Yasevich From: Stefan Hajnoczi Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=819915 The PCI/PCI-X Family of Gigabit Ethernet Controllers Software Developer’s Manual states the following about the POPTS field: Provides a number of options which control the handling of this packet. This field is ignored except on the first data descriptor of a packet. The current implementation always loads the field and its checksum offload flags. This patch uses only the first descriptor's POPTS field in order to comply with the specification. When Solaris sends multi-descriptor packets it fills in POPTS for the first descriptor only. Therefore this patch is necessary in order to perform checksum offload correctly for multi-descriptor packets. Reported-by: Daniel Pecka Reported-by: Gabriele A. Trombetti Signed-off-by: Stefan Hajnoczi Signed-off-by: Aurelien Jarno (cherry picked from commit 735e77ecb14355df35c9dbb727f3bc76d730b651) --- hw/e1000.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) Signed-off-by: Eduardo Habkost --- hw/e1000.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/e1000.c b/hw/e1000.c index b7be9a2..25f753b 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -444,7 +444,9 @@ process_tx_desc(E1000State *s, struct e1000_tx_desc *dp) return; } else if (dtype == (E1000_TXD_CMD_DEXT | E1000_TXD_DTYP_D)) { // data descriptor - tp->sum_needed = le32_to_cpu(dp->upper.data) >> 8; + if (tp->size == 0) { + tp->sum_needed = le32_to_cpu(dp->upper.data) >> 8; + } tp->cptse = ( txd_lower & E1000_TXD_CMD_TSE ) ? 1 : 0; } else // legacy descriptor -- 1.7.11.2