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] linux: use simplifying macros in Solarflare netfront

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux: use simplifying macros in Solarflare netfront where possible
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Thu, 21 Feb 2008 09:03:40 +0000
Delivery-date: Thu, 21 Feb 2008 01:03:46 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Using the header offset macros where possible simplifies forward
porting to 2.6.22+.

As usual, written and tested on 2.6.24.1 and made apply to the 2.6.18
tree without further testing.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: head-2008-02-20/drivers/xen/sfc_netfront/accel_tso.c
===================================================================
--- head-2008-02-20.orig/drivers/xen/sfc_netfront/accel_tso.c   2008-02-20 
14:46:49.000000000 +0100
+++ head-2008-02-20/drivers/xen/sfc_netfront/accel_tso.c        2008-02-20 
14:52:57.000000000 +0100
@@ -115,7 +115,7 @@ struct netfront_accel_tso_state {
        EPRINTK_ON(skb->protocol != htons (ETH_P_IP));
        EPRINTK_ON(((struct ethhdr*) skb->data)->h_proto != htons (ETH_P_IP));
        EPRINTK_ON(skb->nh.iph->protocol != IPPROTO_TCP);
-       EPRINTK_ON((PTR_DIFF(skb->h.th, skb->data)
+       EPRINTK_ON((SKB_TCP_OFF(skb)
                    + (skb->h.th->doff << 2u)) > skb_headlen(skb));
 }
 
@@ -129,8 +127,7 @@ static inline void tso_start(struct netf
         * All ethernet/IP/TCP headers combined size is TCP header size
         * plus offset of TCP header relative to start of packet.
         */
-       st->p.header_length = ((skb->h.th->doff << 2u)
-                              + PTR_DIFF(skb->h.th, skb->data));
+       st->p.header_length = (skb->h.th->doff << 2u) + SKB_TCP_OFF(skb);
        st->p.full_packet_size = (st->p.header_length
                                  + skb_shinfo(skb)->gso_size);
        st->p.gso_size = skb_shinfo(skb)->gso_size;




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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux: use simplifying macros in Solarflare netfront where possible, Jan Beulich <=