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-changelog

[Xen-changelog] Fix checksum-offload problems introduced in c/s 9514, du

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix checksum-offload problems introduced in c/s 9514, due to
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 05 Apr 2006 12:16:07 +0000
Delivery-date: Wed, 05 Apr 2006 05:20:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 806d042527619a985d69d57d93e670a4e150eb44
# Parent  5baf152d63ef7e009818b0d65c46dfbe21bb6e9c
Fix checksum-offload problems introduced in c/s 9514, due to
data_validated flag not being properly specified on the
device channel.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 5baf152d63ef -r 806d04252761 
linux-2.6-xen-sparse/drivers/xen/netback/netback.c
--- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c        Tue Apr  4 
14:20:12 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c        Wed Apr  5 
09:37:37 2006
@@ -329,9 +329,9 @@
                irq = netif->irq;
                id = RING_GET_REQUEST(&netif->rx, netif->rx.rsp_prod_pvt)->id;
                flags = 0;
-               if (skb->ip_summed == CHECKSUM_HW)
-                       flags |= NETRXF_csum_blank;
-               if (skb->proto_data_valid)
+               if (skb->ip_summed == CHECKSUM_HW) /* local packet? */
+                       flags |= NETRXF_csum_blank | NETRXF_data_validated;
+               else if (skb->proto_data_valid) /* remote but checksummed? */
                        flags |= NETRXF_data_validated;
                if (make_rx_response(netif, id, status,
                                     (unsigned long)skb->data & ~PAGE_MASK,
@@ -658,7 +658,11 @@
                skb->dev      = netif->dev;
                skb->protocol = eth_type_trans(skb, skb->dev);
 
-               if (txreq.flags & NETTXF_data_validated) {
+               /*
+                * Old frontends do not assert data_validated but we
+                * can infer it from csum_blank so test both flags.
+                */
+               if (txreq.flags & (NETTXF_data_validated|NETTXF_csum_blank)) {
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
                        skb->proto_data_valid = 1;
                } else {
diff -r 5baf152d63ef -r 806d04252761 
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Tue Apr  4 
14:20:12 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Wed Apr  5 
09:37:37 2006
@@ -698,9 +698,9 @@
        tx->size = skb->len;
 
        tx->flags = 0;
-       if (skb->ip_summed == CHECKSUM_HW)
-               tx->flags |= NETTXF_csum_blank;
-       if (skb->proto_data_valid)
+       if (skb->ip_summed == CHECKSUM_HW) /* local packet? */
+               tx->flags |= NETTXF_csum_blank | NETTXF_data_validated;
+       if (skb->proto_data_valid) /* remote but checksummed? */
                tx->flags |= NETTXF_data_validated;
 
        np->tx.req_prod_pvt = i + 1;
@@ -816,7 +816,11 @@
                skb->len  = rx->status;
                skb->tail = skb->data + skb->len;
 
-               if (rx->flags & NETRXF_data_validated) {
+               /*
+                * Old backends do not assert data_validated but we
+                * can infer it from csum_blank so test both flags.
+                */
+               if (rx->flags & (NETRXF_data_validated|NETRXF_csum_blank)) {
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
                        skb->proto_data_valid = 1;
                } else {
@@ -1017,8 +1021,11 @@
                tx->gref = np->grant_tx_ref[i];
                tx->offset = (unsigned long)skb->data & ~PAGE_MASK;
                tx->size = skb->len;
-               tx->flags = (skb->ip_summed == CHECKSUM_HW) ?
-                       NETTXF_csum_blank : 0;
+               tx->flags = 0;
+               if (skb->ip_summed == CHECKSUM_HW) /* local packet? */
+                       tx->flags |= NETTXF_csum_blank | NETTXF_data_validated;
+               if (skb->proto_data_valid) /* remote but checksummed? */
+                       tx->flags |= NETTXF_data_validated;
 
                np->stats.tx_bytes += skb->len;
                np->stats.tx_packets++;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix checksum-offload problems introduced in c/s 9514, due to, Xen patchbot -unstable <=