diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-10-18 17:00:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-10-19 03:10:46 -0400 |
commit | 9e903e085262ffbf1fc44a17ac06058aca03524a (patch) | |
tree | 4acefc97ba38c1733474d25c0b2053b56af97db1 /drivers/net/ethernet/sun/niu.c | |
parent | dd767856a36e00b631d65ebc4bb81b19915532d6 (diff) |
net: add skb frag size accessors
To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.
Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sun/niu.c')
-rw-r--r-- | drivers/net/ethernet/sun/niu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index 23740e848ac9..73c708107a37 100644 --- a/drivers/net/ethernet/sun/niu.c +++ b/drivers/net/ethernet/sun/niu.c | |||
@@ -3594,7 +3594,7 @@ static int release_tx_packet(struct niu *np, struct tx_ring_info *rp, int idx) | |||
3594 | tb = &rp->tx_buffs[idx]; | 3594 | tb = &rp->tx_buffs[idx]; |
3595 | BUG_ON(tb->skb != NULL); | 3595 | BUG_ON(tb->skb != NULL); |
3596 | np->ops->unmap_page(np->device, tb->mapping, | 3596 | np->ops->unmap_page(np->device, tb->mapping, |
3597 | skb_shinfo(skb)->frags[i].size, | 3597 | skb_frag_size(&skb_shinfo(skb)->frags[i]), |
3598 | DMA_TO_DEVICE); | 3598 | DMA_TO_DEVICE); |
3599 | idx = NEXT_TX(rp, idx); | 3599 | idx = NEXT_TX(rp, idx); |
3600 | } | 3600 | } |
@@ -6727,9 +6727,9 @@ static netdev_tx_t niu_start_xmit(struct sk_buff *skb, | |||
6727 | } | 6727 | } |
6728 | 6728 | ||
6729 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { | 6729 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { |
6730 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; | 6730 | const skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; |
6731 | 6731 | ||
6732 | len = frag->size; | 6732 | len = skb_frag_size(frag); |
6733 | mapping = np->ops->map_page(np->device, skb_frag_page(frag), | 6733 | mapping = np->ops->map_page(np->device, skb_frag_page(frag), |
6734 | frag->page_offset, len, | 6734 | frag->page_offset, len, |
6735 | DMA_TO_DEVICE); | 6735 | DMA_TO_DEVICE); |