From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark McLoughlin Subject: [PATCH 2/3] Fix partial csum tx handling Date: Tue, 27 May 2008 12:36:07 +0100 Message-ID: <1211888168-3814-3-git-send-email-markmc@redhat.com> References: <1211888168-3814-1-git-send-email-markmc@redhat.com> <1211888168-3814-2-git-send-email-markmc@redhat.com> Cc: Mark McLoughlin , Herbert Xu To: kvm@vger.kernel.org Return-path: Received: from mail14.svc.cra.dublin.eircom.net ([159.134.118.30]:42763 "HELO mail14.svc.cra.dublin.eircom.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1756809AbYE0LgM (ORCPT ); Tue, 27 May 2008 07:36:12 -0400 In-Reply-To: <1211888168-3814-2-git-send-email-markmc@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Older kernels didn't have the csum_start/csum_offset skb members, but skb->csum did contain the offset into the transport header of the csum field and csum->h contained a pointer to the transport layer header. Signed-off-by: Mark McLoughlin Cc: Herbert Xu --- hack-module.awk | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/hack-module.awk b/hack-module.awk index b687951..d04c3b6 100644 --- a/hack-module.awk +++ b/hack-module.awk @@ -124,10 +124,17 @@ /ip_summed == CHECKSUM_PARTIAL\)/ { print "#ifdef COMPAT_csum_offset"; - print "\thdr->flags = 0;" - print "\thdr->csum_offset = hdr->csum_start = 0;" + print "\tif (skb->ip_summed == CHECKSUM_HW) {" print "#else" - need_endif_indent_brace = 1; + need_endif = 1; +} + +/hdr->csum_start = skb->csum_start/ { + print "#ifdef COMPAT_csum_offset"; + print "\t\thdr->csum_start = skb->h.raw - skb->data;"; + print "\t\thdr->csum_offset = skb->csum;"; + print "#else" + need_endif = 1; } /skb_transport_header/ { -- 1.5.5.1