WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Log error in csum dev_queue_xmit error path

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Log error in csum dev_queue_xmit error path
From: Jon Mason <jdmason@xxxxxxxxxx>
Date: Thu, 1 Dec 2005 13:40:04 -0600
Delivery-date: Thu, 01 Dec 2005 19:40:29 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.11
While working bug #143, it came to my attention that no verbose error is
loged if the dom0 kernel mangles a packet and tries to checksum
offload it.  

This should let the user know what is going wrong (instead of silently
dropping the packet). 

Signed-off-by: Jon Mason <jdmason@xxxxxxxxxx>

# HG changeset patch
# User root@xxxxxxxxxxxxxxxxxxxxxxxxxx
# Node ID 6e8be095dd8406da697b3956ba65ed724e55e50f
# Parent  f5b119533cc825726c9ecaa3bd2650b38033d4d8
Log an error if dom0 dev_queue_xmit receives a packet to be checksummed
that is not TCP/UDP.  Since we can only offload TCP/UDP checksums,
this error path should be entered.  If this is the case, domU checksum
offload needs to be diabled.

diff -r f5b119533cc8 -r 6e8be095dd84 linux-2.6-xen-sparse/net/core/dev.c
--- a/linux-2.6-xen-sparse/net/core/dev.c       Thu Dec  1 14:22:22 2005
+++ b/linux-2.6-xen-sparse/net/core/dev.c       Thu Dec  1 19:29:00 2005
@@ -1283,6 +1283,11 @@
                        skb->csum = offsetof(struct udphdr, check);
                        break;
                default:
+                       if (net_ratelimit())
+                               printk(KERN_ERR "Attempting to checksum a "
+                                      "non-TCP/UDP packet, dropping a protocol"
+                                      " %d packet", skb->nh.iph->protocol);
+                       rc = -EPROTO;
                        goto out_kfree_skb;
                }
                if ((skb->h.raw + skb->csum + 2) > skb->tail)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Log error in csum dev_queue_xmit error path, Jon Mason <=