From fb5961953801ed9bee22baf4a006978d3314f76b Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 21 Feb 2008 10:22:27 +0000 Subject: [PATCH] Solarflare: use simplifying header-offset macros where possible Signed-off-by: Jan Beulich --- drivers/xen/sfc_netfront/accel_tso.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/xen/sfc_netfront/accel_tso.c b/drivers/xen/sfc_netfront/accel_tso.c index 56206101..b07f2d8e 100644 --- a/drivers/xen/sfc_netfront/accel_tso.c +++ b/drivers/xen/sfc_netfront/accel_tso.c @@ -115,7 +115,7 @@ static inline void tso_check_safe(struct sk_buff *skb) { 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 netfront_accel_tso_state *st, * 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; -- 2.39.5