From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=44200 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwHWZ-0005gv-Fp for qemu-devel@nongnu.org; Sun, 06 Mar 2011 12:13:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwHWY-0006Jg-49 for qemu-devel@nongnu.org; Sun, 06 Mar 2011 12:13:43 -0500 Received: from mtagate5.uk.ibm.com ([194.196.100.165]:34047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwHWX-0006JW-TA for qemu-devel@nongnu.org; Sun, 06 Mar 2011 12:13:42 -0500 Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate5.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p26HDb8S011202 for ; Sun, 6 Mar 2011 17:13:37 GMT Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p26HDoTs1859698 for ; Sun, 6 Mar 2011 17:13:50 GMT Received: from d06av11.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p26HDa9S014216 for ; Sun, 6 Mar 2011 10:13:37 -0700 From: Stefan Hajnoczi Date: Sun, 6 Mar 2011 17:13:07 +0000 Message-Id: <1299431587-4620-1-git-send-email-stefanha@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] e1000: Fix multi-descriptor packet checksum offload List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alex Williamson , Bug 638955 <638955@bugs.launchpad.net>, Stefan Hajnoczi , "Michael S. Tsirkin" The PCI/PCI-X Family of Gigabit Ethernet Controllers Software Developer=E2=80=99s 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: geppz Signed-off-by: Stefan Hajnoczi --- hw/e1000.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/hw/e1000.c b/hw/e1000.c index 0a4574c..2a4d5c7 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -446,7 +446,9 @@ process_tx_desc(E1000State *s, struct e1000_tx_desc *= dp) return; } else if (dtype =3D=3D (E1000_TXD_CMD_DEXT | E1000_TXD_DTYP_D)) { // data descriptor - tp->sum_needed =3D le32_to_cpu(dp->upper.data) >> 8; + if (tp->size =3D=3D 0) { + tp->sum_needed =3D le32_to_cpu(dp->upper.data) >> 8; + } tp->cptse =3D ( txd_lower & E1000_TXD_CMD_TSE ) ? 1 : 0; } else { // legacy descriptor --=20 1.7.2.3