aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/alteon
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-10-18 17:00:24 -0400
committerDavid S. Miller <davem@davemloft.net>2011-10-19 03:10:46 -0400
commit9e903e085262ffbf1fc44a17ac06058aca03524a (patch)
tree4acefc97ba38c1733474d25c0b2053b56af97db1 /drivers/net/ethernet/alteon
parentdd767856a36e00b631d65ebc4bb81b19915532d6 (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/alteon')
-rw-r--r--drivers/net/ethernet/alteon/acenic.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/ethernet/alteon/acenic.c b/drivers/net/ethernet/alteon/acenic.c
index b1a4e8204437..f872748ab4e6 100644
--- a/drivers/net/ethernet/alteon/acenic.c
+++ b/drivers/net/ethernet/alteon/acenic.c
@@ -2478,18 +2478,18 @@ restart:
2478 idx = (idx + 1) % ACE_TX_RING_ENTRIES(ap); 2478 idx = (idx + 1) % ACE_TX_RING_ENTRIES(ap);
2479 2479
2480 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 2480 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
2481 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 2481 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
2482 struct tx_ring_info *info; 2482 struct tx_ring_info *info;
2483 2483
2484 len += frag->size; 2484 len += skb_frag_size(frag);
2485 info = ap->skb->tx_skbuff + idx; 2485 info = ap->skb->tx_skbuff + idx;
2486 desc = ap->tx_ring + idx; 2486 desc = ap->tx_ring + idx;
2487 2487
2488 mapping = skb_frag_dma_map(&ap->pdev->dev, frag, 0, 2488 mapping = skb_frag_dma_map(&ap->pdev->dev, frag, 0,
2489 frag->size, 2489 skb_frag_size(frag),
2490 DMA_TO_DEVICE); 2490 DMA_TO_DEVICE);
2491 2491
2492 flagsize = (frag->size << 16); 2492 flagsize = skb_frag_size(frag) << 16;
2493 if (skb->ip_summed == CHECKSUM_PARTIAL) 2493 if (skb->ip_summed == CHECKSUM_PARTIAL)
2494 flagsize |= BD_FLG_TCP_UDP_SUM; 2494 flagsize |= BD_FLG_TCP_UDP_SUM;
2495 idx = (idx + 1) % ACE_TX_RING_ENTRIES(ap); 2495 idx = (idx + 1) % ACE_TX_RING_ENTRIES(ap);
@@ -2508,7 +2508,7 @@ restart:
2508 info->skb = NULL; 2508 info->skb = NULL;
2509 } 2509 }
2510 dma_unmap_addr_set(info, mapping, mapping); 2510 dma_unmap_addr_set(info, mapping, mapping);
2511 dma_unmap_len_set(info, maplen, frag->size); 2511 dma_unmap_len_set(info, maplen, skb_frag_size(frag));
2512 ace_load_tx_bd(ap, desc, mapping, flagsize, vlan_tag); 2512 ace_load_tx_bd(ap, desc, mapping, flagsize, vlan_tag);
2513 } 2513 }
2514 } 2514 }