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

[Xen-changelog] [xen-unstable] [NET] front: Allow driver to be built against kernels which do not



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID cbdc98fc3a6fbb48d5fe0c293f34cee5e7089c19
# Parent  8d5e6a78d51e1254ce36d86e5d800b37cc5c65f3
[NET] front: Allow driver to be built against kernels which do not
have extended checksum-offload info fields in teh skbuff structure.
Based on a patch from Steven Smith <ssmith@xxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff -r 8d5e6a78d51e -r cbdc98fc3a6f 
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Thu Aug 17 
16:57:43 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Thu Aug 17 
17:08:19 2006 +0100
@@ -900,8 +900,10 @@ static int network_start_xmit(struct sk_
 
        if (skb->ip_summed == CHECKSUM_HW) /* local packet? */
                tx->flags |= NETTXF_csum_blank | NETTXF_data_validated;
+#ifdef CONFIG_XEN
        if (skb->proto_data_valid) /* remote but checksummed? */
                tx->flags |= NETTXF_data_validated;
+#endif
 
 #ifdef HAVE_GSO
        if (skb_shinfo(skb)->gso_size) {
@@ -1312,15 +1314,14 @@ err:
                 * 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)) {
+               if (rx->flags & (NETRXF_data_validated|NETRXF_csum_blank))
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
-                       skb->proto_data_valid = 1;
-               } else {
+               else
                        skb->ip_summed = CHECKSUM_NONE;
-                       skb->proto_data_valid = 0;
-               }
+#ifdef CONFIG_XEN
+               skb->proto_data_valid = (skb->ip_summed != CHECKSUM_NONE);
                skb->proto_csum_blank = !!(rx->flags & NETRXF_csum_blank);
-
+#endif
                np->stats.rx_packets++;
                np->stats.rx_bytes += skb->len;
 

_______________________________________________
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®.