diff options
author | Li RongQing <roy.qing.li@gmail.com> | 2013-06-03 22:11:16 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-05 00:37:59 (GMT) |
commit | 15dd16c233b6d5ceea3a00f18d7c42902d0ac6b6 (patch) | |
tree | ff130afebb3c4023eccfed777fc8913164482119 /drivers/net/ethernet/chelsio/cxgb4/sge.c | |
parent | 00f97da17a0c8d656d0c9a60b1d7f38735f69817 (diff) | |
download | linux-15dd16c233b6d5ceea3a00f18d7c42902d0ac6b6.tar.xz |
cxgb3: Correct comparisons and calculations using skb->tail and skb-transport_header
This corrects an regression introduced by "net: Use 16bits for *_headers
fields of struct skbuff" when NET_SKBUFF_DATA_USES_OFFSET is not set. In
that case skb->tail will be a pointer whereas skb->transport_header
will be an offset from head. This is corrected by using wrappers that
ensure that comparisons and calculations are always made using pointers.
Cc: Simon Horman <horms@verge.net.au>
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4/sge.c')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/sge.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c index 2bfbb20..ac311f5 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c @@ -1294,7 +1294,7 @@ static inline unsigned int calc_tx_flits_ofld(const struct sk_buff *skb) flits = skb_transport_offset(skb) / 8U; /* headers */ cnt = skb_shinfo(skb)->nr_frags; - if (skb->tail != skb->transport_header) + if (skb_tail_pointer(skb) != skb_transport_header(skb)) cnt++; return flits + sgl_len(cnt); } |