[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



# 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.