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

[Xen-changelog] [linux-2.6.18-xen] Solarflare: use simplifying header-offset macros where possible



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1203589347 0
# Node ID 5069c4f9481242082c52e58e1828c1a5a4bb9a65
# Parent  fc44fda2c68a9dc057e98dafdfe6eece417c106c
Solarflare: use simplifying header-offset macros where possible
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 drivers/xen/sfc_netfront/accel_tso.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff -r fc44fda2c68a -r 5069c4f94812 drivers/xen/sfc_netfront/accel_tso.c
--- a/drivers/xen/sfc_netfront/accel_tso.c      Thu Feb 21 10:21:34 2008 +0000
+++ b/drivers/xen/sfc_netfront/accel_tso.c      Thu Feb 21 10:22:27 2008 +0000
@@ -115,7 +115,7 @@ static inline void tso_check_safe(struct
        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 +129,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-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®.