aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/atm/eni.c2
-rw-r--r--drivers/infiniband/hw/amso1100/c2.c4
-rw-r--r--drivers/infiniband/hw/nes/nes_nic.c10
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_cm.c2
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_ib.c18
-rw-r--r--drivers/net/ethernet/3com/3c59x.c6
-rw-r--r--drivers/net/ethernet/3com/typhoon.c6
-rw-r--r--drivers/net/ethernet/adaptec/starfire.c8
-rw-r--r--drivers/net/ethernet/aeroflex/greth.c8
-rw-r--r--drivers/net/ethernet/alteon/acenic.c10
-rw-r--r--drivers/net/ethernet/atheros/atl1c/atl1c_main.c2
-rw-r--r--drivers/net/ethernet/atheros/atl1e/atl1e_main.c6
-rw-r--r--drivers/net/ethernet/atheros/atlx/atl1.c12
-rw-r--r--drivers/net/ethernet/broadcom/bnx2.c12
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c14
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c8
-rw-r--r--drivers/net/ethernet/brocade/bna/bnad.c6
-rw-r--r--drivers/net/ethernet/chelsio/cxgb/sge.c10
-rw-r--r--drivers/net/ethernet/chelsio/cxgb3/sge.c12
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/sge.c26
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4vf/sge.c26
-rw-r--r--drivers/net/ethernet/cisco/enic/enic_main.c12
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c18
-rw-r--r--drivers/net/ethernet/ibm/ehea/ehea_main.c4
-rw-r--r--drivers/net/ethernet/ibm/emac/core.c2
-rw-r--r--drivers/net/ethernet/ibm/ibmveth.c6
-rw-r--r--drivers/net/ethernet/intel/e1000/e1000_main.c6
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c6
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c2
-rw-r--r--drivers/net/ethernet/intel/igbvf/netdev.c4
-rw-r--r--drivers/net/ethernet/intel/ixgb/ixgb_main.c4
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c4
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c6
-rw-r--r--drivers/net/ethernet/jme.c4
-rw-r--r--drivers/net/ethernet/marvell/mv643xx_eth.c9
-rw-r--r--drivers/net/ethernet/marvell/skge.c8
-rw-r--r--drivers/net/ethernet/marvell/sky2.c16
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_rx.c14
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_tx.c12
-rw-r--r--drivers/net/ethernet/micrel/ksz884x.c2
-rw-r--r--drivers/net/ethernet/myricom/myri10ge/myri10ge.c14
-rw-r--r--drivers/net/ethernet/natsemi/ns83820.c4
-rw-r--r--drivers/net/ethernet/neterion/s2io.c12
-rw-r--r--drivers/net/ethernet/neterion/vxge/vxge-main.c12
-rw-r--r--drivers/net/ethernet/nvidia/forcedeth.c18
-rw-r--r--drivers/net/ethernet/pasemi/pasemi_mac.c8
-rw-r--r--drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c6
-rw-r--r--drivers/net/ethernet/qlogic/qla3xxx.c6
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c6
-rw-r--r--drivers/net/ethernet/qlogic/qlge/qlge_main.c6
-rw-r--r--drivers/net/ethernet/realtek/8139cp.c4
-rw-r--r--drivers/net/ethernet/realtek/r8169.c4
-rw-r--r--drivers/net/ethernet/sfc/rx.c2
-rw-r--r--drivers/net/ethernet/sfc/tx.c8
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c4
-rw-r--r--drivers/net/ethernet/sun/cassini.c8
-rw-r--r--drivers/net/ethernet/sun/niu.c6
-rw-r--r--drivers/net/ethernet/sun/sungem.c4
-rw-r--r--drivers/net/ethernet/sun/sunhme.c4
-rw-r--r--drivers/net/ethernet/tehuti/tehuti.c6
-rw-r--r--drivers/net/ethernet/tile/tilepro.c2
-rw-r--r--drivers/net/ethernet/tundra/tsi108_eth.c6
-rw-r--r--drivers/net/ethernet/via/via-velocity.c6
-rw-r--r--drivers/net/ethernet/xilinx/ll_temac_main.c4
-rw-r--r--drivers/net/virtio_net.c8
-rw-r--r--drivers/net/vmxnet3/vmxnet3_drv.c12
-rw-r--r--drivers/net/xen-netback/netback.c4
-rw-r--r--drivers/net/xen-netfront.c4
-rw-r--r--drivers/scsi/cxgbi/libcxgbi.c10
-rw-r--r--drivers/scsi/fcoe/fcoe_transport.c2
-rw-r--r--drivers/staging/hv/netvsc_drv.c4
-rw-r--r--include/linux/skbuff.h28
-rw-r--r--net/appletalk/ddp.c5
-rw-r--r--net/core/datagram.c16
-rw-r--r--net/core/dev.c6
-rw-r--r--net/core/pktgen.c12
-rw-r--r--net/core/skbuff.c72
-rw-r--r--net/core/user_dma.c4
-rw-r--r--net/ipv4/inet_lro.c8
-rw-r--r--net/ipv4/ip_fragment.c4
-rw-r--r--net/ipv4/ip_output.c6
-rw-r--r--net/ipv4/tcp.c9
-rw-r--r--net/ipv4/tcp_output.c8
-rw-r--r--net/ipv6/ip6_output.c5
-rw-r--r--net/ipv6/netfilter/nf_conntrack_reasm.c4
-rw-r--r--net/ipv6/reassembly.c4
-rw-r--r--net/xfrm/xfrm_ipcomp.c2
87 files changed, 387 insertions, 357 deletions
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
index f7ca4c13d61d..956e9accb051 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -1136,7 +1136,7 @@ DPRINTK("doing direct send\n"); /* @@@ well, this doesn't work anyway */
1136 put_dma(tx->index,eni_dev->dma,&j,(unsigned long) 1136 put_dma(tx->index,eni_dev->dma,&j,(unsigned long)
1137 skb_frag_page(&skb_shinfo(skb)->frags[i]) + 1137 skb_frag_page(&skb_shinfo(skb)->frags[i]) +
1138 skb_shinfo(skb)->frags[i].page_offset, 1138 skb_shinfo(skb)->frags[i].page_offset,
1139 skb_shinfo(skb)->frags[i].size); 1139 skb_frag_size(&skb_shinfo(skb)->frags[i]));
1140 } 1140 }
1141 if (skb->len & 3) 1141 if (skb->len & 3)
1142 put_dma(tx->index,eni_dev->dma,&j,zeroes,4-(skb->len & 3)); 1142 put_dma(tx->index,eni_dev->dma,&j,zeroes,4-(skb->len & 3));
diff --git a/drivers/infiniband/hw/amso1100/c2.c b/drivers/infiniband/hw/amso1100/c2.c
index 6e85a75289e8..5ce7b9e8bff6 100644
--- a/drivers/infiniband/hw/amso1100/c2.c
+++ b/drivers/infiniband/hw/amso1100/c2.c
@@ -800,8 +800,8 @@ static int c2_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
800 /* Loop thru additional data fragments and queue them */ 800 /* Loop thru additional data fragments and queue them */
801 if (skb_shinfo(skb)->nr_frags) { 801 if (skb_shinfo(skb)->nr_frags) {
802 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 802 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
803 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 803 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
804 maplen = frag->size; 804 maplen = skb_frag_size(frag);
805 mapaddr = skb_frag_dma_map(&c2dev->pcidev->dev, frag, 805 mapaddr = skb_frag_dma_map(&c2dev->pcidev->dev, frag,
806 0, maplen, DMA_TO_DEVICE); 806 0, maplen, DMA_TO_DEVICE);
807 elem = elem->next; 807 elem = elem->next;
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index 7cb7f292dfd1..47b2ee4c01e2 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -444,10 +444,10 @@ static int nes_nic_send(struct sk_buff *skb, struct net_device *netdev)
444 skb_frag_t *frag = 444 skb_frag_t *frag =
445 &skb_shinfo(skb)->frags[skb_fragment_index]; 445 &skb_shinfo(skb)->frags[skb_fragment_index];
446 bus_address = skb_frag_dma_map(&nesdev->pcidev->dev, 446 bus_address = skb_frag_dma_map(&nesdev->pcidev->dev,
447 frag, 0, frag->size, 447 frag, 0, skb_frag_size(frag),
448 DMA_TO_DEVICE); 448 DMA_TO_DEVICE);
449 wqe_fragment_length[wqe_fragment_index] = 449 wqe_fragment_length[wqe_fragment_index] =
450 cpu_to_le16(skb_shinfo(skb)->frags[skb_fragment_index].size); 450 cpu_to_le16(skb_frag_size(&skb_shinfo(skb)->frags[skb_fragment_index]));
451 set_wqe_64bit_value(nic_sqe->wqe_words, NES_NIC_SQ_WQE_FRAG0_LOW_IDX+(2*wqe_fragment_index), 451 set_wqe_64bit_value(nic_sqe->wqe_words, NES_NIC_SQ_WQE_FRAG0_LOW_IDX+(2*wqe_fragment_index),
452 bus_address); 452 bus_address);
453 wqe_fragment_index++; 453 wqe_fragment_index++;
@@ -565,7 +565,7 @@ tso_sq_no_longer_full:
565 &skb_shinfo(skb)->frags[tso_frag_count]; 565 &skb_shinfo(skb)->frags[tso_frag_count];
566 tso_bus_address[tso_frag_count] = 566 tso_bus_address[tso_frag_count] =
567 skb_frag_dma_map(&nesdev->pcidev->dev, 567 skb_frag_dma_map(&nesdev->pcidev->dev,
568 frag, 0, frag->size, 568 frag, 0, skb_frag_size(frag),
569 DMA_TO_DEVICE); 569 DMA_TO_DEVICE);
570 } 570 }
571 571
@@ -637,11 +637,11 @@ tso_sq_no_longer_full:
637 } 637 }
638 while (wqe_fragment_index < 5) { 638 while (wqe_fragment_index < 5) {
639 wqe_fragment_length[wqe_fragment_index] = 639 wqe_fragment_length[wqe_fragment_index] =
640 cpu_to_le16(skb_shinfo(skb)->frags[tso_frag_index].size); 640 cpu_to_le16(skb_frag_size(&skb_shinfo(skb)->frags[tso_frag_index]));
641 set_wqe_64bit_value(nic_sqe->wqe_words, NES_NIC_SQ_WQE_FRAG0_LOW_IDX+(2*wqe_fragment_index), 641 set_wqe_64bit_value(nic_sqe->wqe_words, NES_NIC_SQ_WQE_FRAG0_LOW_IDX+(2*wqe_fragment_index),
642 (u64)tso_bus_address[tso_frag_index]); 642 (u64)tso_bus_address[tso_frag_index]);
643 wqe_fragment_index++; 643 wqe_fragment_index++;
644 tso_wqe_length += skb_shinfo(skb)->frags[tso_frag_index++].size; 644 tso_wqe_length += skb_frag_size(&skb_shinfo(skb)->frags[tso_frag_index++]);
645 if (wqe_fragment_index < 5) 645 if (wqe_fragment_index < 5)
646 wqe_fragment_length[wqe_fragment_index] = 0; 646 wqe_fragment_length[wqe_fragment_index] = 0;
647 if (tso_frag_index == tso_frag_count) 647 if (tso_frag_index == tso_frag_count)
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 67a477be237e..c74548a586ea 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -543,7 +543,7 @@ static void skb_put_frags(struct sk_buff *skb, unsigned int hdr_space,
543 } else { 543 } else {
544 size = min(length, (unsigned) PAGE_SIZE); 544 size = min(length, (unsigned) PAGE_SIZE);
545 545
546 frag->size = size; 546 skb_frag_size_set(frag, size);
547 skb->data_len += size; 547 skb->data_len += size;
548 skb->truesize += size; 548 skb->truesize += size;
549 skb->len += size; 549 skb->len += size;
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index 00435be4a44b..2b060f45bec3 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -117,7 +117,7 @@ static void ipoib_ud_skb_put_frags(struct ipoib_dev_priv *priv,
117 117
118 size = length - IPOIB_UD_HEAD_SIZE; 118 size = length - IPOIB_UD_HEAD_SIZE;
119 119
120 frag->size = size; 120 skb_frag_size_set(frag, size);
121 skb->data_len += size; 121 skb->data_len += size;
122 skb->truesize += size; 122 skb->truesize += size;
123 } else 123 } else
@@ -322,10 +322,10 @@ static int ipoib_dma_map_tx(struct ib_device *ca,
322 off = 0; 322 off = 0;
323 323
324 for (i = 0; i < skb_shinfo(skb)->nr_frags; ++i) { 324 for (i = 0; i < skb_shinfo(skb)->nr_frags; ++i) {
325 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 325 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
326 mapping[i + off] = ib_dma_map_page(ca, 326 mapping[i + off] = ib_dma_map_page(ca,
327 skb_frag_page(frag), 327 skb_frag_page(frag),
328 frag->page_offset, frag->size, 328 frag->page_offset, skb_frag_size(frag),
329 DMA_TO_DEVICE); 329 DMA_TO_DEVICE);
330 if (unlikely(ib_dma_mapping_error(ca, mapping[i + off]))) 330 if (unlikely(ib_dma_mapping_error(ca, mapping[i + off])))
331 goto partial_error; 331 goto partial_error;
@@ -334,8 +334,9 @@ static int ipoib_dma_map_tx(struct ib_device *ca,
334 334
335partial_error: 335partial_error:
336 for (; i > 0; --i) { 336 for (; i > 0; --i) {
337 skb_frag_t *frag = &skb_shinfo(skb)->frags[i - 1]; 337 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i - 1];
338 ib_dma_unmap_page(ca, mapping[i - !off], frag->size, DMA_TO_DEVICE); 338
339 ib_dma_unmap_page(ca, mapping[i - !off], skb_frag_size(frag), DMA_TO_DEVICE);
339 } 340 }
340 341
341 if (off) 342 if (off)
@@ -359,8 +360,9 @@ static void ipoib_dma_unmap_tx(struct ib_device *ca,
359 off = 0; 360 off = 0;
360 361
361 for (i = 0; i < skb_shinfo(skb)->nr_frags; ++i) { 362 for (i = 0; i < skb_shinfo(skb)->nr_frags; ++i) {
362 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 363 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
363 ib_dma_unmap_page(ca, mapping[i + off], frag->size, 364
365 ib_dma_unmap_page(ca, mapping[i + off], skb_frag_size(frag),
364 DMA_TO_DEVICE); 366 DMA_TO_DEVICE);
365 } 367 }
366} 368}
@@ -510,7 +512,7 @@ static inline int post_send(struct ipoib_dev_priv *priv,
510 512
511 for (i = 0; i < nr_frags; ++i) { 513 for (i = 0; i < nr_frags; ++i) {
512 priv->tx_sge[i + off].addr = mapping[i + off]; 514 priv->tx_sge[i + off].addr = mapping[i + off];
513 priv->tx_sge[i + off].length = frags[i].size; 515 priv->tx_sge[i + off].length = skb_frag_size(&frags[i]);
514 } 516 }
515 priv->tx_wr.num_sge = nr_frags + off; 517 priv->tx_wr.num_sge = nr_frags + off;
516 priv->tx_wr.wr_id = wr_id; 518 priv->tx_wr.wr_id = wr_id;
diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c
index 9ca45dcba755..b42c06baba89 100644
--- a/drivers/net/ethernet/3com/3c59x.c
+++ b/drivers/net/ethernet/3com/3c59x.c
@@ -2182,12 +2182,12 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev)
2182 cpu_to_le32(pci_map_single( 2182 cpu_to_le32(pci_map_single(
2183 VORTEX_PCI(vp), 2183 VORTEX_PCI(vp),
2184 (void *)skb_frag_address(frag), 2184 (void *)skb_frag_address(frag),
2185 frag->size, PCI_DMA_TODEVICE)); 2185 skb_frag_size(frag), PCI_DMA_TODEVICE));
2186 2186
2187 if (i == skb_shinfo(skb)->nr_frags-1) 2187 if (i == skb_shinfo(skb)->nr_frags-1)
2188 vp->tx_ring[entry].frag[i+1].length = cpu_to_le32(frag->size|LAST_FRAG); 2188 vp->tx_ring[entry].frag[i+1].length = cpu_to_le32(skb_frag_size(frag)|LAST_FRAG);
2189 else 2189 else
2190 vp->tx_ring[entry].frag[i+1].length = cpu_to_le32(frag->size); 2190 vp->tx_ring[entry].frag[i+1].length = cpu_to_le32(skb_frag_size(frag));
2191 } 2191 }
2192 } 2192 }
2193#else 2193#else
diff --git a/drivers/net/ethernet/3com/typhoon.c b/drivers/net/ethernet/3com/typhoon.c
index 11f8858c786d..20ea07508ac7 100644
--- a/drivers/net/ethernet/3com/typhoon.c
+++ b/drivers/net/ethernet/3com/typhoon.c
@@ -810,15 +810,15 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
810 txd->frag.addrHi = 0; 810 txd->frag.addrHi = 0;
811 first_txd->numDesc++; 811 first_txd->numDesc++;
812 812
813 for(i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 813 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
814 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 814 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
815 void *frag_addr; 815 void *frag_addr;
816 816
817 txd = (struct tx_desc *) (txRing->ringBase + 817 txd = (struct tx_desc *) (txRing->ringBase +
818 txRing->lastWrite); 818 txRing->lastWrite);
819 typhoon_inc_tx_index(&txRing->lastWrite, 1); 819 typhoon_inc_tx_index(&txRing->lastWrite, 1);
820 820
821 len = frag->size; 821 len = skb_frag_size(frag);
822 frag_addr = skb_frag_address(frag); 822 frag_addr = skb_frag_address(frag);
823 skb_dma = pci_map_single(tp->tx_pdev, frag_addr, len, 823 skb_dma = pci_map_single(tp->tx_pdev, frag_addr, len,
824 PCI_DMA_TODEVICE); 824 PCI_DMA_TODEVICE);
diff --git a/drivers/net/ethernet/adaptec/starfire.c b/drivers/net/ethernet/adaptec/starfire.c
index d6b015598569..6d9f6911000f 100644
--- a/drivers/net/ethernet/adaptec/starfire.c
+++ b/drivers/net/ethernet/adaptec/starfire.c
@@ -1256,12 +1256,12 @@ static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev)
1256 np->tx_info[entry].mapping = 1256 np->tx_info[entry].mapping =
1257 pci_map_single(np->pci_dev, skb->data, skb_first_frag_len(skb), PCI_DMA_TODEVICE); 1257 pci_map_single(np->pci_dev, skb->data, skb_first_frag_len(skb), PCI_DMA_TODEVICE);
1258 } else { 1258 } else {
1259 skb_frag_t *this_frag = &skb_shinfo(skb)->frags[i - 1]; 1259 const skb_frag_t *this_frag = &skb_shinfo(skb)->frags[i - 1];
1260 status |= this_frag->size; 1260 status |= skb_frag_size(this_frag);
1261 np->tx_info[entry].mapping = 1261 np->tx_info[entry].mapping =
1262 pci_map_single(np->pci_dev, 1262 pci_map_single(np->pci_dev,
1263 skb_frag_address(this_frag), 1263 skb_frag_address(this_frag),
1264 this_frag->size, 1264 skb_frag_size(this_frag),
1265 PCI_DMA_TODEVICE); 1265 PCI_DMA_TODEVICE);
1266 } 1266 }
1267 1267
@@ -1378,7 +1378,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)
1378 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 1378 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
1379 pci_unmap_single(np->pci_dev, 1379 pci_unmap_single(np->pci_dev,
1380 np->tx_info[entry].mapping, 1380 np->tx_info[entry].mapping,
1381 skb_shinfo(skb)->frags[i].size, 1381 skb_frag_size(&skb_shinfo(skb)->frags[i]),
1382 PCI_DMA_TODEVICE); 1382 PCI_DMA_TODEVICE);
1383 np->dirty_tx++; 1383 np->dirty_tx++;
1384 entry++; 1384 entry++;
diff --git a/drivers/net/ethernet/aeroflex/greth.c b/drivers/net/ethernet/aeroflex/greth.c
index 6715bf54f04e..442fefa4f2ca 100644
--- a/drivers/net/ethernet/aeroflex/greth.c
+++ b/drivers/net/ethernet/aeroflex/greth.c
@@ -198,7 +198,7 @@ static void greth_clean_rings(struct greth_private *greth)
198 198
199 dma_unmap_page(greth->dev, 199 dma_unmap_page(greth->dev,
200 greth_read_bd(&tx_bdp->addr), 200 greth_read_bd(&tx_bdp->addr),
201 frag->size, 201 skb_frag_size(frag),
202 DMA_TO_DEVICE); 202 DMA_TO_DEVICE);
203 203
204 greth->tx_last = NEXT_TX(greth->tx_last); 204 greth->tx_last = NEXT_TX(greth->tx_last);
@@ -517,7 +517,7 @@ greth_start_xmit_gbit(struct sk_buff *skb, struct net_device *dev)
517 status = GRETH_BD_EN; 517 status = GRETH_BD_EN;
518 if (skb->ip_summed == CHECKSUM_PARTIAL) 518 if (skb->ip_summed == CHECKSUM_PARTIAL)
519 status |= GRETH_TXBD_CSALL; 519 status |= GRETH_TXBD_CSALL;
520 status |= frag->size & GRETH_BD_LEN; 520 status |= skb_frag_size(frag) & GRETH_BD_LEN;
521 521
522 /* Wrap around descriptor ring */ 522 /* Wrap around descriptor ring */
523 if (curr_tx == GRETH_TXBD_NUM_MASK) 523 if (curr_tx == GRETH_TXBD_NUM_MASK)
@@ -531,7 +531,7 @@ greth_start_xmit_gbit(struct sk_buff *skb, struct net_device *dev)
531 531
532 greth_write_bd(&bdp->stat, status); 532 greth_write_bd(&bdp->stat, status);
533 533
534 dma_addr = skb_frag_dma_map(greth->dev, frag, 0, frag->size, 534 dma_addr = skb_frag_dma_map(greth->dev, frag, 0, skb_frag_size(frag),
535 DMA_TO_DEVICE); 535 DMA_TO_DEVICE);
536 536
537 if (unlikely(dma_mapping_error(greth->dev, dma_addr))) 537 if (unlikely(dma_mapping_error(greth->dev, dma_addr)))
@@ -713,7 +713,7 @@ static void greth_clean_tx_gbit(struct net_device *dev)
713 713
714 dma_unmap_page(greth->dev, 714 dma_unmap_page(greth->dev,
715 greth_read_bd(&bdp->addr), 715 greth_read_bd(&bdp->addr),
716 frag->size, 716 skb_frag_size(frag),
717 DMA_TO_DEVICE); 717 DMA_TO_DEVICE);
718 718
719 greth->tx_last = NEXT_TX(greth->tx_last); 719 greth->tx_last = NEXT_TX(greth->tx_last);
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 }
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
index 12a0b30319db..02c7ed8d9eca 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -2179,7 +2179,7 @@ static void atl1c_tx_map(struct atl1c_adapter *adapter,
2179 memcpy(use_tpd, tpd, sizeof(struct atl1c_tpd_desc)); 2179 memcpy(use_tpd, tpd, sizeof(struct atl1c_tpd_desc));
2180 2180
2181 buffer_info = atl1c_get_tx_buffer(adapter, use_tpd); 2181 buffer_info = atl1c_get_tx_buffer(adapter, use_tpd);
2182 buffer_info->length = frag->size; 2182 buffer_info->length = skb_frag_size(frag);
2183 buffer_info->dma = skb_frag_dma_map(&adapter->pdev->dev, 2183 buffer_info->dma = skb_frag_dma_map(&adapter->pdev->dev,
2184 frag, 0, 2184 frag, 0,
2185 buffer_info->length, 2185 buffer_info->length,
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
index 97c45a4b855a..95483bcac1d0 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
@@ -1593,7 +1593,7 @@ static u16 atl1e_cal_tdp_req(const struct sk_buff *skb)
1593 u16 proto_hdr_len = 0; 1593 u16 proto_hdr_len = 0;
1594 1594
1595 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 1595 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
1596 fg_size = skb_shinfo(skb)->frags[i].size; 1596 fg_size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
1597 tpd_req += ((fg_size + MAX_TX_BUF_LEN - 1) >> MAX_TX_BUF_SHIFT); 1597 tpd_req += ((fg_size + MAX_TX_BUF_LEN - 1) >> MAX_TX_BUF_SHIFT);
1598 } 1598 }
1599 1599
@@ -1744,12 +1744,12 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
1744 } 1744 }
1745 1745
1746 for (f = 0; f < nr_frags; f++) { 1746 for (f = 0; f < nr_frags; f++) {
1747 struct skb_frag_struct *frag; 1747 const struct skb_frag_struct *frag;
1748 u16 i; 1748 u16 i;
1749 u16 seg_num; 1749 u16 seg_num;
1750 1750
1751 frag = &skb_shinfo(skb)->frags[f]; 1751 frag = &skb_shinfo(skb)->frags[f];
1752 buf_len = frag->size; 1752 buf_len = skb_frag_size(frag);
1753 1753
1754 seg_num = (buf_len + MAX_TX_BUF_LEN - 1) / MAX_TX_BUF_LEN; 1754 seg_num = (buf_len + MAX_TX_BUF_LEN - 1) / MAX_TX_BUF_LEN;
1755 for (i = 0; i < seg_num; i++) { 1755 for (i = 0; i < seg_num; i++) {
diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c
index 7381a49fefb4..0405261efb5c 100644
--- a/drivers/net/ethernet/atheros/atlx/atl1.c
+++ b/drivers/net/ethernet/atheros/atlx/atl1.c
@@ -2267,11 +2267,11 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
2267 } 2267 }
2268 2268
2269 for (f = 0; f < nr_frags; f++) { 2269 for (f = 0; f < nr_frags; f++) {
2270 struct skb_frag_struct *frag; 2270 const struct skb_frag_struct *frag;
2271 u16 i, nseg; 2271 u16 i, nseg;
2272 2272
2273 frag = &skb_shinfo(skb)->frags[f]; 2273 frag = &skb_shinfo(skb)->frags[f];
2274 buf_len = frag->size; 2274 buf_len = skb_frag_size(frag);
2275 2275
2276 nseg = (buf_len + ATL1_MAX_TX_BUF_LEN - 1) / 2276 nseg = (buf_len + ATL1_MAX_TX_BUF_LEN - 1) /
2277 ATL1_MAX_TX_BUF_LEN; 2277 ATL1_MAX_TX_BUF_LEN;
@@ -2356,7 +2356,6 @@ static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb,
2356 int count = 1; 2356 int count = 1;
2357 int ret_val; 2357 int ret_val;
2358 struct tx_packet_desc *ptpd; 2358 struct tx_packet_desc *ptpd;
2359 u16 frag_size;
2360 u16 vlan_tag; 2359 u16 vlan_tag;
2361 unsigned int nr_frags = 0; 2360 unsigned int nr_frags = 0;
2362 unsigned int mss = 0; 2361 unsigned int mss = 0;
@@ -2372,10 +2371,9 @@ static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb,
2372 2371
2373 nr_frags = skb_shinfo(skb)->nr_frags; 2372 nr_frags = skb_shinfo(skb)->nr_frags;
2374 for (f = 0; f < nr_frags; f++) { 2373 for (f = 0; f < nr_frags; f++) {
2375 frag_size = skb_shinfo(skb)->frags[f].size; 2374 unsigned int f_size = skb_frag_size(&skb_shinfo(skb)->frags[f]);
2376 if (frag_size) 2375 count += (f_size + ATL1_MAX_TX_BUF_LEN - 1) /
2377 count += (frag_size + ATL1_MAX_TX_BUF_LEN - 1) / 2376 ATL1_MAX_TX_BUF_LEN;
2378 ATL1_MAX_TX_BUF_LEN;
2379 } 2377 }
2380 2378
2381 mss = skb_shinfo(skb)->gso_size; 2379 mss = skb_shinfo(skb)->gso_size;
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c
index 6ff7636e73a2..965c7235804d 100644
--- a/drivers/net/ethernet/broadcom/bnx2.c
+++ b/drivers/net/ethernet/broadcom/bnx2.c
@@ -2871,7 +2871,7 @@ bnx2_tx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget)
2871 dma_unmap_addr( 2871 dma_unmap_addr(
2872 &txr->tx_buf_ring[TX_RING_IDX(sw_cons)], 2872 &txr->tx_buf_ring[TX_RING_IDX(sw_cons)],
2873 mapping), 2873 mapping),
2874 skb_shinfo(skb)->frags[i].size, 2874 skb_frag_size(&skb_shinfo(skb)->frags[i]),
2875 PCI_DMA_TODEVICE); 2875 PCI_DMA_TODEVICE);
2876 } 2876 }
2877 2877
@@ -3049,7 +3049,7 @@ bnx2_rx_skb(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, struct sk_buff *skb,
3049 } else { 3049 } else {
3050 skb_frag_t *frag = 3050 skb_frag_t *frag =
3051 &skb_shinfo(skb)->frags[i - 1]; 3051 &skb_shinfo(skb)->frags[i - 1];
3052 frag->size -= tail; 3052 skb_frag_size_sub(frag, tail);
3053 skb->data_len -= tail; 3053 skb->data_len -= tail;
3054 } 3054 }
3055 return 0; 3055 return 0;
@@ -5395,7 +5395,7 @@ bnx2_free_tx_skbs(struct bnx2 *bp)
5395 tx_buf = &txr->tx_buf_ring[TX_RING_IDX(j)]; 5395 tx_buf = &txr->tx_buf_ring[TX_RING_IDX(j)];
5396 dma_unmap_page(&bp->pdev->dev, 5396 dma_unmap_page(&bp->pdev->dev,
5397 dma_unmap_addr(tx_buf, mapping), 5397 dma_unmap_addr(tx_buf, mapping),
5398 skb_shinfo(skb)->frags[k].size, 5398 skb_frag_size(&skb_shinfo(skb)->frags[k]),
5399 PCI_DMA_TODEVICE); 5399 PCI_DMA_TODEVICE);
5400 } 5400 }
5401 dev_kfree_skb(skb); 5401 dev_kfree_skb(skb);
@@ -6530,13 +6530,13 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
6530 tx_buf->is_gso = skb_is_gso(skb); 6530 tx_buf->is_gso = skb_is_gso(skb);
6531 6531
6532 for (i = 0; i < last_frag; i++) { 6532 for (i = 0; i < last_frag; i++) {
6533 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 6533 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
6534 6534
6535 prod = NEXT_TX_BD(prod); 6535 prod = NEXT_TX_BD(prod);
6536 ring_prod = TX_RING_IDX(prod); 6536 ring_prod = TX_RING_IDX(prod);
6537 txbd = &txr->tx_desc_ring[ring_prod]; 6537 txbd = &txr->tx_desc_ring[ring_prod];
6538 6538
6539 len = frag->size; 6539 len = skb_frag_size(frag);
6540 mapping = skb_frag_dma_map(&bp->pdev->dev, frag, 0, len, 6540 mapping = skb_frag_dma_map(&bp->pdev->dev, frag, 0, len,
6541 DMA_TO_DEVICE); 6541 DMA_TO_DEVICE);
6542 if (dma_mapping_error(&bp->pdev->dev, mapping)) 6542 if (dma_mapping_error(&bp->pdev->dev, mapping))
@@ -6594,7 +6594,7 @@ dma_error:
6594 ring_prod = TX_RING_IDX(prod); 6594 ring_prod = TX_RING_IDX(prod);
6595 tx_buf = &txr->tx_buf_ring[ring_prod]; 6595 tx_buf = &txr->tx_buf_ring[ring_prod];
6596 dma_unmap_page(&bp->pdev->dev, dma_unmap_addr(tx_buf, mapping), 6596 dma_unmap_page(&bp->pdev->dev, dma_unmap_addr(tx_buf, mapping),
6597 skb_shinfo(skb)->frags[i].size, 6597 skb_frag_size(&skb_shinfo(skb)->frags[i]),
6598 PCI_DMA_TODEVICE); 6598 PCI_DMA_TODEVICE);
6599 } 6599 }
6600 6600
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index e575e89c7d46..dd8ee56396b2 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -2363,7 +2363,7 @@ static int bnx2x_pkt_req_lin(struct bnx2x *bp, struct sk_buff *skb,
2363 /* Calculate the first sum - it's special */ 2363 /* Calculate the first sum - it's special */
2364 for (frag_idx = 0; frag_idx < wnd_size - 1; frag_idx++) 2364 for (frag_idx = 0; frag_idx < wnd_size - 1; frag_idx++)
2365 wnd_sum += 2365 wnd_sum +=
2366 skb_shinfo(skb)->frags[frag_idx].size; 2366 skb_frag_size(&skb_shinfo(skb)->frags[frag_idx]);
2367 2367
2368 /* If there was data on linear skb data - check it */ 2368 /* If there was data on linear skb data - check it */
2369 if (first_bd_sz > 0) { 2369 if (first_bd_sz > 0) {
@@ -2379,14 +2379,14 @@ static int bnx2x_pkt_req_lin(struct bnx2x *bp, struct sk_buff *skb,
2379 check all windows */ 2379 check all windows */
2380 for (wnd_idx = 0; wnd_idx <= num_wnds; wnd_idx++) { 2380 for (wnd_idx = 0; wnd_idx <= num_wnds; wnd_idx++) {
2381 wnd_sum += 2381 wnd_sum +=
2382 skb_shinfo(skb)->frags[wnd_idx + wnd_size - 1].size; 2382 skb_frag_size(&skb_shinfo(skb)->frags[wnd_idx + wnd_size - 1]);
2383 2383
2384 if (unlikely(wnd_sum < lso_mss)) { 2384 if (unlikely(wnd_sum < lso_mss)) {
2385 to_copy = 1; 2385 to_copy = 1;
2386 break; 2386 break;
2387 } 2387 }
2388 wnd_sum -= 2388 wnd_sum -=
2389 skb_shinfo(skb)->frags[wnd_idx].size; 2389 skb_frag_size(&skb_shinfo(skb)->frags[wnd_idx]);
2390 } 2390 }
2391 } else { 2391 } else {
2392 /* in non-LSO too fragmented packet should always 2392 /* in non-LSO too fragmented packet should always
@@ -2796,8 +2796,8 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
2796 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 2796 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
2797 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 2797 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
2798 2798
2799 mapping = skb_frag_dma_map(&bp->pdev->dev, frag, 0, frag->size, 2799 mapping = skb_frag_dma_map(&bp->pdev->dev, frag, 0,
2800 DMA_TO_DEVICE); 2800 skb_frag_size(frag), DMA_TO_DEVICE);
2801 if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) { 2801 if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) {
2802 2802
2803 DP(NETIF_MSG_TX_QUEUED, "Unable to map page - " 2803 DP(NETIF_MSG_TX_QUEUED, "Unable to map page - "
@@ -2821,8 +2821,8 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
2821 2821
2822 tx_data_bd->addr_hi = cpu_to_le32(U64_HI(mapping)); 2822 tx_data_bd->addr_hi = cpu_to_le32(U64_HI(mapping));
2823 tx_data_bd->addr_lo = cpu_to_le32(U64_LO(mapping)); 2823 tx_data_bd->addr_lo = cpu_to_le32(U64_LO(mapping));
2824 tx_data_bd->nbytes = cpu_to_le16(frag->size); 2824 tx_data_bd->nbytes = cpu_to_le16(skb_frag_size(frag));
2825 le16_add_cpu(&pkt_size, frag->size); 2825 le16_add_cpu(&pkt_size, skb_frag_size(frag));
2826 nbd++; 2826 nbd++;
2827 2827
2828 DP(NETIF_MSG_TX_QUEUED, 2828 DP(NETIF_MSG_TX_QUEUED,
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index fe712f955110..b89027c61937 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -5356,7 +5356,7 @@ static void tg3_tx(struct tg3_napi *tnapi)
5356 5356
5357 pci_unmap_page(tp->pdev, 5357 pci_unmap_page(tp->pdev,
5358 dma_unmap_addr(ri, mapping), 5358 dma_unmap_addr(ri, mapping),
5359 skb_shinfo(skb)->frags[i].size, 5359 skb_frag_size(&skb_shinfo(skb)->frags[i]),
5360 PCI_DMA_TODEVICE); 5360 PCI_DMA_TODEVICE);
5361 5361
5362 while (ri->fragmented) { 5362 while (ri->fragmented) {
@@ -6510,14 +6510,14 @@ static void tg3_tx_skb_unmap(struct tg3_napi *tnapi, u32 entry, int last)
6510 } 6510 }
6511 6511
6512 for (i = 0; i < last; i++) { 6512 for (i = 0; i < last; i++) {
6513 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 6513 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
6514 6514
6515 entry = NEXT_TX(entry); 6515 entry = NEXT_TX(entry);
6516 txb = &tnapi->tx_buffers[entry]; 6516 txb = &tnapi->tx_buffers[entry];
6517 6517
6518 pci_unmap_page(tnapi->tp->pdev, 6518 pci_unmap_page(tnapi->tp->pdev,
6519 dma_unmap_addr(txb, mapping), 6519 dma_unmap_addr(txb, mapping),
6520 frag->size, PCI_DMA_TODEVICE); 6520 skb_frag_size(frag), PCI_DMA_TODEVICE);
6521 6521
6522 while (txb->fragmented) { 6522 while (txb->fragmented) {
6523 txb->fragmented = false; 6523 txb->fragmented = false;
@@ -6777,7 +6777,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
6777 for (i = 0; i <= last; i++) { 6777 for (i = 0; i <= last; i++) {
6778 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 6778 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
6779 6779
6780 len = frag->size; 6780 len = skb_frag_size(frag);
6781 mapping = skb_frag_dma_map(&tp->pdev->dev, frag, 0, 6781 mapping = skb_frag_dma_map(&tp->pdev->dev, frag, 0,
6782 len, DMA_TO_DEVICE); 6782 len, DMA_TO_DEVICE);
6783 6783
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index 2f4ced66612a..5d7872ecff52 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -116,7 +116,7 @@ bnad_pci_unmap_skb(struct device *pdev, struct bnad_skb_unmap *array,
116 116
117 for (j = 0; j < frag; j++) { 117 for (j = 0; j < frag; j++) {
118 dma_unmap_page(pdev, dma_unmap_addr(&array[index], dma_addr), 118 dma_unmap_page(pdev, dma_unmap_addr(&array[index], dma_addr),
119 skb_shinfo(skb)->frags[j].size, DMA_TO_DEVICE); 119 skb_frag_size(&skb_shinfo(skb)->frags[j]), DMA_TO_DEVICE);
120 dma_unmap_addr_set(&array[index], dma_addr, 0); 120 dma_unmap_addr_set(&array[index], dma_addr, 0);
121 BNA_QE_INDX_ADD(index, 1, depth); 121 BNA_QE_INDX_ADD(index, 1, depth);
122 } 122 }
@@ -2741,8 +2741,8 @@ bnad_start_xmit(struct sk_buff *skb, struct net_device *netdev)
2741 wis_used = 1; 2741 wis_used = 1;
2742 2742
2743 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 2743 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
2744 struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i]; 2744 const struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i];
2745 u16 size = frag->size; 2745 u16 size = skb_frag_size(frag);
2746 2746
2747 if (unlikely(size == 0)) { 2747 if (unlikely(size == 0)) {
2748 unmap_prod = unmap_q->producer_index; 2748 unmap_prod = unmap_q->producer_index;
diff --git a/drivers/net/ethernet/chelsio/cxgb/sge.c b/drivers/net/ethernet/chelsio/cxgb/sge.c
index 0a511c4a0472..f9b602300040 100644
--- a/drivers/net/ethernet/chelsio/cxgb/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb/sge.c
@@ -1135,8 +1135,8 @@ static inline unsigned int compute_large_page_tx_descs(struct sk_buff *skb)
1135 len -= SGE_TX_DESC_MAX_PLEN; 1135 len -= SGE_TX_DESC_MAX_PLEN;
1136 } 1136 }
1137 for (i = 0; nfrags--; i++) { 1137 for (i = 0; nfrags--; i++) {
1138 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 1138 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
1139 len = frag->size; 1139 len = skb_frag_size(frag);
1140 while (len > SGE_TX_DESC_MAX_PLEN) { 1140 while (len > SGE_TX_DESC_MAX_PLEN) {
1141 count++; 1141 count++;
1142 len -= SGE_TX_DESC_MAX_PLEN; 1142 len -= SGE_TX_DESC_MAX_PLEN;
@@ -1278,9 +1278,9 @@ static inline void write_tx_descs(struct adapter *adapter, struct sk_buff *skb,
1278 } 1278 }
1279 1279
1280 mapping = skb_frag_dma_map(&adapter->pdev->dev, frag, 0, 1280 mapping = skb_frag_dma_map(&adapter->pdev->dev, frag, 0,
1281 frag->size, DMA_TO_DEVICE); 1281 skb_frag_size(frag), DMA_TO_DEVICE);
1282 desc_mapping = mapping; 1282 desc_mapping = mapping;
1283 desc_len = frag->size; 1283 desc_len = skb_frag_size(frag);
1284 1284
1285 pidx = write_large_page_tx_descs(pidx, &e1, &ce, &gen, 1285 pidx = write_large_page_tx_descs(pidx, &e1, &ce, &gen,
1286 &desc_mapping, &desc_len, 1286 &desc_mapping, &desc_len,
@@ -1290,7 +1290,7 @@ static inline void write_tx_descs(struct adapter *adapter, struct sk_buff *skb,
1290 nfrags == 0); 1290 nfrags == 0);
1291 ce->skb = NULL; 1291 ce->skb = NULL;
1292 dma_unmap_addr_set(ce, dma_addr, mapping); 1292 dma_unmap_addr_set(ce, dma_addr, mapping);
1293 dma_unmap_len_set(ce, dma_len, frag->size); 1293 dma_unmap_len_set(ce, dma_len, skb_frag_size(frag));
1294 } 1294 }
1295 ce->skb = skb; 1295 ce->skb = skb;
1296 wmb(); 1296 wmb();
diff --git a/drivers/net/ethernet/chelsio/cxgb3/sge.c b/drivers/net/ethernet/chelsio/cxgb3/sge.c
index 2f46b37e5d16..cfb60e1f51da 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/sge.c
@@ -254,7 +254,7 @@ static inline void unmap_skb(struct sk_buff *skb, struct sge_txq *q,
254 254
255 while (frag_idx < nfrags && curflit < WR_FLITS) { 255 while (frag_idx < nfrags && curflit < WR_FLITS) {
256 pci_unmap_page(pdev, be64_to_cpu(sgp->addr[j]), 256 pci_unmap_page(pdev, be64_to_cpu(sgp->addr[j]),
257 skb_shinfo(skb)->frags[frag_idx].size, 257 skb_frag_size(&skb_shinfo(skb)->frags[frag_idx]),
258 PCI_DMA_TODEVICE); 258 PCI_DMA_TODEVICE);
259 j ^= 1; 259 j ^= 1;
260 if (j == 0) { 260 if (j == 0) {
@@ -977,11 +977,11 @@ static inline unsigned int make_sgl(const struct sk_buff *skb,
977 977
978 nfrags = skb_shinfo(skb)->nr_frags; 978 nfrags = skb_shinfo(skb)->nr_frags;
979 for (i = 0; i < nfrags; i++) { 979 for (i = 0; i < nfrags; i++) {
980 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 980 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
981 981
982 mapping = skb_frag_dma_map(&pdev->dev, frag, 0, frag->size, 982 mapping = skb_frag_dma_map(&pdev->dev, frag, 0, skb_frag_size(frag),
983 DMA_TO_DEVICE); 983 DMA_TO_DEVICE);
984 sgp->len[j] = cpu_to_be32(frag->size); 984 sgp->len[j] = cpu_to_be32(skb_frag_size(frag));
985 sgp->addr[j] = cpu_to_be64(mapping); 985 sgp->addr[j] = cpu_to_be64(mapping);
986 j ^= 1; 986 j ^= 1;
987 if (j == 0) 987 if (j == 0)
@@ -1544,7 +1544,7 @@ static void deferred_unmap_destructor(struct sk_buff *skb)
1544 1544
1545 si = skb_shinfo(skb); 1545 si = skb_shinfo(skb);
1546 for (i = 0; i < si->nr_frags; i++) 1546 for (i = 0; i < si->nr_frags; i++)
1547 pci_unmap_page(dui->pdev, *p++, si->frags[i].size, 1547 pci_unmap_page(dui->pdev, *p++, skb_frag_size(&si->frags[i]),
1548 PCI_DMA_TODEVICE); 1548 PCI_DMA_TODEVICE);
1549} 1549}
1550 1550
@@ -2118,7 +2118,7 @@ static void lro_add_page(struct adapter *adap, struct sge_qset *qs,
2118 rx_frag += nr_frags; 2118 rx_frag += nr_frags;
2119 __skb_frag_set_page(rx_frag, sd->pg_chunk.page); 2119 __skb_frag_set_page(rx_frag, sd->pg_chunk.page);
2120 rx_frag->page_offset = sd->pg_chunk.offset + offset; 2120 rx_frag->page_offset = sd->pg_chunk.offset + offset;
2121 rx_frag->size = len; 2121 skb_frag_size_set(rx_frag, len);
2122 2122
2123 skb->len += len; 2123 skb->len += len;
2124 skb->data_len += len; 2124 skb->data_len += len;
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c
index 56adf448b9fe..14f31d3a18d7 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@ -215,8 +215,8 @@ static int map_skb(struct device *dev, const struct sk_buff *skb,
215 end = &si->frags[si->nr_frags]; 215 end = &si->frags[si->nr_frags];
216 216
217 for (fp = si->frags; fp < end; fp++) { 217 for (fp = si->frags; fp < end; fp++) {
218 *++addr = dma_map_page(dev, fp->page, fp->page_offset, fp->size, 218 *++addr = dma_map_page(dev, fp->page, fp->page_offset,
219 DMA_TO_DEVICE); 219 skb_frag_size(fp), DMA_TO_DEVICE);
220 if (dma_mapping_error(dev, *addr)) 220 if (dma_mapping_error(dev, *addr))
221 goto unwind; 221 goto unwind;
222 } 222 }
@@ -224,7 +224,7 @@ static int map_skb(struct device *dev, const struct sk_buff *skb,
224 224
225unwind: 225unwind:
226 while (fp-- > si->frags) 226 while (fp-- > si->frags)
227 dma_unmap_page(dev, *--addr, fp->size, DMA_TO_DEVICE); 227 dma_unmap_page(dev, *--addr, skb_frag_size(fp), DMA_TO_DEVICE);
228 228
229 dma_unmap_single(dev, addr[-1], skb_headlen(skb), DMA_TO_DEVICE); 229 dma_unmap_single(dev, addr[-1], skb_headlen(skb), DMA_TO_DEVICE);
230out_err: 230out_err:
@@ -243,7 +243,7 @@ static void unmap_skb(struct device *dev, const struct sk_buff *skb,
243 si = skb_shinfo(skb); 243 si = skb_shinfo(skb);
244 end = &si->frags[si->nr_frags]; 244 end = &si->frags[si->nr_frags];
245 for (fp = si->frags; fp < end; fp++) 245 for (fp = si->frags; fp < end; fp++)
246 dma_unmap_page(dev, *addr++, fp->size, DMA_TO_DEVICE); 246 dma_unmap_page(dev, *addr++, skb_frag_size(fp), DMA_TO_DEVICE);
247} 247}
248 248
249/** 249/**
@@ -717,7 +717,7 @@ static void write_sgl(const struct sk_buff *skb, struct sge_txq *q,
717 sgl->addr0 = cpu_to_be64(addr[0] + start); 717 sgl->addr0 = cpu_to_be64(addr[0] + start);
718 nfrags++; 718 nfrags++;
719 } else { 719 } else {
720 sgl->len0 = htonl(si->frags[0].size); 720 sgl->len0 = htonl(skb_frag_size(&si->frags[0]));
721 sgl->addr0 = cpu_to_be64(addr[1]); 721 sgl->addr0 = cpu_to_be64(addr[1]);
722 } 722 }
723 723
@@ -732,13 +732,13 @@ static void write_sgl(const struct sk_buff *skb, struct sge_txq *q,
732 to = (u8 *)end > (u8 *)q->stat ? buf : sgl->sge; 732 to = (u8 *)end > (u8 *)q->stat ? buf : sgl->sge;
733 733
734 for (i = (nfrags != si->nr_frags); nfrags >= 2; nfrags -= 2, to++) { 734 for (i = (nfrags != si->nr_frags); nfrags >= 2; nfrags -= 2, to++) {
735 to->len[0] = cpu_to_be32(si->frags[i].size); 735 to->len[0] = cpu_to_be32(skb_frag_size(&si->frags[i]));
736 to->len[1] = cpu_to_be32(si->frags[++i].size); 736 to->len[1] = cpu_to_be32(skb_frag_size(&si->frags[++i]));
737 to->addr[0] = cpu_to_be64(addr[i]); 737 to->addr[0] = cpu_to_be64(addr[i]);
738 to->addr[1] = cpu_to_be64(addr[++i]); 738 to->addr[1] = cpu_to_be64(addr[++i]);
739 } 739 }
740 if (nfrags) { 740 if (nfrags) {
741 to->len[0] = cpu_to_be32(si->frags[i].size); 741 to->len[0] = cpu_to_be32(skb_frag_size(&si->frags[i]));
742 to->len[1] = cpu_to_be32(0); 742 to->len[1] = cpu_to_be32(0);
743 to->addr[0] = cpu_to_be64(addr[i + 1]); 743 to->addr[0] = cpu_to_be64(addr[i + 1]);
744 } 744 }
@@ -1417,7 +1417,7 @@ static inline void copy_frags(struct skb_shared_info *ssi,
1417 /* usually there's just one frag */ 1417 /* usually there's just one frag */
1418 ssi->frags[0].page = gl->frags[0].page; 1418 ssi->frags[0].page = gl->frags[0].page;
1419 ssi->frags[0].page_offset = gl->frags[0].page_offset + offset; 1419 ssi->frags[0].page_offset = gl->frags[0].page_offset + offset;
1420 ssi->frags[0].size = gl->frags[0].size - offset; 1420 skb_frag_size_set(&ssi->frags[0], skb_frag_size(&gl->frags[0]) - offset);
1421 ssi->nr_frags = gl->nfrags; 1421 ssi->nr_frags = gl->nfrags;
1422 n = gl->nfrags - 1; 1422 n = gl->nfrags - 1;
1423 if (n) 1423 if (n)
@@ -1718,8 +1718,8 @@ static int process_responses(struct sge_rspq *q, int budget)
1718 bufsz = get_buf_size(rsd); 1718 bufsz = get_buf_size(rsd);
1719 fp->page = rsd->page; 1719 fp->page = rsd->page;
1720 fp->page_offset = q->offset; 1720 fp->page_offset = q->offset;
1721 fp->size = min(bufsz, len); 1721 skb_frag_size_set(fp, min(bufsz, len));
1722 len -= fp->size; 1722 len -= skb_frag_size(fp);
1723 if (!len) 1723 if (!len)
1724 break; 1724 break;
1725 unmap_rx_buf(q->adap, &rxq->fl); 1725 unmap_rx_buf(q->adap, &rxq->fl);
@@ -1731,7 +1731,7 @@ static int process_responses(struct sge_rspq *q, int budget)
1731 */ 1731 */
1732 dma_sync_single_for_cpu(q->adap->pdev_dev, 1732 dma_sync_single_for_cpu(q->adap->pdev_dev,
1733 get_buf_addr(rsd), 1733 get_buf_addr(rsd),
1734 fp->size, DMA_FROM_DEVICE); 1734 skb_frag_size(fp), DMA_FROM_DEVICE);
1735 1735
1736 si.va = page_address(si.frags[0].page) + 1736 si.va = page_address(si.frags[0].page) +
1737 si.frags[0].page_offset; 1737 si.frags[0].page_offset;
@@ -1740,7 +1740,7 @@ static int process_responses(struct sge_rspq *q, int budget)
1740 si.nfrags = frags + 1; 1740 si.nfrags = frags + 1;
1741 ret = q->handler(q, q->cur_desc, &si); 1741 ret = q->handler(q, q->cur_desc, &si);
1742 if (likely(ret == 0)) 1742 if (likely(ret == 0))
1743 q->offset += ALIGN(fp->size, FL_ALIGN); 1743 q->offset += ALIGN(skb_frag_size(fp), FL_ALIGN);
1744 else 1744 else
1745 restore_rx_bufs(&si, &rxq->fl, frags); 1745 restore_rx_bufs(&si, &rxq->fl, frags);
1746 } else if (likely(rsp_type == RSP_TYPE_CPL)) { 1746 } else if (likely(rsp_type == RSP_TYPE_CPL)) {
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/sge.c b/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
index cffb328c46c3..c2d456d90c00 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
@@ -296,8 +296,8 @@ static int map_skb(struct device *dev, const struct sk_buff *skb,
296 si = skb_shinfo(skb); 296 si = skb_shinfo(skb);
297 end = &si->frags[si->nr_frags]; 297 end = &si->frags[si->nr_frags];
298 for (fp = si->frags; fp < end; fp++) { 298 for (fp = si->frags; fp < end; fp++) {
299 *++addr = dma_map_page(dev, fp->page, fp->page_offset, fp->size, 299 *++addr = dma_map_page(dev, fp->page, fp->page_offset,
300 DMA_TO_DEVICE); 300 skb_frag_size(fp), DMA_TO_DEVICE);
301 if (dma_mapping_error(dev, *addr)) 301 if (dma_mapping_error(dev, *addr))
302 goto unwind; 302 goto unwind;
303 } 303 }
@@ -305,7 +305,7 @@ static int map_skb(struct device *dev, const struct sk_buff *skb,
305 305
306unwind: 306unwind:
307 while (fp-- > si->frags) 307 while (fp-- > si->frags)
308 dma_unmap_page(dev, *--addr, fp->size, DMA_TO_DEVICE); 308 dma_unmap_page(dev, *--addr, skb_frag_size(fp), DMA_TO_DEVICE);
309 dma_unmap_single(dev, addr[-1], skb_headlen(skb), DMA_TO_DEVICE); 309 dma_unmap_single(dev, addr[-1], skb_headlen(skb), DMA_TO_DEVICE);
310 310
311out_err: 311out_err:
@@ -899,7 +899,7 @@ static void write_sgl(const struct sk_buff *skb, struct sge_txq *tq,
899 sgl->addr0 = cpu_to_be64(addr[0] + start); 899 sgl->addr0 = cpu_to_be64(addr[0] + start);
900 nfrags++; 900 nfrags++;
901 } else { 901 } else {
902 sgl->len0 = htonl(si->frags[0].size); 902 sgl->len0 = htonl(skb_frag_size(&si->frags[0]));
903 sgl->addr0 = cpu_to_be64(addr[1]); 903 sgl->addr0 = cpu_to_be64(addr[1]);
904 } 904 }
905 905
@@ -915,13 +915,13 @@ static void write_sgl(const struct sk_buff *skb, struct sge_txq *tq,
915 to = (u8 *)end > (u8 *)tq->stat ? buf : sgl->sge; 915 to = (u8 *)end > (u8 *)tq->stat ? buf : sgl->sge;
916 916
917 for (i = (nfrags != si->nr_frags); nfrags >= 2; nfrags -= 2, to++) { 917 for (i = (nfrags != si->nr_frags); nfrags >= 2; nfrags -= 2, to++) {
918 to->len[0] = cpu_to_be32(si->frags[i].size); 918 to->len[0] = cpu_to_be32(skb_frag_size(&si->frags[i]));
919 to->len[1] = cpu_to_be32(si->frags[++i].size); 919 to->len[1] = cpu_to_be32(skb_frag_size(&si->frags[++i]));
920 to->addr[0] = cpu_to_be64(addr[i]); 920 to->addr[0] = cpu_to_be64(addr[i]);
921 to->addr[1] = cpu_to_be64(addr[++i]); 921 to->addr[1] = cpu_to_be64(addr[++i]);
922 } 922 }
923 if (nfrags) { 923 if (nfrags) {
924 to->len[0] = cpu_to_be32(si->frags[i].size); 924 to->len[0] = cpu_to_be32(skb_frag_size(&si->frags[i]));
925 to->len[1] = cpu_to_be32(0); 925 to->len[1] = cpu_to_be32(0);
926 to->addr[0] = cpu_to_be64(addr[i + 1]); 926 to->addr[0] = cpu_to_be64(addr[i + 1]);
927 } 927 }
@@ -1399,7 +1399,7 @@ struct sk_buff *t4vf_pktgl_to_skb(const struct pkt_gl *gl,
1399 ssi = skb_shinfo(skb); 1399 ssi = skb_shinfo(skb);
1400 ssi->frags[0].page = gl->frags[0].page; 1400 ssi->frags[0].page = gl->frags[0].page;
1401 ssi->frags[0].page_offset = gl->frags[0].page_offset + pull_len; 1401 ssi->frags[0].page_offset = gl->frags[0].page_offset + pull_len;
1402 ssi->frags[0].size = gl->frags[0].size - pull_len; 1402 skb_frag_size_set(&ssi->frags[0], skb_frag_size(&gl->frags[0]) - pull_len);
1403 if (gl->nfrags > 1) 1403 if (gl->nfrags > 1)
1404 memcpy(&ssi->frags[1], &gl->frags[1], 1404 memcpy(&ssi->frags[1], &gl->frags[1],
1405 (gl->nfrags-1) * sizeof(skb_frag_t)); 1405 (gl->nfrags-1) * sizeof(skb_frag_t));
@@ -1451,7 +1451,7 @@ static inline void copy_frags(struct skb_shared_info *si,
1451 /* usually there's just one frag */ 1451 /* usually there's just one frag */
1452 si->frags[0].page = gl->frags[0].page; 1452 si->frags[0].page = gl->frags[0].page;
1453 si->frags[0].page_offset = gl->frags[0].page_offset + offset; 1453 si->frags[0].page_offset = gl->frags[0].page_offset + offset;
1454 si->frags[0].size = gl->frags[0].size - offset; 1454 skb_frag_size_set(&si->frags[0], skb_frag_size(&gl->frags[0]) - offset);
1455 si->nr_frags = gl->nfrags; 1455 si->nr_frags = gl->nfrags;
1456 1456
1457 n = gl->nfrags - 1; 1457 n = gl->nfrags - 1;
@@ -1702,8 +1702,8 @@ int process_responses(struct sge_rspq *rspq, int budget)
1702 bufsz = get_buf_size(sdesc); 1702 bufsz = get_buf_size(sdesc);
1703 fp->page = sdesc->page; 1703 fp->page = sdesc->page;
1704 fp->page_offset = rspq->offset; 1704 fp->page_offset = rspq->offset;
1705 fp->size = min(bufsz, len); 1705 skb_frag_size_set(fp, min(bufsz, len));
1706 len -= fp->size; 1706 len -= skb_frag_size(fp);
1707 if (!len) 1707 if (!len)
1708 break; 1708 break;
1709 unmap_rx_buf(rspq->adapter, &rxq->fl); 1709 unmap_rx_buf(rspq->adapter, &rxq->fl);
@@ -1717,7 +1717,7 @@ int process_responses(struct sge_rspq *rspq, int budget)
1717 */ 1717 */
1718 dma_sync_single_for_cpu(rspq->adapter->pdev_dev, 1718 dma_sync_single_for_cpu(rspq->adapter->pdev_dev,
1719 get_buf_addr(sdesc), 1719 get_buf_addr(sdesc),
1720 fp->size, DMA_FROM_DEVICE); 1720 skb_frag_size(fp), DMA_FROM_DEVICE);
1721 gl.va = (page_address(gl.frags[0].page) + 1721 gl.va = (page_address(gl.frags[0].page) +
1722 gl.frags[0].page_offset); 1722 gl.frags[0].page_offset);
1723 prefetch(gl.va); 1723 prefetch(gl.va);
@@ -1728,7 +1728,7 @@ int process_responses(struct sge_rspq *rspq, int budget)
1728 */ 1728 */
1729 ret = rspq->handler(rspq, rspq->cur_desc, &gl); 1729 ret = rspq->handler(rspq, rspq->cur_desc, &gl);
1730 if (likely(ret == 0)) 1730 if (likely(ret == 0))
1731 rspq->offset += ALIGN(fp->size, FL_ALIGN); 1731 rspq->offset += ALIGN(skb_frag_size(fp), FL_ALIGN);
1732 else 1732 else
1733 restore_rx_bufs(&gl, &rxq->fl, frag); 1733 restore_rx_bufs(&gl, &rxq->fl, frag);
1734 } else if (likely(rsp_type == RSP_TYPE_CPL)) { 1734 } else if (likely(rsp_type == RSP_TYPE_CPL)) {
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index 1bc908f595de..c3786fda11db 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -599,16 +599,16 @@ static inline void enic_queue_wq_skb_cont(struct enic *enic,
599 struct vnic_wq *wq, struct sk_buff *skb, 599 struct vnic_wq *wq, struct sk_buff *skb,
600 unsigned int len_left, int loopback) 600 unsigned int len_left, int loopback)
601{ 601{
602 skb_frag_t *frag; 602 const skb_frag_t *frag;
603 603
604 /* Queue additional data fragments */ 604 /* Queue additional data fragments */
605 for (frag = skb_shinfo(skb)->frags; len_left; frag++) { 605 for (frag = skb_shinfo(skb)->frags; len_left; frag++) {
606 len_left -= frag->size; 606 len_left -= skb_frag_size(frag);
607 enic_queue_wq_desc_cont(wq, skb, 607 enic_queue_wq_desc_cont(wq, skb,
608 skb_frag_dma_map(&enic->pdev->dev, 608 skb_frag_dma_map(&enic->pdev->dev,
609 frag, 0, frag->size, 609 frag, 0, skb_frag_size(frag),
610 DMA_TO_DEVICE), 610 DMA_TO_DEVICE),
611 frag->size, 611 skb_frag_size(frag),
612 (len_left == 0), /* EOP? */ 612 (len_left == 0), /* EOP? */
613 loopback); 613 loopback);
614 } 614 }
@@ -717,8 +717,8 @@ static inline void enic_queue_wq_skb_tso(struct enic *enic,
717 * for additional data fragments 717 * for additional data fragments
718 */ 718 */
719 for (frag = skb_shinfo(skb)->frags; len_left; frag++) { 719 for (frag = skb_shinfo(skb)->frags; len_left; frag++) {
720 len_left -= frag->size; 720 len_left -= skb_frag_size(frag);
721 frag_len_left = frag->size; 721 frag_len_left = skb_frag_size(frag);
722 offset = 0; 722 offset = 0;
723 723
724 while (frag_len_left) { 724 while (frag_len_left) {
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 679b8041e43a..706fc5989939 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -636,17 +636,17 @@ static int make_tx_wrbs(struct be_adapter *adapter, struct be_queue_info *txq,
636 } 636 }
637 637
638 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 638 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
639 struct skb_frag_struct *frag = 639 const struct skb_frag_struct *frag =
640 &skb_shinfo(skb)->frags[i]; 640 &skb_shinfo(skb)->frags[i];
641 busaddr = skb_frag_dma_map(dev, frag, 0, 641 busaddr = skb_frag_dma_map(dev, frag, 0,
642 frag->size, DMA_TO_DEVICE); 642 skb_frag_size(frag), DMA_TO_DEVICE);
643 if (dma_mapping_error(dev, busaddr)) 643 if (dma_mapping_error(dev, busaddr))
644 goto dma_err; 644 goto dma_err;
645 wrb = queue_head_node(txq); 645 wrb = queue_head_node(txq);
646 wrb_fill(wrb, busaddr, frag->size); 646 wrb_fill(wrb, busaddr, skb_frag_size(frag));
647 be_dws_cpu_to_le(wrb, sizeof(*wrb)); 647 be_dws_cpu_to_le(wrb, sizeof(*wrb));
648 queue_head_inc(txq); 648 queue_head_inc(txq);
649 copied += frag->size; 649 copied += skb_frag_size(frag);
650 } 650 }
651 651
652 if (dummy_wrb) { 652 if (dummy_wrb) {
@@ -1069,7 +1069,7 @@ static void skb_fill_rx_data(struct be_adapter *adapter, struct be_rx_obj *rxo,
1069 skb_frag_set_page(skb, 0, page_info->page); 1069 skb_frag_set_page(skb, 0, page_info->page);
1070 skb_shinfo(skb)->frags[0].page_offset = 1070 skb_shinfo(skb)->frags[0].page_offset =
1071 page_info->page_offset + hdr_len; 1071 page_info->page_offset + hdr_len;
1072 skb_shinfo(skb)->frags[0].size = curr_frag_len - hdr_len; 1072 skb_frag_size_set(&skb_shinfo(skb)->frags[0], curr_frag_len - hdr_len);
1073 skb->data_len = curr_frag_len - hdr_len; 1073 skb->data_len = curr_frag_len - hdr_len;
1074 skb->truesize += rx_frag_size; 1074 skb->truesize += rx_frag_size;
1075 skb->tail += hdr_len; 1075 skb->tail += hdr_len;
@@ -1095,13 +1095,13 @@ static void skb_fill_rx_data(struct be_adapter *adapter, struct be_rx_obj *rxo,
1095 skb_frag_set_page(skb, j, page_info->page); 1095 skb_frag_set_page(skb, j, page_info->page);
1096 skb_shinfo(skb)->frags[j].page_offset = 1096 skb_shinfo(skb)->frags[j].page_offset =
1097 page_info->page_offset; 1097 page_info->page_offset;
1098 skb_shinfo(skb)->frags[j].size = 0; 1098 skb_frag_size_set(&skb_shinfo(skb)->frags[j], 0);
1099 skb_shinfo(skb)->nr_frags++; 1099 skb_shinfo(skb)->nr_frags++;
1100 } else { 1100 } else {
1101 put_page(page_info->page); 1101 put_page(page_info->page);
1102 } 1102 }
1103 1103
1104 skb_shinfo(skb)->frags[j].size += curr_frag_len; 1104 skb_frag_size_add(&skb_shinfo(skb)->frags[j], curr_frag_len);
1105 skb->len += curr_frag_len; 1105 skb->len += curr_frag_len;
1106 skb->data_len += curr_frag_len; 1106 skb->data_len += curr_frag_len;
1107 skb->truesize += rx_frag_size; 1107 skb->truesize += rx_frag_size;
@@ -1176,11 +1176,11 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter,
1176 skb_frag_set_page(skb, j, page_info->page); 1176 skb_frag_set_page(skb, j, page_info->page);
1177 skb_shinfo(skb)->frags[j].page_offset = 1177 skb_shinfo(skb)->frags[j].page_offset =
1178 page_info->page_offset; 1178 page_info->page_offset;
1179 skb_shinfo(skb)->frags[j].size = 0; 1179 skb_frag_size_set(&skb_shinfo(skb)->frags[j], 0);
1180 } else { 1180 } else {
1181 put_page(page_info->page); 1181 put_page(page_info->page);
1182 } 1182 }
1183 skb_shinfo(skb)->frags[j].size += curr_frag_len; 1183 skb_frag_size_add(&skb_shinfo(skb)->frags[j], curr_frag_len);
1184 skb->truesize += rx_frag_size; 1184 skb->truesize += rx_frag_size;
1185 remaining -= curr_frag_len; 1185 remaining -= curr_frag_len;
1186 index_inc(&rxcp->rxq_idx, rxq->len); 1186 index_inc(&rxcp->rxq_idx, rxq->len);
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index adb462d0b8d3..0d4d4f68d4ed 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -1676,7 +1676,7 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev,
1676 1676
1677 /* copy sg1entry data */ 1677 /* copy sg1entry data */
1678 sg1entry->l_key = lkey; 1678 sg1entry->l_key = lkey;
1679 sg1entry->len = frag->size; 1679 sg1entry->len = skb_frag_size(frag);
1680 sg1entry->vaddr = 1680 sg1entry->vaddr =
1681 ehea_map_vaddr(skb_frag_address(frag)); 1681 ehea_map_vaddr(skb_frag_address(frag));
1682 swqe->descriptors++; 1682 swqe->descriptors++;
@@ -1689,7 +1689,7 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev,
1689 sgentry = &sg_list[i - sg1entry_contains_frag_data]; 1689 sgentry = &sg_list[i - sg1entry_contains_frag_data];
1690 1690
1691 sgentry->l_key = lkey; 1691 sgentry->l_key = lkey;
1692 sgentry->len = frag->size; 1692 sgentry->len = frag_size(frag);
1693 sgentry->vaddr = ehea_map_vaddr(skb_frag_address(frag)); 1693 sgentry->vaddr = ehea_map_vaddr(skb_frag_address(frag));
1694 swqe->descriptors++; 1694 swqe->descriptors++;
1695 } 1695 }
diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c
index 6b3a033d9de5..ed79b2d3ad3e 100644
--- a/drivers/net/ethernet/ibm/emac/core.c
+++ b/drivers/net/ethernet/ibm/emac/core.c
@@ -1453,7 +1453,7 @@ static int emac_start_xmit_sg(struct sk_buff *skb, struct net_device *ndev)
1453 /* skb fragments */ 1453 /* skb fragments */
1454 for (i = 0; i < nr_frags; ++i) { 1454 for (i = 0; i < nr_frags; ++i) {
1455 struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i]; 1455 struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i];
1456 len = frag->size; 1456 len = skb_frag_size(frag);
1457 1457
1458 if (unlikely(dev->tx_cnt + mal_tx_chunks(len) >= NUM_TX_BUFF)) 1458 if (unlikely(dev->tx_cnt + mal_tx_chunks(len) >= NUM_TX_BUFF))
1459 goto undo_frame; 1459 goto undo_frame;
diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
index 4da972eaabb4..b1cd41b9c61c 100644
--- a/drivers/net/ethernet/ibm/ibmveth.c
+++ b/drivers/net/ethernet/ibm/ibmveth.c
@@ -1014,15 +1014,15 @@ retry_bounce:
1014 1014
1015 /* Map the frags */ 1015 /* Map the frags */
1016 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 1016 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
1017 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 1017 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
1018 1018
1019 dma_addr = skb_frag_dma_map(&adapter->vdev->dev, frag, 0, 1019 dma_addr = skb_frag_dma_map(&adapter->vdev->dev, frag, 0,
1020 frag->size, DMA_TO_DEVICE); 1020 skb_frag_size(frag), DMA_TO_DEVICE);
1021 1021
1022 if (dma_mapping_error(&adapter->vdev->dev, dma_addr)) 1022 if (dma_mapping_error(&adapter->vdev->dev, dma_addr))
1023 goto map_failed_frags; 1023 goto map_failed_frags;
1024 1024
1025 descs[i+1].fields.flags_len = desc_flags | frag->size; 1025 descs[i+1].fields.flags_len = desc_flags | skb_frag_size(frag);
1026 descs[i+1].fields.address = dma_addr; 1026 descs[i+1].fields.address = dma_addr;
1027 } 1027 }
1028 1028
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 7b54d7246150..cf480b554622 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -2894,10 +2894,10 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
2894 } 2894 }
2895 2895
2896 for (f = 0; f < nr_frags; f++) { 2896 for (f = 0; f < nr_frags; f++) {
2897 struct skb_frag_struct *frag; 2897 const struct skb_frag_struct *frag;
2898 2898
2899 frag = &skb_shinfo(skb)->frags[f]; 2899 frag = &skb_shinfo(skb)->frags[f];
2900 len = frag->size; 2900 len = skb_frag_size(frag);
2901 offset = 0; 2901 offset = 0;
2902 2902
2903 while (len) { 2903 while (len) {
@@ -3183,7 +3183,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
3183 3183
3184 nr_frags = skb_shinfo(skb)->nr_frags; 3184 nr_frags = skb_shinfo(skb)->nr_frags;
3185 for (f = 0; f < nr_frags; f++) 3185 for (f = 0; f < nr_frags; f++)
3186 count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size, 3186 count += TXD_USE_COUNT(skb_frag_size(&skb_shinfo(skb)->frags[f]),
3187 max_txd_pwr); 3187 max_txd_pwr);
3188 if (adapter->pcix_82544) 3188 if (adapter->pcix_82544)
3189 count += nr_frags; 3189 count += nr_frags;
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 035ce73c388e..680312710a78 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -4673,10 +4673,10 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
4673 } 4673 }
4674 4674
4675 for (f = 0; f < nr_frags; f++) { 4675 for (f = 0; f < nr_frags; f++) {
4676 struct skb_frag_struct *frag; 4676 const struct skb_frag_struct *frag;
4677 4677
4678 frag = &skb_shinfo(skb)->frags[f]; 4678 frag = &skb_shinfo(skb)->frags[f];
4679 len = frag->size; 4679 len = skb_frag_size(frag);
4680 offset = 0; 4680 offset = 0;
4681 4681
4682 while (len) { 4682 while (len) {
@@ -4943,7 +4943,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
4943 4943
4944 nr_frags = skb_shinfo(skb)->nr_frags; 4944 nr_frags = skb_shinfo(skb)->nr_frags;
4945 for (f = 0; f < nr_frags; f++) 4945 for (f = 0; f < nr_frags; f++)
4946 count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size, 4946 count += TXD_USE_COUNT(skb_frag_size(&skb_shinfo(skb)->frags[f]),
4947 max_txd_pwr); 4947 max_txd_pwr);
4948 4948
4949 if (adapter->hw.mac.tx_pkt_filtering) 4949 if (adapter->hw.mac.tx_pkt_filtering)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 837adbbce772..f9b818267de8 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -4268,7 +4268,7 @@ static void igb_tx_map(struct igb_ring *tx_ring,
4268 i = 0; 4268 i = 0;
4269 } 4269 }
4270 4270
4271 size = frag->size; 4271 size = skb_frag_size(frag);
4272 data_len -= size; 4272 data_len -= size;
4273 4273
4274 dma = skb_frag_dma_map(tx_ring->dev, frag, 0, 4274 dma = skb_frag_dma_map(tx_ring->dev, frag, 0,
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index 23cc40f22d6f..1bd9abddcc59 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -2045,7 +2045,7 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter,
2045 2045
2046 2046
2047 for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) { 2047 for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) {
2048 struct skb_frag_struct *frag; 2048 const struct skb_frag_struct *frag;
2049 2049
2050 count++; 2050 count++;
2051 i++; 2051 i++;
@@ -2053,7 +2053,7 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter,
2053 i = 0; 2053 i = 0;
2054 2054
2055 frag = &skb_shinfo(skb)->frags[f]; 2055 frag = &skb_shinfo(skb)->frags[f];
2056 len = frag->size; 2056 len = skb_frag_size(frag);
2057 2057
2058 buffer_info = &tx_ring->buffer_info[i]; 2058 buffer_info = &tx_ring->buffer_info[i];
2059 BUG_ON(len >= IGBVF_MAX_DATA_PER_TXD); 2059 BUG_ON(len >= IGBVF_MAX_DATA_PER_TXD);
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
index 88558b1aac07..e21148f8b160 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
@@ -1383,10 +1383,10 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
1383 } 1383 }
1384 1384
1385 for (f = 0; f < nr_frags; f++) { 1385 for (f = 0; f < nr_frags; f++) {
1386 struct skb_frag_struct *frag; 1386 const struct skb_frag_struct *frag;
1387 1387
1388 frag = &skb_shinfo(skb)->frags[f]; 1388 frag = &skb_shinfo(skb)->frags[f];
1389 len = frag->size; 1389 len = skb_frag_size(frag);
1390 offset = 0; 1390 offset = 0;
1391 1391
1392 while (len) { 1392 while (len) {
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 8075d11b4cde..09b8e88b2999 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -6545,9 +6545,9 @@ static void ixgbe_tx_map(struct ixgbe_ring *tx_ring,
6545 6545
6546 frag = &skb_shinfo(skb)->frags[f]; 6546 frag = &skb_shinfo(skb)->frags[f];
6547#ifdef IXGBE_FCOE 6547#ifdef IXGBE_FCOE
6548 size = min_t(unsigned int, data_len, frag->size); 6548 size = min_t(unsigned int, data_len, skb_frag_size(frag));
6549#else 6549#else
6550 size = frag->size; 6550 size = skb_frag_size(frag);
6551#endif 6551#endif
6552 data_len -= size; 6552 data_len -= size;
6553 f++; 6553 f++;
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 4930c4605493..5e92cc2079bd 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -2912,10 +2912,10 @@ static int ixgbevf_tx_map(struct ixgbevf_adapter *adapter,
2912 } 2912 }
2913 2913
2914 for (f = 0; f < nr_frags; f++) { 2914 for (f = 0; f < nr_frags; f++) {
2915 struct skb_frag_struct *frag; 2915 const struct skb_frag_struct *frag;
2916 2916
2917 frag = &skb_shinfo(skb)->frags[f]; 2917 frag = &skb_shinfo(skb)->frags[f];
2918 len = min((unsigned int)frag->size, total); 2918 len = min((unsigned int)skb_frag_size(frag), total);
2919 offset = 0; 2919 offset = 0;
2920 2920
2921 while (len) { 2921 while (len) {
@@ -3096,7 +3096,7 @@ static int ixgbevf_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
3096 3096
3097 count += TXD_USE_COUNT(skb_headlen(skb)); 3097 count += TXD_USE_COUNT(skb_headlen(skb));
3098 for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) 3098 for (f = 0; f < skb_shinfo(skb)->nr_frags; f++)
3099 count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size); 3099 count += TXD_USE_COUNT(skb_frag_size(&skb_shinfo(skb)->frags[f]));
3100 3100
3101 if (ixgbevf_maybe_stop_tx(netdev, tx_ring, count)) { 3101 if (ixgbevf_maybe_stop_tx(netdev, tx_ring, count)) {
3102 adapter->tx_busy++; 3102 adapter->tx_busy++;
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
index 48a0a23f342f..7a0c746f2749 100644
--- a/drivers/net/ethernet/jme.c
+++ b/drivers/net/ethernet/jme.c
@@ -1920,7 +1920,7 @@ jme_map_tx_skb(struct jme_adapter *jme, struct sk_buff *skb, int idx)
1920 u8 hidma = jme->dev->features & NETIF_F_HIGHDMA; 1920 u8 hidma = jme->dev->features & NETIF_F_HIGHDMA;
1921 int i, nr_frags = skb_shinfo(skb)->nr_frags; 1921 int i, nr_frags = skb_shinfo(skb)->nr_frags;
1922 int mask = jme->tx_ring_mask; 1922 int mask = jme->tx_ring_mask;
1923 struct skb_frag_struct *frag; 1923 const struct skb_frag_struct *frag;
1924 u32 len; 1924 u32 len;
1925 1925
1926 for (i = 0 ; i < nr_frags ; ++i) { 1926 for (i = 0 ; i < nr_frags ; ++i) {
@@ -1930,7 +1930,7 @@ jme_map_tx_skb(struct jme_adapter *jme, struct sk_buff *skb, int idx)
1930 1930
1931 jme_fill_tx_map(jme->pdev, ctxdesc, ctxbi, 1931 jme_fill_tx_map(jme->pdev, ctxdesc, ctxbi,
1932 skb_frag_page(frag), 1932 skb_frag_page(frag),
1933 frag->page_offset, frag->size, hidma); 1933 frag->page_offset, skb_frag_size(frag), hidma);
1934 } 1934 }
1935 1935
1936 len = skb_is_nonlinear(skb) ? skb_headlen(skb) : skb->len; 1936 len = skb_is_nonlinear(skb) ? skb_headlen(skb) : skb->len;
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index f6821aa5ffbf..194a03113802 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -713,8 +713,9 @@ static inline unsigned int has_tiny_unaligned_frags(struct sk_buff *skb)
713 int frag; 713 int frag;
714 714
715 for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) { 715 for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) {
716 skb_frag_t *fragp = &skb_shinfo(skb)->frags[frag]; 716 const skb_frag_t *fragp = &skb_shinfo(skb)->frags[frag];
717 if (fragp->size <= 8 && fragp->page_offset & 7) 717
718 if (skb_frag_size(fragp) <= 8 && fragp->page_offset & 7)
718 return 1; 719 return 1;
719 } 720 }
720 721
@@ -751,10 +752,10 @@ static void txq_submit_frag_skb(struct tx_queue *txq, struct sk_buff *skb)
751 } 752 }
752 753
753 desc->l4i_chk = 0; 754 desc->l4i_chk = 0;
754 desc->byte_cnt = this_frag->size; 755 desc->byte_cnt = skb_frag_size(this_frag);
755 desc->buf_ptr = skb_frag_dma_map(mp->dev->dev.parent, 756 desc->buf_ptr = skb_frag_dma_map(mp->dev->dev.parent,
756 this_frag, 0, 757 this_frag, 0,
757 this_frag->size, 758 skb_frag_size(this_frag),
758 DMA_TO_DEVICE); 759 DMA_TO_DEVICE);
759 } 760 }
760} 761}
diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c
index 297730359b79..c7b60839ac99 100644
--- a/drivers/net/ethernet/marvell/skge.c
+++ b/drivers/net/ethernet/marvell/skge.c
@@ -2770,10 +2770,10 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
2770 2770
2771 control |= BMU_STFWD; 2771 control |= BMU_STFWD;
2772 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 2772 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
2773 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 2773 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
2774 2774
2775 map = skb_frag_dma_map(&hw->pdev->dev, frag, 0, 2775 map = skb_frag_dma_map(&hw->pdev->dev, frag, 0,
2776 frag->size, DMA_TO_DEVICE); 2776 skb_frag_size(frag), DMA_TO_DEVICE);
2777 2777
2778 e = e->next; 2778 e = e->next;
2779 e->skb = skb; 2779 e->skb = skb;
@@ -2783,9 +2783,9 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
2783 tf->dma_lo = map; 2783 tf->dma_lo = map;
2784 tf->dma_hi = (u64) map >> 32; 2784 tf->dma_hi = (u64) map >> 32;
2785 dma_unmap_addr_set(e, mapaddr, map); 2785 dma_unmap_addr_set(e, mapaddr, map);
2786 dma_unmap_len_set(e, maplen, frag->size); 2786 dma_unmap_len_set(e, maplen, skb_frag_size(frag));
2787 2787
2788 tf->control = BMU_OWN | BMU_SW | control | frag->size; 2788 tf->control = BMU_OWN | BMU_SW | control | skb_frag_size(frag);
2789 } 2789 }
2790 tf->control |= BMU_EOF | BMU_IRQ_EOF; 2790 tf->control |= BMU_EOF | BMU_IRQ_EOF;
2791 } 2791 }
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index 92634907bf8d..7b083c438a14 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -1225,10 +1225,10 @@ static int sky2_rx_map_skb(struct pci_dev *pdev, struct rx_ring_info *re,
1225 dma_unmap_len_set(re, data_size, size); 1225 dma_unmap_len_set(re, data_size, size);
1226 1226
1227 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 1227 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
1228 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 1228 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
1229 1229
1230 re->frag_addr[i] = skb_frag_dma_map(&pdev->dev, frag, 0, 1230 re->frag_addr[i] = skb_frag_dma_map(&pdev->dev, frag, 0,
1231 frag->size, 1231 skb_frag_size(frag),
1232 DMA_FROM_DEVICE); 1232 DMA_FROM_DEVICE);
1233 1233
1234 if (dma_mapping_error(&pdev->dev, re->frag_addr[i])) 1234 if (dma_mapping_error(&pdev->dev, re->frag_addr[i]))
@@ -1239,7 +1239,7 @@ static int sky2_rx_map_skb(struct pci_dev *pdev, struct rx_ring_info *re,
1239map_page_error: 1239map_page_error:
1240 while (--i >= 0) { 1240 while (--i >= 0) {
1241 pci_unmap_page(pdev, re->frag_addr[i], 1241 pci_unmap_page(pdev, re->frag_addr[i],
1242 skb_shinfo(skb)->frags[i].size, 1242 skb_frag_size(&skb_shinfo(skb)->frags[i]),
1243 PCI_DMA_FROMDEVICE); 1243 PCI_DMA_FROMDEVICE);
1244 } 1244 }
1245 1245
@@ -1263,7 +1263,7 @@ static void sky2_rx_unmap_skb(struct pci_dev *pdev, struct rx_ring_info *re)
1263 1263
1264 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) 1264 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
1265 pci_unmap_page(pdev, re->frag_addr[i], 1265 pci_unmap_page(pdev, re->frag_addr[i],
1266 skb_shinfo(skb)->frags[i].size, 1266 skb_frag_size(&skb_shinfo(skb)->frags[i]),
1267 PCI_DMA_FROMDEVICE); 1267 PCI_DMA_FROMDEVICE);
1268} 1268}
1269 1269
@@ -1936,7 +1936,7 @@ static netdev_tx_t sky2_xmit_frame(struct sk_buff *skb,
1936 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 1936 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
1937 1937
1938 mapping = skb_frag_dma_map(&hw->pdev->dev, frag, 0, 1938 mapping = skb_frag_dma_map(&hw->pdev->dev, frag, 0,
1939 frag->size, DMA_TO_DEVICE); 1939 skb_frag_size(frag), DMA_TO_DEVICE);
1940 1940
1941 if (dma_mapping_error(&hw->pdev->dev, mapping)) 1941 if (dma_mapping_error(&hw->pdev->dev, mapping))
1942 goto mapping_unwind; 1942 goto mapping_unwind;
@@ -1952,11 +1952,11 @@ static netdev_tx_t sky2_xmit_frame(struct sk_buff *skb,
1952 re = sky2->tx_ring + slot; 1952 re = sky2->tx_ring + slot;
1953 re->flags = TX_MAP_PAGE; 1953 re->flags = TX_MAP_PAGE;
1954 dma_unmap_addr_set(re, mapaddr, mapping); 1954 dma_unmap_addr_set(re, mapaddr, mapping);
1955 dma_unmap_len_set(re, maplen, frag->size); 1955 dma_unmap_len_set(re, maplen, skb_frag_size(frag));
1956 1956
1957 le = get_tx_le(sky2, &slot); 1957 le = get_tx_le(sky2, &slot);
1958 le->addr = cpu_to_le32(lower_32_bits(mapping)); 1958 le->addr = cpu_to_le32(lower_32_bits(mapping));
1959 le->length = cpu_to_le16(frag->size); 1959 le->length = cpu_to_le16(skb_frag_size(frag));
1960 le->ctrl = ctrl; 1960 le->ctrl = ctrl;
1961 le->opcode = OP_BUFFER | HW_OWNER; 1961 le->opcode = OP_BUFFER | HW_OWNER;
1962 } 1962 }
@@ -2484,7 +2484,7 @@ static void skb_put_frags(struct sk_buff *skb, unsigned int hdr_space,
2484 } else { 2484 } else {
2485 size = min(length, (unsigned) PAGE_SIZE); 2485 size = min(length, (unsigned) PAGE_SIZE);
2486 2486
2487 frag->size = size; 2487 skb_frag_size_set(frag, size);
2488 skb->data_len += size; 2488 skb->data_len += size;
2489 skb->truesize += PAGE_SIZE; 2489 skb->truesize += PAGE_SIZE;
2490 skb->len += size; 2490 skb->len += size;
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index 37cc9e5c56be..46a0df9afc3c 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -135,7 +135,7 @@ static void mlx4_en_init_rx_desc(struct mlx4_en_priv *priv,
135 135
136 /* Set size and memtype fields */ 136 /* Set size and memtype fields */
137 for (i = 0; i < priv->num_frags; i++) { 137 for (i = 0; i < priv->num_frags; i++) {
138 skb_frags[i].size = priv->frag_info[i].frag_size; 138 skb_frag_size_set(&skb_frags[i], priv->frag_info[i].frag_size);
139 rx_desc->data[i].byte_count = 139 rx_desc->data[i].byte_count =
140 cpu_to_be32(priv->frag_info[i].frag_size); 140 cpu_to_be32(priv->frag_info[i].frag_size);
141 rx_desc->data[i].lkey = cpu_to_be32(priv->mdev->mr.key); 141 rx_desc->data[i].lkey = cpu_to_be32(priv->mdev->mr.key);
@@ -194,7 +194,7 @@ static void mlx4_en_free_rx_desc(struct mlx4_en_priv *priv,
194 dma = be64_to_cpu(rx_desc->data[nr].addr); 194 dma = be64_to_cpu(rx_desc->data[nr].addr);
195 195
196 en_dbg(DRV, priv, "Unmapping buffer at dma:0x%llx\n", (u64) dma); 196 en_dbg(DRV, priv, "Unmapping buffer at dma:0x%llx\n", (u64) dma);
197 pci_unmap_single(mdev->pdev, dma, skb_frags[nr].size, 197 pci_unmap_single(mdev->pdev, dma, skb_frag_size(&skb_frags[nr]),
198 PCI_DMA_FROMDEVICE); 198 PCI_DMA_FROMDEVICE);
199 put_page(skb_frags[nr].page); 199 put_page(skb_frags[nr].page);
200 } 200 }
@@ -421,7 +421,7 @@ static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv,
421 421
422 /* Save page reference in skb */ 422 /* Save page reference in skb */
423 skb_frags_rx[nr].page = skb_frags[nr].page; 423 skb_frags_rx[nr].page = skb_frags[nr].page;
424 skb_frags_rx[nr].size = skb_frags[nr].size; 424 skb_frag_size_set(&skb_frags_rx[nr], skb_frag_size(&skb_frags[nr]));
425 skb_frags_rx[nr].page_offset = skb_frags[nr].page_offset; 425 skb_frags_rx[nr].page_offset = skb_frags[nr].page_offset;
426 dma = be64_to_cpu(rx_desc->data[nr].addr); 426 dma = be64_to_cpu(rx_desc->data[nr].addr);
427 427
@@ -430,13 +430,13 @@ static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv,
430 goto fail; 430 goto fail;
431 431
432 /* Unmap buffer */ 432 /* Unmap buffer */
433 pci_unmap_single(mdev->pdev, dma, skb_frags_rx[nr].size, 433 pci_unmap_single(mdev->pdev, dma, skb_frag_size(&skb_frags_rx[nr]),
434 PCI_DMA_FROMDEVICE); 434 PCI_DMA_FROMDEVICE);
435 } 435 }
436 /* Adjust size of last fragment to match actual length */ 436 /* Adjust size of last fragment to match actual length */
437 if (nr > 0) 437 if (nr > 0)
438 skb_frags_rx[nr - 1].size = length - 438 skb_frag_size_set(&skb_frags_rx[nr - 1],
439 priv->frag_info[nr - 1].frag_prefix_size; 439 length - priv->frag_info[nr - 1].frag_prefix_size);
440 return nr; 440 return nr;
441 441
442fail: 442fail:
@@ -506,7 +506,7 @@ static struct sk_buff *mlx4_en_rx_skb(struct mlx4_en_priv *priv,
506 skb_shinfo(skb)->frags[0].page_offset += HEADER_COPY_SIZE; 506 skb_shinfo(skb)->frags[0].page_offset += HEADER_COPY_SIZE;
507 507
508 /* Adjust size of first fragment */ 508 /* Adjust size of first fragment */
509 skb_shinfo(skb)->frags[0].size -= HEADER_COPY_SIZE; 509 skb_frag_size_sub(&skb_shinfo(skb)->frags[0], HEADER_COPY_SIZE);
510 skb->data_len = length - HEADER_COPY_SIZE; 510 skb->data_len = length - HEADER_COPY_SIZE;
511 } 511 }
512 return skb; 512 return skb;
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
index 6e03de034ac7..2a192c2f207d 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
@@ -226,7 +226,7 @@ static u32 mlx4_en_free_tx_desc(struct mlx4_en_priv *priv,
226 frag = &skb_shinfo(skb)->frags[i]; 226 frag = &skb_shinfo(skb)->frags[i];
227 pci_unmap_page(mdev->pdev, 227 pci_unmap_page(mdev->pdev,
228 (dma_addr_t) be64_to_cpu(data[i].addr), 228 (dma_addr_t) be64_to_cpu(data[i].addr),
229 frag->size, PCI_DMA_TODEVICE); 229 skb_frag_size(frag), PCI_DMA_TODEVICE);
230 } 230 }
231 } 231 }
232 /* Stamp the freed descriptor */ 232 /* Stamp the freed descriptor */
@@ -256,7 +256,7 @@ static u32 mlx4_en_free_tx_desc(struct mlx4_en_priv *priv,
256 frag = &skb_shinfo(skb)->frags[i]; 256 frag = &skb_shinfo(skb)->frags[i];
257 pci_unmap_page(mdev->pdev, 257 pci_unmap_page(mdev->pdev,
258 (dma_addr_t) be64_to_cpu(data->addr), 258 (dma_addr_t) be64_to_cpu(data->addr),
259 frag->size, PCI_DMA_TODEVICE); 259 skb_frag_size(frag), PCI_DMA_TODEVICE);
260 ++data; 260 ++data;
261 } 261 }
262 } 262 }
@@ -550,7 +550,7 @@ static void build_inline_wqe(struct mlx4_en_tx_desc *tx_desc, struct sk_buff *sk
550 skb_copy_from_linear_data(skb, inl + 1, skb_headlen(skb)); 550 skb_copy_from_linear_data(skb, inl + 1, skb_headlen(skb));
551 if (skb_shinfo(skb)->nr_frags) 551 if (skb_shinfo(skb)->nr_frags)
552 memcpy(((void *)(inl + 1)) + skb_headlen(skb), fragptr, 552 memcpy(((void *)(inl + 1)) + skb_headlen(skb), fragptr,
553 skb_shinfo(skb)->frags[0].size); 553 skb_frag_size(&skb_shinfo(skb)->frags[0]));
554 554
555 } else { 555 } else {
556 inl->byte_count = cpu_to_be32(1 << 31 | spc); 556 inl->byte_count = cpu_to_be32(1 << 31 | spc);
@@ -570,7 +570,7 @@ static void build_inline_wqe(struct mlx4_en_tx_desc *tx_desc, struct sk_buff *sk
570 skb_headlen(skb) - spc); 570 skb_headlen(skb) - spc);
571 if (skb_shinfo(skb)->nr_frags) 571 if (skb_shinfo(skb)->nr_frags)
572 memcpy(((void *)(inl + 1)) + skb_headlen(skb) - spc, 572 memcpy(((void *)(inl + 1)) + skb_headlen(skb) - spc,
573 fragptr, skb_shinfo(skb)->frags[0].size); 573 fragptr, skb_frag_size(&skb_shinfo(skb)->frags[0]));
574 } 574 }
575 575
576 wmb(); 576 wmb();
@@ -757,11 +757,11 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
757 for (i = skb_shinfo(skb)->nr_frags - 1; i >= 0; i--) { 757 for (i = skb_shinfo(skb)->nr_frags - 1; i >= 0; i--) {
758 frag = &skb_shinfo(skb)->frags[i]; 758 frag = &skb_shinfo(skb)->frags[i];
759 dma = pci_map_page(mdev->dev->pdev, frag->page, frag->page_offset, 759 dma = pci_map_page(mdev->dev->pdev, frag->page, frag->page_offset,
760 frag->size, PCI_DMA_TODEVICE); 760 skb_frag_size(frag), PCI_DMA_TODEVICE);
761 data->addr = cpu_to_be64(dma); 761 data->addr = cpu_to_be64(dma);
762 data->lkey = cpu_to_be32(mdev->mr.key); 762 data->lkey = cpu_to_be32(mdev->mr.key);
763 wmb(); 763 wmb();
764 data->byte_count = cpu_to_be32(frag->size); 764 data->byte_count = cpu_to_be32(skb_frag_size(frag));
765 --data; 765 --data;
766 } 766 }
767 767
diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c
index 710c4aead146..7ece990381c8 100644
--- a/drivers/net/ethernet/micrel/ksz884x.c
+++ b/drivers/net/ethernet/micrel/ksz884x.c
@@ -4700,7 +4700,7 @@ static void send_packet(struct sk_buff *skb, struct net_device *dev)
4700 ++hw->tx_int_cnt; 4700 ++hw->tx_int_cnt;
4701 4701
4702 dma_buf = DMA_BUFFER(desc); 4702 dma_buf = DMA_BUFFER(desc);
4703 dma_buf->len = this_frag->size; 4703 dma_buf->len = skb_frag_size(this_frag);
4704 4704
4705 dma_buf->dma = pci_map_single( 4705 dma_buf->dma = pci_map_single(
4706 hw_priv->pdev, 4706 hw_priv->pdev,
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
index 26637279cd67..c970a48436dc 100644
--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -1216,7 +1216,7 @@ myri10ge_rx_skb_build(struct sk_buff *skb, u8 * va,
1216 skb_frags = skb_shinfo(skb)->frags; 1216 skb_frags = skb_shinfo(skb)->frags;
1217 while (len > 0) { 1217 while (len > 0) {
1218 memcpy(skb_frags, rx_frags, sizeof(*skb_frags)); 1218 memcpy(skb_frags, rx_frags, sizeof(*skb_frags));
1219 len -= rx_frags->size; 1219 len -= skb_frag_size(rx_frags);
1220 skb_frags++; 1220 skb_frags++;
1221 rx_frags++; 1221 rx_frags++;
1222 skb_shinfo(skb)->nr_frags++; 1222 skb_shinfo(skb)->nr_frags++;
@@ -1228,7 +1228,7 @@ myri10ge_rx_skb_build(struct sk_buff *skb, u8 * va,
1228 * manually */ 1228 * manually */
1229 skb_copy_to_linear_data(skb, va, hlen); 1229 skb_copy_to_linear_data(skb, va, hlen);
1230 skb_shinfo(skb)->frags[0].page_offset += hlen; 1230 skb_shinfo(skb)->frags[0].page_offset += hlen;
1231 skb_shinfo(skb)->frags[0].size -= hlen; 1231 skb_frag_size_sub(&skb_shinfo(skb)->frags[0], hlen);
1232 skb->data_len -= hlen; 1232 skb->data_len -= hlen;
1233 skb->tail += hlen; 1233 skb->tail += hlen;
1234 skb_pull(skb, MXGEFW_PAD); 1234 skb_pull(skb, MXGEFW_PAD);
@@ -1345,9 +1345,9 @@ myri10ge_rx_done(struct myri10ge_slice_state *ss, int len, __wsum csum,
1345 __skb_frag_set_page(&rx_frags[i], rx->info[idx].page); 1345 __skb_frag_set_page(&rx_frags[i], rx->info[idx].page);
1346 rx_frags[i].page_offset = rx->info[idx].page_offset; 1346 rx_frags[i].page_offset = rx->info[idx].page_offset;
1347 if (remainder < MYRI10GE_ALLOC_SIZE) 1347 if (remainder < MYRI10GE_ALLOC_SIZE)
1348 rx_frags[i].size = remainder; 1348 skb_frag_size_set(&rx_frags[i], remainder);
1349 else 1349 else
1350 rx_frags[i].size = MYRI10GE_ALLOC_SIZE; 1350 skb_frag_size_set(&rx_frags[i], MYRI10GE_ALLOC_SIZE);
1351 rx->cnt++; 1351 rx->cnt++;
1352 idx = rx->cnt & rx->mask; 1352 idx = rx->cnt & rx->mask;
1353 remainder -= MYRI10GE_ALLOC_SIZE; 1353 remainder -= MYRI10GE_ALLOC_SIZE;
@@ -1355,7 +1355,7 @@ myri10ge_rx_done(struct myri10ge_slice_state *ss, int len, __wsum csum,
1355 1355
1356 if (lro_enabled) { 1356 if (lro_enabled) {
1357 rx_frags[0].page_offset += MXGEFW_PAD; 1357 rx_frags[0].page_offset += MXGEFW_PAD;
1358 rx_frags[0].size -= MXGEFW_PAD; 1358 skb_frag_size_sub(&rx_frags[0], MXGEFW_PAD);
1359 len -= MXGEFW_PAD; 1359 len -= MXGEFW_PAD;
1360 lro_receive_frags(&ss->rx_done.lro_mgr, rx_frags, 1360 lro_receive_frags(&ss->rx_done.lro_mgr, rx_frags,
1361 /* opaque, will come back in get_frag_header */ 1361 /* opaque, will come back in get_frag_header */
@@ -1382,7 +1382,7 @@ myri10ge_rx_done(struct myri10ge_slice_state *ss, int len, __wsum csum,
1382 1382
1383 /* Attach the pages to the skb, and trim off any padding */ 1383 /* Attach the pages to the skb, and trim off any padding */
1384 myri10ge_rx_skb_build(skb, va, rx_frags, len, hlen); 1384 myri10ge_rx_skb_build(skb, va, rx_frags, len, hlen);
1385 if (skb_shinfo(skb)->frags[0].size <= 0) { 1385 if (skb_frag_size(&skb_shinfo(skb)->frags[0]) <= 0) {
1386 skb_frag_unref(skb, 0); 1386 skb_frag_unref(skb, 0);
1387 skb_shinfo(skb)->nr_frags = 0; 1387 skb_shinfo(skb)->nr_frags = 0;
1388 } 1388 }
@@ -2926,7 +2926,7 @@ again:
2926 idx = (count + tx->req) & tx->mask; 2926 idx = (count + tx->req) & tx->mask;
2927 frag = &skb_shinfo(skb)->frags[frag_idx]; 2927 frag = &skb_shinfo(skb)->frags[frag_idx];
2928 frag_idx++; 2928 frag_idx++;
2929 len = frag->size; 2929 len = skb_frag_size(frag);
2930 bus = skb_frag_dma_map(&mgp->pdev->dev, frag, 0, len, 2930 bus = skb_frag_dma_map(&mgp->pdev->dev, frag, 0, len,
2931 DMA_TO_DEVICE); 2931 DMA_TO_DEVICE);
2932 dma_unmap_addr_set(&tx->info[idx], bus, bus); 2932 dma_unmap_addr_set(&tx->info[idx], bus, bus);
diff --git a/drivers/net/ethernet/natsemi/ns83820.c b/drivers/net/ethernet/natsemi/ns83820.c
index 73616b911327..2b8f64ddfb55 100644
--- a/drivers/net/ethernet/natsemi/ns83820.c
+++ b/drivers/net/ethernet/natsemi/ns83820.c
@@ -1161,11 +1161,11 @@ again:
1161 break; 1161 break;
1162 1162
1163 buf = skb_frag_dma_map(&dev->pci_dev->dev, frag, 0, 1163 buf = skb_frag_dma_map(&dev->pci_dev->dev, frag, 0,
1164 frag->size, DMA_TO_DEVICE); 1164 skb_frag_size(frag), DMA_TO_DEVICE);
1165 dprintk("frag: buf=%08Lx page=%08lx offset=%08lx\n", 1165 dprintk("frag: buf=%08Lx page=%08lx offset=%08lx\n",
1166 (long long)buf, (long) page_to_pfn(frag->page), 1166 (long long)buf, (long) page_to_pfn(frag->page),
1167 frag->page_offset); 1167 frag->page_offset);
1168 len = frag->size; 1168 len = skb_frag_size(frag);
1169 frag++; 1169 frag++;
1170 nr_frags--; 1170 nr_frags--;
1171 } 1171 }
diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
index bdd3e6a330cd..c27fb3dda9f4 100644
--- a/drivers/net/ethernet/neterion/s2io.c
+++ b/drivers/net/ethernet/neterion/s2io.c
@@ -2350,12 +2350,12 @@ static struct sk_buff *s2io_txdl_getskb(struct fifo_info *fifo_data,
2350 if (frg_cnt) { 2350 if (frg_cnt) {
2351 txds++; 2351 txds++;
2352 for (j = 0; j < frg_cnt; j++, txds++) { 2352 for (j = 0; j < frg_cnt; j++, txds++) {
2353 skb_frag_t *frag = &skb_shinfo(skb)->frags[j]; 2353 const skb_frag_t *frag = &skb_shinfo(skb)->frags[j];
2354 if (!txds->Buffer_Pointer) 2354 if (!txds->Buffer_Pointer)
2355 break; 2355 break;
2356 pci_unmap_page(nic->pdev, 2356 pci_unmap_page(nic->pdev,
2357 (dma_addr_t)txds->Buffer_Pointer, 2357 (dma_addr_t)txds->Buffer_Pointer,
2358 frag->size, PCI_DMA_TODEVICE); 2358 skb_frag_size(frag), PCI_DMA_TODEVICE);
2359 } 2359 }
2360 } 2360 }
2361 memset(txdlp, 0, (sizeof(struct TxD) * fifo_data->max_txds)); 2361 memset(txdlp, 0, (sizeof(struct TxD) * fifo_data->max_txds));
@@ -4185,16 +4185,16 @@ static netdev_tx_t s2io_xmit(struct sk_buff *skb, struct net_device *dev)
4185 frg_cnt = skb_shinfo(skb)->nr_frags; 4185 frg_cnt = skb_shinfo(skb)->nr_frags;
4186 /* For fragmented SKB. */ 4186 /* For fragmented SKB. */
4187 for (i = 0; i < frg_cnt; i++) { 4187 for (i = 0; i < frg_cnt; i++) {
4188 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 4188 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
4189 /* A '0' length fragment will be ignored */ 4189 /* A '0' length fragment will be ignored */
4190 if (!frag->size) 4190 if (!skb_frag_size(frag))
4191 continue; 4191 continue;
4192 txdp++; 4192 txdp++;
4193 txdp->Buffer_Pointer = (u64)skb_frag_dma_map(&sp->pdev->dev, 4193 txdp->Buffer_Pointer = (u64)skb_frag_dma_map(&sp->pdev->dev,
4194 frag, 0, 4194 frag, 0,
4195 frag->size, 4195 skb_frag_size(frag),
4196 DMA_TO_DEVICE); 4196 DMA_TO_DEVICE);
4197 txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size); 4197 txdp->Control_1 = TXD_BUFFER0_SIZE(skb_frag_size(frag));
4198 if (offload_type == SKB_GSO_UDP) 4198 if (offload_type == SKB_GSO_UDP)
4199 txdp->Control_1 |= TXD_UFO_EN; 4199 txdp->Control_1 |= TXD_UFO_EN;
4200 } 4200 }
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c
index a66f8fc0401e..671e166b5af1 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-main.c
+++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c
@@ -585,7 +585,7 @@ vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr,
585 for (j = 0; j < frg_cnt; j++) { 585 for (j = 0; j < frg_cnt; j++) {
586 pci_unmap_page(fifo->pdev, 586 pci_unmap_page(fifo->pdev,
587 txd_priv->dma_buffers[i++], 587 txd_priv->dma_buffers[i++],
588 frag->size, PCI_DMA_TODEVICE); 588 skb_frag_size(frag), PCI_DMA_TODEVICE);
589 frag += 1; 589 frag += 1;
590 } 590 }
591 591
@@ -920,11 +920,11 @@ vxge_xmit(struct sk_buff *skb, struct net_device *dev)
920 frag = &skb_shinfo(skb)->frags[0]; 920 frag = &skb_shinfo(skb)->frags[0];
921 for (i = 0; i < frg_cnt; i++) { 921 for (i = 0; i < frg_cnt; i++) {
922 /* ignore 0 length fragment */ 922 /* ignore 0 length fragment */
923 if (!frag->size) 923 if (!skb_frag_size(frag))
924 continue; 924 continue;
925 925
926 dma_pointer = (u64)skb_frag_dma_map(&fifo->pdev->dev, frag, 926 dma_pointer = (u64)skb_frag_dma_map(&fifo->pdev->dev, frag,
927 0, frag->size, 927 0, skb_frag_size(frag),
928 DMA_TO_DEVICE); 928 DMA_TO_DEVICE);
929 929
930 if (unlikely(dma_mapping_error(&fifo->pdev->dev, dma_pointer))) 930 if (unlikely(dma_mapping_error(&fifo->pdev->dev, dma_pointer)))
@@ -936,7 +936,7 @@ vxge_xmit(struct sk_buff *skb, struct net_device *dev)
936 936
937 txdl_priv->dma_buffers[j] = dma_pointer; 937 txdl_priv->dma_buffers[j] = dma_pointer;
938 vxge_hw_fifo_txdl_buffer_set(fifo_hw, dtr, j++, dma_pointer, 938 vxge_hw_fifo_txdl_buffer_set(fifo_hw, dtr, j++, dma_pointer,
939 frag->size); 939 skb_frag_size(frag));
940 frag += 1; 940 frag += 1;
941 } 941 }
942 942
@@ -979,7 +979,7 @@ _exit1:
979 979
980 for (; j < i; j++) { 980 for (; j < i; j++) {
981 pci_unmap_page(fifo->pdev, txdl_priv->dma_buffers[j], 981 pci_unmap_page(fifo->pdev, txdl_priv->dma_buffers[j],
982 frag->size, PCI_DMA_TODEVICE); 982 skb_frag_size(frag), PCI_DMA_TODEVICE);
983 frag += 1; 983 frag += 1;
984 } 984 }
985 985
@@ -1050,7 +1050,7 @@ vxge_tx_term(void *dtrh, enum vxge_hw_txdl_state state, void *userdata)
1050 1050
1051 for (j = 0; j < frg_cnt; j++) { 1051 for (j = 0; j < frg_cnt; j++) {
1052 pci_unmap_page(fifo->pdev, txd_priv->dma_buffers[i++], 1052 pci_unmap_page(fifo->pdev, txd_priv->dma_buffers[i++],
1053 frag->size, PCI_DMA_TODEVICE); 1053 skb_frag_size(frag), PCI_DMA_TODEVICE);
1054 frag += 1; 1054 frag += 1;
1055 } 1055 }
1056 1056
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index d7763ab841d8..1e37eb98c4e2 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -2099,8 +2099,10 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
2099 2099
2100 /* add fragments to entries count */ 2100 /* add fragments to entries count */
2101 for (i = 0; i < fragments; i++) { 2101 for (i = 0; i < fragments; i++) {
2102 entries += (skb_shinfo(skb)->frags[i].size >> NV_TX2_TSO_MAX_SHIFT) + 2102 u32 size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
2103 ((skb_shinfo(skb)->frags[i].size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0); 2103
2104 entries += (size >> NV_TX2_TSO_MAX_SHIFT) +
2105 ((size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0);
2104 } 2106 }
2105 2107
2106 spin_lock_irqsave(&np->lock, flags); 2108 spin_lock_irqsave(&np->lock, flags);
@@ -2138,8 +2140,8 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
2138 2140
2139 /* setup the fragments */ 2141 /* setup the fragments */
2140 for (i = 0; i < fragments; i++) { 2142 for (i = 0; i < fragments; i++) {
2141 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 2143 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
2142 u32 size = frag->size; 2144 u32 size = skb_frag_size(frag);
2143 offset = 0; 2145 offset = 0;
2144 2146
2145 do { 2147 do {
@@ -2211,8 +2213,10 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,
2211 2213
2212 /* add fragments to entries count */ 2214 /* add fragments to entries count */
2213 for (i = 0; i < fragments; i++) { 2215 for (i = 0; i < fragments; i++) {
2214 entries += (skb_shinfo(skb)->frags[i].size >> NV_TX2_TSO_MAX_SHIFT) + 2216 u32 size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
2215 ((skb_shinfo(skb)->frags[i].size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0); 2217
2218 entries += (size >> NV_TX2_TSO_MAX_SHIFT) +
2219 ((size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0);
2216 } 2220 }
2217 2221
2218 spin_lock_irqsave(&np->lock, flags); 2222 spin_lock_irqsave(&np->lock, flags);
@@ -2253,7 +2257,7 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,
2253 /* setup the fragments */ 2257 /* setup the fragments */
2254 for (i = 0; i < fragments; i++) { 2258 for (i = 0; i < fragments; i++) {
2255 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 2259 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
2256 u32 size = frag->size; 2260 u32 size = skb_frag_size(frag);
2257 offset = 0; 2261 offset = 0;
2258 2262
2259 do { 2263 do {
diff --git a/drivers/net/ethernet/pasemi/pasemi_mac.c b/drivers/net/ethernet/pasemi/pasemi_mac.c
index c6f005684677..49b549ff2c78 100644
--- a/drivers/net/ethernet/pasemi/pasemi_mac.c
+++ b/drivers/net/ethernet/pasemi/pasemi_mac.c
@@ -300,9 +300,9 @@ static int pasemi_mac_unmap_tx_skb(struct pasemi_mac *mac,
300 pci_unmap_single(pdev, dmas[0], skb_headlen(skb), PCI_DMA_TODEVICE); 300 pci_unmap_single(pdev, dmas[0], skb_headlen(skb), PCI_DMA_TODEVICE);
301 301
302 for (f = 0; f < nfrags; f++) { 302 for (f = 0; f < nfrags; f++) {
303 skb_frag_t *frag = &skb_shinfo(skb)->frags[f]; 303 const skb_frag_t *frag = &skb_shinfo(skb)->frags[f];
304 304
305 pci_unmap_page(pdev, dmas[f+1], frag->size, PCI_DMA_TODEVICE); 305 pci_unmap_page(pdev, dmas[f+1], skb_frag_size(frag), PCI_DMA_TODEVICE);
306 } 306 }
307 dev_kfree_skb_irq(skb); 307 dev_kfree_skb_irq(skb);
308 308
@@ -1506,8 +1506,8 @@ static int pasemi_mac_start_tx(struct sk_buff *skb, struct net_device *dev)
1506 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 1506 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
1507 1507
1508 map[i + 1] = skb_frag_dma_map(&mac->dma_pdev->dev, frag, 0, 1508 map[i + 1] = skb_frag_dma_map(&mac->dma_pdev->dev, frag, 0,
1509 frag->size, DMA_TO_DEVICE); 1509 skb_frag_size(frag), DMA_TO_DEVICE);
1510 map_size[i+1] = frag->size; 1510 map_size[i+1] = skb_frag_size(frag);
1511 if (dma_mapping_error(&mac->dma_pdev->dev, map[i + 1])) { 1511 if (dma_mapping_error(&mac->dma_pdev->dev, map[i + 1])) {
1512 nfrags = i; 1512 nfrags = i;
1513 goto out_err_nolock; 1513 goto out_err_nolock;
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index e2ba78be1c2a..8cf3173ba488 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -1905,13 +1905,13 @@ netxen_map_tx_skb(struct pci_dev *pdev,
1905 frag = &skb_shinfo(skb)->frags[i]; 1905 frag = &skb_shinfo(skb)->frags[i];
1906 nf = &pbuf->frag_array[i+1]; 1906 nf = &pbuf->frag_array[i+1];
1907 1907
1908 map = skb_frag_dma_map(&pdev->dev, frag, 0, frag->size, 1908 map = skb_frag_dma_map(&pdev->dev, frag, 0, skb_frag_size(frag),
1909 DMA_TO_DEVICE); 1909 DMA_TO_DEVICE);
1910 if (dma_mapping_error(&pdev->dev, map)) 1910 if (dma_mapping_error(&pdev->dev, map))
1911 goto unwind; 1911 goto unwind;
1912 1912
1913 nf->dma = map; 1913 nf->dma = map;
1914 nf->length = frag->size; 1914 nf->length = skb_frag_size(frag);
1915 } 1915 }
1916 1916
1917 return 0; 1917 return 0;
@@ -1962,7 +1962,7 @@ netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1962 1962
1963 for (i = 0; i < (frag_count - NETXEN_MAX_FRAGS_PER_TX); i++) { 1963 for (i = 0; i < (frag_count - NETXEN_MAX_FRAGS_PER_TX); i++) {
1964 frag = &skb_shinfo(skb)->frags[i]; 1964 frag = &skb_shinfo(skb)->frags[i];
1965 delta += frag->size; 1965 delta += skb_frag_size(frag);
1966 } 1966 }
1967 1967
1968 if (!__pskb_pull_tail(skb, delta)) 1968 if (!__pskb_pull_tail(skb, delta))
diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c
index 46f9b6499f9b..a4bdff438a5e 100644
--- a/drivers/net/ethernet/qlogic/qla3xxx.c
+++ b/drivers/net/ethernet/qlogic/qla3xxx.c
@@ -2388,7 +2388,7 @@ static int ql_send_map(struct ql3_adapter *qdev,
2388 seg++; 2388 seg++;
2389 } 2389 }
2390 2390
2391 map = skb_frag_dma_map(&qdev->pdev->dev, frag, 0, frag->size, 2391 map = skb_frag_dma_map(&qdev->pdev->dev, frag, 0, skb_frag_size(frag),
2392 DMA_TO_DEVICE); 2392 DMA_TO_DEVICE);
2393 2393
2394 err = dma_mapping_error(&qdev->pdev->dev, map); 2394 err = dma_mapping_error(&qdev->pdev->dev, map);
@@ -2401,9 +2401,9 @@ static int ql_send_map(struct ql3_adapter *qdev,
2401 2401
2402 oal_entry->dma_lo = cpu_to_le32(LS_64BITS(map)); 2402 oal_entry->dma_lo = cpu_to_le32(LS_64BITS(map));
2403 oal_entry->dma_hi = cpu_to_le32(MS_64BITS(map)); 2403 oal_entry->dma_hi = cpu_to_le32(MS_64BITS(map));
2404 oal_entry->len = cpu_to_le32(frag->size); 2404 oal_entry->len = cpu_to_le32(skb_frag_size(frag));
2405 dma_unmap_addr_set(&tx_cb->map[seg], mapaddr, map); 2405 dma_unmap_addr_set(&tx_cb->map[seg], mapaddr, map);
2406 dma_unmap_len_set(&tx_cb->map[seg], maplen, frag->size); 2406 dma_unmap_len_set(&tx_cb->map[seg], maplen, skb_frag_size(frag));
2407 } 2407 }
2408 /* Terminate the last segment. */ 2408 /* Terminate the last segment. */
2409 oal_entry->len |= cpu_to_le32(OAL_LAST_ENTRY); 2409 oal_entry->len |= cpu_to_le32(OAL_LAST_ENTRY);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index eac19e7d2761..106503f118f6 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -2135,13 +2135,13 @@ qlcnic_map_tx_skb(struct pci_dev *pdev,
2135 frag = &skb_shinfo(skb)->frags[i]; 2135 frag = &skb_shinfo(skb)->frags[i];
2136 nf = &pbuf->frag_array[i+1]; 2136 nf = &pbuf->frag_array[i+1];
2137 2137
2138 map = skb_frag_dma_map(&pdev->dev, frag, 0, frag->size, 2138 map = skb_frag_dma_map(&pdev->dev, frag, 0, skb_frag_size(frag),
2139 DMA_TO_DEVICE); 2139 DMA_TO_DEVICE);
2140 if (dma_mapping_error(&pdev->dev, map)) 2140 if (dma_mapping_error(&pdev->dev, map))
2141 goto unwind; 2141 goto unwind;
2142 2142
2143 nf->dma = map; 2143 nf->dma = map;
2144 nf->length = frag->size; 2144 nf->length = skb_frag_size(frag);
2145 } 2145 }
2146 2146
2147 return 0; 2147 return 0;
@@ -2221,7 +2221,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
2221 if (!skb_is_gso(skb) && frag_count > QLCNIC_MAX_FRAGS_PER_TX) { 2221 if (!skb_is_gso(skb) && frag_count > QLCNIC_MAX_FRAGS_PER_TX) {
2222 2222
2223 for (i = 0; i < (frag_count - QLCNIC_MAX_FRAGS_PER_TX); i++) 2223 for (i = 0; i < (frag_count - QLCNIC_MAX_FRAGS_PER_TX); i++)
2224 delta += skb_shinfo(skb)->frags[i].size; 2224 delta += skb_frag_size(&skb_shinfo(skb)->frags[i]);
2225 2225
2226 if (!__pskb_pull_tail(skb, delta)) 2226 if (!__pskb_pull_tail(skb, delta))
2227 goto drop_packet; 2227 goto drop_packet;
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
index f2d9bb78ec7f..c92afcd912e2 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
@@ -1431,7 +1431,7 @@ static int ql_map_send(struct ql_adapter *qdev,
1431 map_idx++; 1431 map_idx++;
1432 } 1432 }
1433 1433
1434 map = skb_frag_dma_map(&qdev->pdev->dev, frag, 0, frag->size, 1434 map = skb_frag_dma_map(&qdev->pdev->dev, frag, 0, skb_frag_size(frag),
1435 DMA_TO_DEVICE); 1435 DMA_TO_DEVICE);
1436 1436
1437 err = dma_mapping_error(&qdev->pdev->dev, map); 1437 err = dma_mapping_error(&qdev->pdev->dev, map);
@@ -1443,10 +1443,10 @@ static int ql_map_send(struct ql_adapter *qdev,
1443 } 1443 }
1444 1444
1445 tbd->addr = cpu_to_le64(map); 1445 tbd->addr = cpu_to_le64(map);
1446 tbd->len = cpu_to_le32(frag->size); 1446 tbd->len = cpu_to_le32(skb_frag_size(frag));
1447 dma_unmap_addr_set(&tx_ring_desc->map[map_idx], mapaddr, map); 1447 dma_unmap_addr_set(&tx_ring_desc->map[map_idx], mapaddr, map);
1448 dma_unmap_len_set(&tx_ring_desc->map[map_idx], maplen, 1448 dma_unmap_len_set(&tx_ring_desc->map[map_idx], maplen,
1449 frag->size); 1449 skb_frag_size(frag));
1450 1450
1451 } 1451 }
1452 /* Save the number of segments we've mapped. */ 1452 /* Save the number of segments we've mapped. */
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c
index 5dcd5be03f31..ee5da9293ce0 100644
--- a/drivers/net/ethernet/realtek/8139cp.c
+++ b/drivers/net/ethernet/realtek/8139cp.c
@@ -777,12 +777,12 @@ static netdev_tx_t cp_start_xmit (struct sk_buff *skb,
777 entry = NEXT_TX(entry); 777 entry = NEXT_TX(entry);
778 778
779 for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) { 779 for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) {
780 skb_frag_t *this_frag = &skb_shinfo(skb)->frags[frag]; 780 const skb_frag_t *this_frag = &skb_shinfo(skb)->frags[frag];
781 u32 len; 781 u32 len;
782 u32 ctrl; 782 u32 ctrl;
783 dma_addr_t mapping; 783 dma_addr_t mapping;
784 784
785 len = this_frag->size; 785 len = skb_frag_size(this_frag);
786 mapping = dma_map_single(&cp->pdev->dev, 786 mapping = dma_map_single(&cp->pdev->dev,
787 skb_frag_address(this_frag), 787 skb_frag_address(this_frag),
788 len, PCI_DMA_TODEVICE); 788 len, PCI_DMA_TODEVICE);
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 2ce60709a455..aa39e771175c 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -5413,7 +5413,7 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
5413 5413
5414 entry = tp->cur_tx; 5414 entry = tp->cur_tx;
5415 for (cur_frag = 0; cur_frag < info->nr_frags; cur_frag++) { 5415 for (cur_frag = 0; cur_frag < info->nr_frags; cur_frag++) {
5416 skb_frag_t *frag = info->frags + cur_frag; 5416 const skb_frag_t *frag = info->frags + cur_frag;
5417 dma_addr_t mapping; 5417 dma_addr_t mapping;
5418 u32 status, len; 5418 u32 status, len;
5419 void *addr; 5419 void *addr;
@@ -5421,7 +5421,7 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
5421 entry = (entry + 1) % NUM_TX_DESC; 5421 entry = (entry + 1) % NUM_TX_DESC;
5422 5422
5423 txd = tp->TxDescArray + entry; 5423 txd = tp->TxDescArray + entry;
5424 len = frag->size; 5424 len = skb_frag_size(frag);
5425 addr = skb_frag_address(frag); 5425 addr = skb_frag_address(frag);
5426 mapping = dma_map_single(d, addr, len, DMA_TO_DEVICE); 5426 mapping = dma_map_single(d, addr, len, DMA_TO_DEVICE);
5427 if (unlikely(dma_mapping_error(d, mapping))) { 5427 if (unlikely(dma_mapping_error(d, mapping))) {
diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
index 91a6b7123539..adbda182f159 100644
--- a/drivers/net/ethernet/sfc/rx.c
+++ b/drivers/net/ethernet/sfc/rx.c
@@ -481,7 +481,7 @@ static void efx_rx_packet_gro(struct efx_channel *channel,
481 skb_frag_set_page(skb, 0, page); 481 skb_frag_set_page(skb, 0, page);
482 skb_shinfo(skb)->frags[0].page_offset = 482 skb_shinfo(skb)->frags[0].page_offset =
483 efx_rx_buf_offset(efx, rx_buf); 483 efx_rx_buf_offset(efx, rx_buf);
484 skb_shinfo(skb)->frags[0].size = rx_buf->len; 484 skb_frag_size_set(&skb_shinfo(skb)->frags[0], rx_buf->len);
485 skb_shinfo(skb)->nr_frags = 1; 485 skb_shinfo(skb)->nr_frags = 1;
486 486
487 skb->len = rx_buf->len; 487 skb->len = rx_buf->len;
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c
index 3964a62dde8b..df88c5430f95 100644
--- a/drivers/net/ethernet/sfc/tx.c
+++ b/drivers/net/ethernet/sfc/tx.c
@@ -238,7 +238,7 @@ netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb)
238 if (i >= skb_shinfo(skb)->nr_frags) 238 if (i >= skb_shinfo(skb)->nr_frags)
239 break; 239 break;
240 fragment = &skb_shinfo(skb)->frags[i]; 240 fragment = &skb_shinfo(skb)->frags[i];
241 len = fragment->size; 241 len = skb_frag_size(fragment);
242 i++; 242 i++;
243 /* Map for DMA */ 243 /* Map for DMA */
244 unmap_single = false; 244 unmap_single = false;
@@ -926,11 +926,11 @@ static int tso_get_fragment(struct tso_state *st, struct efx_nic *efx,
926 skb_frag_t *frag) 926 skb_frag_t *frag)
927{ 927{
928 st->unmap_addr = skb_frag_dma_map(&efx->pci_dev->dev, frag, 0, 928 st->unmap_addr = skb_frag_dma_map(&efx->pci_dev->dev, frag, 0,
929 frag->size, DMA_TO_DEVICE); 929 skb_frag_size(frag), DMA_TO_DEVICE);
930 if (likely(!dma_mapping_error(&efx->pci_dev->dev, st->unmap_addr))) { 930 if (likely(!dma_mapping_error(&efx->pci_dev->dev, st->unmap_addr))) {
931 st->unmap_single = false; 931 st->unmap_single = false;
932 st->unmap_len = frag->size; 932 st->unmap_len = skb_frag_size(frag);
933 st->in_len = frag->size; 933 st->in_len = skb_frag_size(frag);
934 st->dma_addr = st->unmap_addr; 934 st->dma_addr = st->unmap_addr;
935 return 0; 935 return 0;
936 } 936 }
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index c0ee6b6b0198..87a6b2e59e04 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1106,8 +1106,8 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
1106 } 1106 }
1107 1107
1108 for (i = 0; i < nfrags; i++) { 1108 for (i = 0; i < nfrags; i++) {
1109 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 1109 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
1110 int len = frag->size; 1110 int len = skb_frag_size(frag);
1111 1111
1112 entry = (++priv->cur_tx) % txsize; 1112 entry = (++priv->cur_tx) % txsize;
1113 desc = priv->dma_tx + entry; 1113 desc = priv->dma_tx + entry;
diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c
index d9460d81a137..fd40988c19a6 100644
--- a/drivers/net/ethernet/sun/cassini.c
+++ b/drivers/net/ethernet/sun/cassini.c
@@ -2051,7 +2051,7 @@ static int cas_rx_process_pkt(struct cas *cp, struct cas_rx_comp *rxc,
2051 __skb_frag_set_page(frag, page->buffer); 2051 __skb_frag_set_page(frag, page->buffer);
2052 __skb_frag_ref(frag); 2052 __skb_frag_ref(frag);
2053 frag->page_offset = off; 2053 frag->page_offset = off;
2054 frag->size = hlen - swivel; 2054 skb_frag_size_set(frag, hlen - swivel);
2055 2055
2056 /* any more data? */ 2056 /* any more data? */
2057 if ((words[0] & RX_COMP1_SPLIT_PKT) && ((dlen -= hlen) > 0)) { 2057 if ((words[0] & RX_COMP1_SPLIT_PKT) && ((dlen -= hlen) > 0)) {
@@ -2075,7 +2075,7 @@ static int cas_rx_process_pkt(struct cas *cp, struct cas_rx_comp *rxc,
2075 __skb_frag_set_page(frag, page->buffer); 2075 __skb_frag_set_page(frag, page->buffer);
2076 __skb_frag_ref(frag); 2076 __skb_frag_ref(frag);
2077 frag->page_offset = 0; 2077 frag->page_offset = 0;
2078 frag->size = hlen; 2078 skb_frag_size_set(frag, hlen);
2079 RX_USED_ADD(page, hlen + cp->crc_size); 2079 RX_USED_ADD(page, hlen + cp->crc_size);
2080 } 2080 }
2081 2081
@@ -2826,9 +2826,9 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring,
2826 entry = TX_DESC_NEXT(ring, entry); 2826 entry = TX_DESC_NEXT(ring, entry);
2827 2827
2828 for (frag = 0; frag < nr_frags; frag++) { 2828 for (frag = 0; frag < nr_frags; frag++) {
2829 skb_frag_t *fragp = &skb_shinfo(skb)->frags[frag]; 2829 const skb_frag_t *fragp = &skb_shinfo(skb)->frags[frag];
2830 2830
2831 len = fragp->size; 2831 len = skb_frag_size(fragp);
2832 mapping = skb_frag_dma_map(&cp->pdev->dev, fragp, 0, len, 2832 mapping = skb_frag_dma_map(&cp->pdev->dev, fragp, 0, len,
2833 DMA_TO_DEVICE); 2833 DMA_TO_DEVICE);
2834 2834
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);
diff --git a/drivers/net/ethernet/sun/sungem.c b/drivers/net/ethernet/sun/sungem.c
index 6b62a73227c2..ceab215bb4a3 100644
--- a/drivers/net/ethernet/sun/sungem.c
+++ b/drivers/net/ethernet/sun/sungem.c
@@ -1065,12 +1065,12 @@ static netdev_tx_t gem_start_xmit(struct sk_buff *skb,
1065 entry = NEXT_TX(entry); 1065 entry = NEXT_TX(entry);
1066 1066
1067 for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) { 1067 for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) {
1068 skb_frag_t *this_frag = &skb_shinfo(skb)->frags[frag]; 1068 const skb_frag_t *this_frag = &skb_shinfo(skb)->frags[frag];
1069 u32 len; 1069 u32 len;
1070 dma_addr_t mapping; 1070 dma_addr_t mapping;
1071 u64 this_ctrl; 1071 u64 this_ctrl;
1072 1072
1073 len = this_frag->size; 1073 len = skb_frag_size(this_frag);
1074 mapping = skb_frag_dma_map(&gp->pdev->dev, this_frag, 1074 mapping = skb_frag_dma_map(&gp->pdev->dev, this_frag,
1075 0, len, DMA_TO_DEVICE); 1075 0, len, DMA_TO_DEVICE);
1076 this_ctrl = ctrl; 1076 this_ctrl = ctrl;
diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
index 869d47be54b4..c517dac02ae1 100644
--- a/drivers/net/ethernet/sun/sunhme.c
+++ b/drivers/net/ethernet/sun/sunhme.c
@@ -2305,10 +2305,10 @@ static netdev_tx_t happy_meal_start_xmit(struct sk_buff *skb,
2305 entry = NEXT_TX(entry); 2305 entry = NEXT_TX(entry);
2306 2306
2307 for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) { 2307 for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) {
2308 skb_frag_t *this_frag = &skb_shinfo(skb)->frags[frag]; 2308 const skb_frag_t *this_frag = &skb_shinfo(skb)->frags[frag];
2309 u32 len, mapping, this_txflags; 2309 u32 len, mapping, this_txflags;
2310 2310
2311 len = this_frag->size; 2311 len = skb_frag_size(this_frag);
2312 mapping = skb_frag_dma_map(hp->dma_dev, this_frag, 2312 mapping = skb_frag_dma_map(hp->dma_dev, this_frag,
2313 0, len, DMA_TO_DEVICE); 2313 0, len, DMA_TO_DEVICE);
2314 this_txflags = tx_flags; 2314 this_txflags = tx_flags;
diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c
index c77e3bf4750a..3a90af6d111c 100644
--- a/drivers/net/ethernet/tehuti/tehuti.c
+++ b/drivers/net/ethernet/tehuti/tehuti.c
@@ -1493,12 +1493,12 @@ bdx_tx_map_skb(struct bdx_priv *priv, struct sk_buff *skb,
1493 bdx_tx_db_inc_wptr(db); 1493 bdx_tx_db_inc_wptr(db);
1494 1494
1495 for (i = 0; i < nr_frags; i++) { 1495 for (i = 0; i < nr_frags; i++) {
1496 struct skb_frag_struct *frag; 1496 const struct skb_frag_struct *frag;
1497 1497
1498 frag = &skb_shinfo(skb)->frags[i]; 1498 frag = &skb_shinfo(skb)->frags[i];
1499 db->wptr->len = frag->size; 1499 db->wptr->len = skb_frag_size(frag);
1500 db->wptr->addr.dma = skb_frag_dma_map(&priv->pdev->dev, frag, 1500 db->wptr->addr.dma = skb_frag_dma_map(&priv->pdev->dev, frag,
1501 0, frag->size, 1501 0, skb_frag_size(frag),
1502 DMA_TO_DEVICE); 1502 DMA_TO_DEVICE);
1503 1503
1504 pbl++; 1504 pbl++;
diff --git a/drivers/net/ethernet/tile/tilepro.c b/drivers/net/ethernet/tile/tilepro.c
index 1e2af96fc29c..78e3fb226cce 100644
--- a/drivers/net/ethernet/tile/tilepro.c
+++ b/drivers/net/ethernet/tile/tilepro.c
@@ -1713,7 +1713,7 @@ static unsigned int tile_net_tx_frags(lepp_frag_t *frags,
1713 cpa = ((phys_addr_t)pfn << PAGE_SHIFT) + f->page_offset; 1713 cpa = ((phys_addr_t)pfn << PAGE_SHIFT) + f->page_offset;
1714 frags[n].cpa_lo = cpa; 1714 frags[n].cpa_lo = cpa;
1715 frags[n].cpa_hi = cpa >> 32; 1715 frags[n].cpa_hi = cpa >> 32;
1716 frags[n].length = f->size; 1716 frags[n].length = skb_frag_size(f);
1717 frags[n].hash_for_home = hash_for_home; 1717 frags[n].hash_for_home = hash_for_home;
1718 n++; 1718 n++;
1719 } 1719 }
diff --git a/drivers/net/ethernet/tundra/tsi108_eth.c b/drivers/net/ethernet/tundra/tsi108_eth.c
index a03996cf88ed..a8df7eca0956 100644
--- a/drivers/net/ethernet/tundra/tsi108_eth.c
+++ b/drivers/net/ethernet/tundra/tsi108_eth.c
@@ -709,13 +709,13 @@ static int tsi108_send_packet(struct sk_buff * skb, struct net_device *dev)
709 data->txring[tx].len = skb_headlen(skb); 709 data->txring[tx].len = skb_headlen(skb);
710 misc |= TSI108_TX_SOF; 710 misc |= TSI108_TX_SOF;
711 } else { 711 } else {
712 skb_frag_t *frag = &skb_shinfo(skb)->frags[i - 1]; 712 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i - 1];
713 713
714 data->txring[tx].buf0 = skb_frag_dma_map(NULL, frag, 714 data->txring[tx].buf0 = skb_frag_dma_map(NULL, frag,
715 0, 715 0,
716 frag->size, 716 skb_frag_size(frag),
717 DMA_TO_DEVICE); 717 DMA_TO_DEVICE);
718 data->txring[tx].len = frag->size; 718 data->txring[tx].len = skb_frag_size(frag);
719 } 719 }
720 720
721 if (i == frags - 1) 721 if (i == frags - 1)
diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c
index b47bce1a2e2a..4535d7cc848e 100644
--- a/drivers/net/ethernet/via/via-velocity.c
+++ b/drivers/net/ethernet/via/via-velocity.c
@@ -2554,16 +2554,16 @@ static netdev_tx_t velocity_xmit(struct sk_buff *skb,
2554 2554
2555 /* Handle fragments */ 2555 /* Handle fragments */
2556 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 2556 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
2557 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 2557 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
2558 2558
2559 tdinfo->skb_dma[i + 1] = skb_frag_dma_map(&vptr->pdev->dev, 2559 tdinfo->skb_dma[i + 1] = skb_frag_dma_map(&vptr->pdev->dev,
2560 frag, 0, 2560 frag, 0,
2561 frag->size, 2561 skb_frag_size(frag),
2562 DMA_TO_DEVICE); 2562 DMA_TO_DEVICE);
2563 2563
2564 td_ptr->td_buf[i + 1].pa_low = cpu_to_le32(tdinfo->skb_dma[i + 1]); 2564 td_ptr->td_buf[i + 1].pa_low = cpu_to_le32(tdinfo->skb_dma[i + 1]);
2565 td_ptr->td_buf[i + 1].pa_high = 0; 2565 td_ptr->td_buf[i + 1].pa_high = 0;
2566 td_ptr->td_buf[i + 1].size = cpu_to_le16(frag->size); 2566 td_ptr->td_buf[i + 1].size = cpu_to_le16(skb_frag_size(frag));
2567 } 2567 }
2568 tdinfo->nskb_dma = i + 1; 2568 tdinfo->nskb_dma = i + 1;
2569 2569
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 66e3c36c3733..85ba4d9ac170 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -716,8 +716,8 @@ static int temac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
716 cur_p = &lp->tx_bd_v[lp->tx_bd_tail]; 716 cur_p = &lp->tx_bd_v[lp->tx_bd_tail];
717 cur_p->phys = dma_map_single(ndev->dev.parent, 717 cur_p->phys = dma_map_single(ndev->dev.parent,
718 skb_frag_address(frag), 718 skb_frag_address(frag),
719 frag->size, DMA_TO_DEVICE); 719 frag_size(frag), DMA_TO_DEVICE);
720 cur_p->len = frag->size; 720 cur_p->len = frag_size(frag);
721 cur_p->app0 = 0; 721 cur_p->app0 = 0;
722 frag++; 722 frag++;
723 } 723 }
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index b8225f3b31d1..0d4841bed0f9 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -147,14 +147,14 @@ static void set_skb_frag(struct sk_buff *skb, struct page *page,
147 skb_frag_t *f; 147 skb_frag_t *f;
148 148
149 f = &skb_shinfo(skb)->frags[i]; 149 f = &skb_shinfo(skb)->frags[i];
150 f->size = min((unsigned)PAGE_SIZE - offset, *len); 150 skb_frag_size_set(f, min((unsigned)PAGE_SIZE - offset, *len));
151 f->page_offset = offset; 151 f->page_offset = offset;
152 __skb_frag_set_page(f, page); 152 __skb_frag_set_page(f, page);
153 153
154 skb->data_len += f->size; 154 skb->data_len += skb_frag_size(f);
155 skb->len += f->size; 155 skb->len += skb_frag_size(f);
156 skb_shinfo(skb)->nr_frags++; 156 skb_shinfo(skb)->nr_frags++;
157 *len -= f->size; 157 *len -= skb_frag_size(f);
158} 158}
159 159
160static struct sk_buff *page_to_skb(struct virtnet_info *vi, 160static struct sk_buff *page_to_skb(struct virtnet_info *vi,
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 902f284fd054..b771ebac0f01 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -656,8 +656,8 @@ vmxnet3_append_frag(struct sk_buff *skb, struct Vmxnet3_RxCompDesc *rcd,
656 656
657 __skb_frag_set_page(frag, rbi->page); 657 __skb_frag_set_page(frag, rbi->page);
658 frag->page_offset = 0; 658 frag->page_offset = 0;
659 frag->size = rcd->len; 659 skb_frag_size_set(frag, rcd->len);
660 skb->data_len += frag->size; 660 skb->data_len += rcd->len;
661 skb->truesize += PAGE_SIZE; 661 skb->truesize += PAGE_SIZE;
662 skb_shinfo(skb)->nr_frags++; 662 skb_shinfo(skb)->nr_frags++;
663} 663}
@@ -745,21 +745,21 @@ vmxnet3_map_pkt(struct sk_buff *skb, struct vmxnet3_tx_ctx *ctx,
745 } 745 }
746 746
747 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 747 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
748 struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i]; 748 const struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i];
749 749
750 tbi = tq->buf_info + tq->tx_ring.next2fill; 750 tbi = tq->buf_info + tq->tx_ring.next2fill;
751 tbi->map_type = VMXNET3_MAP_PAGE; 751 tbi->map_type = VMXNET3_MAP_PAGE;
752 tbi->dma_addr = skb_frag_dma_map(&adapter->pdev->dev, frag, 752 tbi->dma_addr = skb_frag_dma_map(&adapter->pdev->dev, frag,
753 0, frag->size, 753 0, skb_frag_size(frag),
754 DMA_TO_DEVICE); 754 DMA_TO_DEVICE);
755 755
756 tbi->len = frag->size; 756 tbi->len = skb_frag_size(frag);
757 757
758 gdesc = tq->tx_ring.base + tq->tx_ring.next2fill; 758 gdesc = tq->tx_ring.base + tq->tx_ring.next2fill;
759 BUG_ON(gdesc->txd.gen == tq->tx_ring.gen); 759 BUG_ON(gdesc->txd.gen == tq->tx_ring.gen);
760 760
761 gdesc->txd.addr = cpu_to_le64(tbi->dma_addr); 761 gdesc->txd.addr = cpu_to_le64(tbi->dma_addr);
762 gdesc->dword[2] = cpu_to_le32(dw2 | frag->size); 762 gdesc->dword[2] = cpu_to_le32(dw2 | skb_frag_size(frag));
763 gdesc->dword[3] = 0; 763 gdesc->dword[3] = 0;
764 764
765 dev_dbg(&adapter->netdev->dev, 765 dev_dbg(&adapter->netdev->dev,
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 8d70b44fcd8a..d5508957200e 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -334,7 +334,7 @@ unsigned int xen_netbk_count_skb_slots(struct xenvif *vif, struct sk_buff *skb)
334 count++; 334 count++;
335 335
336 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 336 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
337 unsigned long size = skb_shinfo(skb)->frags[i].size; 337 unsigned long size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
338 unsigned long bytes; 338 unsigned long bytes;
339 while (size > 0) { 339 while (size > 0) {
340 BUG_ON(copy_off > MAX_BUFFER_OFFSET); 340 BUG_ON(copy_off > MAX_BUFFER_OFFSET);
@@ -526,7 +526,7 @@ static int netbk_gop_skb(struct sk_buff *skb,
526 for (i = 0; i < nr_frags; i++) { 526 for (i = 0; i < nr_frags; i++) {
527 netbk_gop_frag_copy(vif, skb, npo, 527 netbk_gop_frag_copy(vif, skb, npo,
528 skb_frag_page(&skb_shinfo(skb)->frags[i]), 528 skb_frag_page(&skb_shinfo(skb)->frags[i]),
529 skb_shinfo(skb)->frags[i].size, 529 skb_frag_size(&skb_shinfo(skb)->frags[i]),
530 skb_shinfo(skb)->frags[i].page_offset, 530 skb_shinfo(skb)->frags[i].page_offset,
531 &head); 531 &head);
532 } 532 }
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 6e5d4c09e5d7..226faab23603 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -467,7 +467,7 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev,
467 467
468 tx->gref = np->grant_tx_ref[id] = ref; 468 tx->gref = np->grant_tx_ref[id] = ref;
469 tx->offset = frag->page_offset; 469 tx->offset = frag->page_offset;
470 tx->size = frag->size; 470 tx->size = skb_frag_size(frag);
471 tx->flags = 0; 471 tx->flags = 0;
472 } 472 }
473 473
@@ -965,7 +965,7 @@ err:
965 if (rx->status > len) { 965 if (rx->status > len) {
966 skb_shinfo(skb)->frags[0].page_offset = 966 skb_shinfo(skb)->frags[0].page_offset =
967 rx->offset + len; 967 rx->offset + len;
968 skb_shinfo(skb)->frags[0].size = rx->status - len; 968 skb_frag_size_set(&skb_shinfo(skb)->frags[0], rx->status - len);
969 skb->data_len = rx->status - len; 969 skb->data_len = rx->status - len;
970 } else { 970 } else {
971 __skb_fill_page_desc(skb, 0, NULL, 0, 0); 971 __skb_fill_page_desc(skb, 0, NULL, 0, 0);
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index 77ac217ad5ce..be69da38ccaa 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -1814,8 +1814,8 @@ static int sgl_read_to_frags(struct scatterlist *sg, unsigned int sgoffset,
1814 copy = min(datalen, sglen); 1814 copy = min(datalen, sglen);
1815 if (i && page == frags[i - 1].page && 1815 if (i && page == frags[i - 1].page &&
1816 sgoffset + sg->offset == 1816 sgoffset + sg->offset ==
1817 frags[i - 1].page_offset + frags[i - 1].size) { 1817 frags[i - 1].page_offset + skb_frag_size(&frags[i - 1])) {
1818 frags[i - 1].size += copy; 1818 skb_frag_size_add(&frags[i - 1], copy);
1819 } else { 1819 } else {
1820 if (i >= frag_max) { 1820 if (i >= frag_max) {
1821 pr_warn("too many pages %u, dlen %u.\n", 1821 pr_warn("too many pages %u, dlen %u.\n",
@@ -1825,7 +1825,7 @@ static int sgl_read_to_frags(struct scatterlist *sg, unsigned int sgoffset,
1825 1825
1826 frags[i].page = page; 1826 frags[i].page = page;
1827 frags[i].page_offset = sg->offset + sgoffset; 1827 frags[i].page_offset = sg->offset + sgoffset;
1828 frags[i].size = copy; 1828 skb_frag_size_set(&frags[i], copy);
1829 i++; 1829 i++;
1830 } 1830 }
1831 datalen -= copy; 1831 datalen -= copy;
@@ -1951,8 +1951,8 @@ int cxgbi_conn_init_pdu(struct iscsi_task *task, unsigned int offset,
1951 char *src = kmap_atomic(frag->page, 1951 char *src = kmap_atomic(frag->page,
1952 KM_SOFTIRQ0); 1952 KM_SOFTIRQ0);
1953 1953
1954 memcpy(dst, src+frag->page_offset, frag->size); 1954 memcpy(dst, src+frag->page_offset, skb_frag_size(frag));
1955 dst += frag->size; 1955 dst += skb_frag_size(frag);
1956 kunmap_atomic(src, KM_SOFTIRQ0); 1956 kunmap_atomic(src, KM_SOFTIRQ0);
1957 } 1957 }
1958 if (padlen) { 1958 if (padlen) {
diff --git a/drivers/scsi/fcoe/fcoe_transport.c b/drivers/scsi/fcoe/fcoe_transport.c
index f6613f9f1bdb..dac8e39a5188 100644
--- a/drivers/scsi/fcoe/fcoe_transport.c
+++ b/drivers/scsi/fcoe/fcoe_transport.c
@@ -105,7 +105,7 @@ u32 fcoe_fc_crc(struct fc_frame *fp)
105 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 105 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
106 frag = &skb_shinfo(skb)->frags[i]; 106 frag = &skb_shinfo(skb)->frags[i];
107 off = frag->page_offset; 107 off = frag->page_offset;
108 len = frag->size; 108 len = skb_frag_size(frag);
109 while (len > 0) { 109 while (len > 0) {
110 clen = min(len, PAGE_SIZE - (off & ~PAGE_MASK)); 110 clen = min(len, PAGE_SIZE - (off & ~PAGE_MASK));
111 data = kmap_atomic( 111 data = kmap_atomic(
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 58792aefc8d3..4c7739f929ef 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -169,11 +169,11 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
169 169
170 /* Additional fragments are after SKB data */ 170 /* Additional fragments are after SKB data */
171 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 171 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
172 skb_frag_t *f = &skb_shinfo(skb)->frags[i]; 172 const skb_frag_t *f = &skb_shinfo(skb)->frags[i];
173 173
174 packet->page_buf[i+2].pfn = page_to_pfn(skb_frag_page(f)); 174 packet->page_buf[i+2].pfn = page_to_pfn(skb_frag_page(f));
175 packet->page_buf[i+2].offset = f->page_offset; 175 packet->page_buf[i+2].offset = f->page_offset;
176 packet->page_buf[i+2].len = f->size; 176 packet->page_buf[i+2].len = skb_frag_size(f);
177 } 177 }
178 178
179 /* Set the completion routine */ 179 /* Set the completion routine */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 64f86951ef74..6fcbbbd12ceb 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -150,6 +150,26 @@ struct skb_frag_struct {
150#endif 150#endif
151}; 151};
152 152
153static inline unsigned int skb_frag_size(const skb_frag_t *frag)
154{
155 return frag->size;
156}
157
158static inline void skb_frag_size_set(skb_frag_t *frag, unsigned int size)
159{
160 frag->size = size;
161}
162
163static inline void skb_frag_size_add(skb_frag_t *frag, int delta)
164{
165 frag->size += delta;
166}
167
168static inline void skb_frag_size_sub(skb_frag_t *frag, int delta)
169{
170 frag->size -= delta;
171}
172
153#define HAVE_HW_TIME_STAMP 173#define HAVE_HW_TIME_STAMP
154 174
155/** 175/**
@@ -1132,7 +1152,7 @@ static inline int skb_pagelen(const struct sk_buff *skb)
1132 int i, len = 0; 1152 int i, len = 0;
1133 1153
1134 for (i = (int)skb_shinfo(skb)->nr_frags - 1; i >= 0; i--) 1154 for (i = (int)skb_shinfo(skb)->nr_frags - 1; i >= 0; i--)
1135 len += skb_shinfo(skb)->frags[i].size; 1155 len += skb_frag_size(&skb_shinfo(skb)->frags[i]);
1136 return len + skb_headlen(skb); 1156 return len + skb_headlen(skb);
1137} 1157}
1138 1158
@@ -1156,7 +1176,7 @@ static inline void __skb_fill_page_desc(struct sk_buff *skb, int i,
1156 1176
1157 frag->page = page; 1177 frag->page = page;
1158 frag->page_offset = off; 1178 frag->page_offset = off;
1159 frag->size = size; 1179 skb_frag_size_set(frag, size);
1160} 1180}
1161 1181
1162/** 1182/**
@@ -1907,10 +1927,10 @@ static inline int skb_can_coalesce(struct sk_buff *skb, int i,
1907 const struct page *page, int off) 1927 const struct page *page, int off)
1908{ 1928{
1909 if (i) { 1929 if (i) {
1910 struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1]; 1930 const struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1];
1911 1931
1912 return page == skb_frag_page(frag) && 1932 return page == skb_frag_page(frag) &&
1913 off == frag->page_offset + frag->size; 1933 off == frag->page_offset + skb_frag_size(frag);
1914 } 1934 }
1915 return 0; 1935 return 0;
1916} 1936}
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index b1fe7c35e8d1..bfa9ab93eda5 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -951,13 +951,12 @@ static unsigned long atalk_sum_skb(const struct sk_buff *skb, int offset,
951 /* checksum stuff in frags */ 951 /* checksum stuff in frags */
952 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 952 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
953 int end; 953 int end;
954 954 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
955 WARN_ON(start > offset + len); 955 WARN_ON(start > offset + len);
956 956
957 end = start + skb_shinfo(skb)->frags[i].size; 957 end = start + skb_frag_size(frag);
958 if ((copy = end - offset) > 0) { 958 if ((copy = end - offset) > 0) {
959 u8 *vaddr; 959 u8 *vaddr;
960 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
961 960
962 if (copy > len) 961 if (copy > len)
963 copy = len; 962 copy = len;
diff --git a/net/core/datagram.c b/net/core/datagram.c
index 6449bed457d4..68bbf9f65cb0 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -324,14 +324,14 @@ int skb_copy_datagram_iovec(const struct sk_buff *skb, int offset,
324 /* Copy paged appendix. Hmm... why does this look so complicated? */ 324 /* Copy paged appendix. Hmm... why does this look so complicated? */
325 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 325 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
326 int end; 326 int end;
327 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
327 328
328 WARN_ON(start > offset + len); 329 WARN_ON(start > offset + len);
329 330
330 end = start + skb_shinfo(skb)->frags[i].size; 331 end = start + skb_frag_size(frag);
331 if ((copy = end - offset) > 0) { 332 if ((copy = end - offset) > 0) {
332 int err; 333 int err;
333 u8 *vaddr; 334 u8 *vaddr;
334 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
335 struct page *page = skb_frag_page(frag); 335 struct page *page = skb_frag_page(frag);
336 336
337 if (copy > len) 337 if (copy > len)
@@ -410,14 +410,14 @@ int skb_copy_datagram_const_iovec(const struct sk_buff *skb, int offset,
410 /* Copy paged appendix. Hmm... why does this look so complicated? */ 410 /* Copy paged appendix. Hmm... why does this look so complicated? */
411 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 411 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
412 int end; 412 int end;
413 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
413 414
414 WARN_ON(start > offset + len); 415 WARN_ON(start > offset + len);
415 416
416 end = start + skb_shinfo(skb)->frags[i].size; 417 end = start + skb_frag_size(frag);
417 if ((copy = end - offset) > 0) { 418 if ((copy = end - offset) > 0) {
418 int err; 419 int err;
419 u8 *vaddr; 420 u8 *vaddr;
420 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
421 struct page *page = skb_frag_page(frag); 421 struct page *page = skb_frag_page(frag);
422 422
423 if (copy > len) 423 if (copy > len)
@@ -500,14 +500,14 @@ int skb_copy_datagram_from_iovec(struct sk_buff *skb, int offset,
500 /* Copy paged appendix. Hmm... why does this look so complicated? */ 500 /* Copy paged appendix. Hmm... why does this look so complicated? */
501 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 501 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
502 int end; 502 int end;
503 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
503 504
504 WARN_ON(start > offset + len); 505 WARN_ON(start > offset + len);
505 506
506 end = start + skb_shinfo(skb)->frags[i].size; 507 end = start + skb_frag_size(frag);
507 if ((copy = end - offset) > 0) { 508 if ((copy = end - offset) > 0) {
508 int err; 509 int err;
509 u8 *vaddr; 510 u8 *vaddr;
510 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
511 struct page *page = skb_frag_page(frag); 511 struct page *page = skb_frag_page(frag);
512 512
513 if (copy > len) 513 if (copy > len)
@@ -585,15 +585,15 @@ static int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset,
585 585
586 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 586 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
587 int end; 587 int end;
588 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
588 589
589 WARN_ON(start > offset + len); 590 WARN_ON(start > offset + len);
590 591
591 end = start + skb_shinfo(skb)->frags[i].size; 592 end = start + skb_frag_size(frag);
592 if ((copy = end - offset) > 0) { 593 if ((copy = end - offset) > 0) {
593 __wsum csum2; 594 __wsum csum2;
594 int err = 0; 595 int err = 0;
595 u8 *vaddr; 596 u8 *vaddr;
596 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
597 struct page *page = skb_frag_page(frag); 597 struct page *page = skb_frag_page(frag);
598 598
599 if (copy > len) 599 if (copy > len)
diff --git a/net/core/dev.c b/net/core/dev.c
index 8b6118a16b87..cbb5918e4fc5 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3489,9 +3489,9 @@ pull:
3489 skb->data_len -= grow; 3489 skb->data_len -= grow;
3490 3490
3491 skb_shinfo(skb)->frags[0].page_offset += grow; 3491 skb_shinfo(skb)->frags[0].page_offset += grow;
3492 skb_shinfo(skb)->frags[0].size -= grow; 3492 skb_frag_size_sub(&skb_shinfo(skb)->frags[0], grow);
3493 3493
3494 if (unlikely(!skb_shinfo(skb)->frags[0].size)) { 3494 if (unlikely(!skb_frag_size(&skb_shinfo(skb)->frags[0]))) {
3495 skb_frag_unref(skb, 0); 3495 skb_frag_unref(skb, 0);
3496 memmove(skb_shinfo(skb)->frags, 3496 memmove(skb_shinfo(skb)->frags,
3497 skb_shinfo(skb)->frags + 1, 3497 skb_shinfo(skb)->frags + 1,
@@ -3559,7 +3559,7 @@ void skb_gro_reset_offset(struct sk_buff *skb)
3559 !PageHighMem(skb_frag_page(&skb_shinfo(skb)->frags[0]))) { 3559 !PageHighMem(skb_frag_page(&skb_shinfo(skb)->frags[0]))) {
3560 NAPI_GRO_CB(skb)->frag0 = 3560 NAPI_GRO_CB(skb)->frag0 =
3561 skb_frag_address(&skb_shinfo(skb)->frags[0]); 3561 skb_frag_address(&skb_shinfo(skb)->frags[0]);
3562 NAPI_GRO_CB(skb)->frag0_len = skb_shinfo(skb)->frags[0].size; 3562 NAPI_GRO_CB(skb)->frag0_len = skb_frag_size(&skb_shinfo(skb)->frags[0]);
3563 } 3563 }
3564} 3564}
3565EXPORT_SYMBOL(skb_gro_reset_offset); 3565EXPORT_SYMBOL(skb_gro_reset_offset);
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 796044ac0bf3..38d657737498 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2606,13 +2606,13 @@ static void pktgen_finalize_skb(struct pktgen_dev *pkt_dev, struct sk_buff *skb,
2606 skb_shinfo(skb)->frags[i].page_offset = 0; 2606 skb_shinfo(skb)->frags[i].page_offset = 0;
2607 /*last fragment, fill rest of data*/ 2607 /*last fragment, fill rest of data*/
2608 if (i == (frags - 1)) 2608 if (i == (frags - 1))
2609 skb_shinfo(skb)->frags[i].size = 2609 skb_frag_size_set(&skb_shinfo(skb)->frags[i],
2610 (datalen < PAGE_SIZE ? datalen : PAGE_SIZE); 2610 (datalen < PAGE_SIZE ? datalen : PAGE_SIZE));
2611 else 2611 else
2612 skb_shinfo(skb)->frags[i].size = frag_len; 2612 skb_frag_size_set(&skb_shinfo(skb)->frags[i], frag_len);
2613 datalen -= skb_shinfo(skb)->frags[i].size; 2613 datalen -= skb_frag_size(&skb_shinfo(skb)->frags[i]);
2614 skb->len += skb_shinfo(skb)->frags[i].size; 2614 skb->len += skb_frag_size(&skb_shinfo(skb)->frags[i]);
2615 skb->data_len += skb_shinfo(skb)->frags[i].size; 2615 skb->data_len += skb_frag_size(&skb_shinfo(skb)->frags[i]);
2616 i++; 2616 i++;
2617 skb_shinfo(skb)->nr_frags = i; 2617 skb_shinfo(skb)->nr_frags = i;
2618 } 2618 }
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index a7f855dca922..ce357d986251 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -659,7 +659,7 @@ int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask)
659 } 659 }
660 vaddr = kmap_skb_frag(&skb_shinfo(skb)->frags[i]); 660 vaddr = kmap_skb_frag(&skb_shinfo(skb)->frags[i]);
661 memcpy(page_address(page), 661 memcpy(page_address(page),
662 vaddr + f->page_offset, f->size); 662 vaddr + f->page_offset, skb_frag_size(f));
663 kunmap_skb_frag(vaddr); 663 kunmap_skb_frag(vaddr);
664 page->private = (unsigned long)head; 664 page->private = (unsigned long)head;
665 head = page; 665 head = page;
@@ -1190,14 +1190,14 @@ int ___pskb_trim(struct sk_buff *skb, unsigned int len)
1190 goto drop_pages; 1190 goto drop_pages;
1191 1191
1192 for (; i < nfrags; i++) { 1192 for (; i < nfrags; i++) {
1193 int end = offset + skb_shinfo(skb)->frags[i].size; 1193 int end = offset + skb_frag_size(&skb_shinfo(skb)->frags[i]);
1194 1194
1195 if (end < len) { 1195 if (end < len) {
1196 offset = end; 1196 offset = end;
1197 continue; 1197 continue;
1198 } 1198 }
1199 1199
1200 skb_shinfo(skb)->frags[i++].size = len - offset; 1200 skb_frag_size_set(&skb_shinfo(skb)->frags[i++], len - offset);
1201 1201
1202drop_pages: 1202drop_pages:
1203 skb_shinfo(skb)->nr_frags = i; 1203 skb_shinfo(skb)->nr_frags = i;
@@ -1306,9 +1306,11 @@ unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta)
1306 /* Estimate size of pulled pages. */ 1306 /* Estimate size of pulled pages. */
1307 eat = delta; 1307 eat = delta;
1308 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 1308 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
1309 if (skb_shinfo(skb)->frags[i].size >= eat) 1309 int size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
1310
1311 if (size >= eat)
1310 goto pull_pages; 1312 goto pull_pages;
1311 eat -= skb_shinfo(skb)->frags[i].size; 1313 eat -= size;
1312 } 1314 }
1313 1315
1314 /* If we need update frag list, we are in troubles. 1316 /* If we need update frag list, we are in troubles.
@@ -1371,14 +1373,16 @@ pull_pages:
1371 eat = delta; 1373 eat = delta;
1372 k = 0; 1374 k = 0;
1373 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 1375 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
1374 if (skb_shinfo(skb)->frags[i].size <= eat) { 1376 int size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
1377
1378 if (size <= eat) {
1375 skb_frag_unref(skb, i); 1379 skb_frag_unref(skb, i);
1376 eat -= skb_shinfo(skb)->frags[i].size; 1380 eat -= size;
1377 } else { 1381 } else {
1378 skb_shinfo(skb)->frags[k] = skb_shinfo(skb)->frags[i]; 1382 skb_shinfo(skb)->frags[k] = skb_shinfo(skb)->frags[i];
1379 if (eat) { 1383 if (eat) {
1380 skb_shinfo(skb)->frags[k].page_offset += eat; 1384 skb_shinfo(skb)->frags[k].page_offset += eat;
1381 skb_shinfo(skb)->frags[k].size -= eat; 1385 skb_frag_size_sub(&skb_shinfo(skb)->frags[k], eat);
1382 eat = 0; 1386 eat = 0;
1383 } 1387 }
1384 k++; 1388 k++;
@@ -1433,7 +1437,7 @@ int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len)
1433 1437
1434 WARN_ON(start > offset + len); 1438 WARN_ON(start > offset + len);
1435 1439
1436 end = start + skb_shinfo(skb)->frags[i].size; 1440 end = start + skb_frag_size(&skb_shinfo(skb)->frags[i]);
1437 if ((copy = end - offset) > 0) { 1441 if ((copy = end - offset) > 0) {
1438 u8 *vaddr; 1442 u8 *vaddr;
1439 1443
@@ -1632,7 +1636,7 @@ static int __skb_splice_bits(struct sk_buff *skb, struct pipe_inode_info *pipe,
1632 const skb_frag_t *f = &skb_shinfo(skb)->frags[seg]; 1636 const skb_frag_t *f = &skb_shinfo(skb)->frags[seg];
1633 1637
1634 if (__splice_segment(skb_frag_page(f), 1638 if (__splice_segment(skb_frag_page(f),
1635 f->page_offset, f->size, 1639 f->page_offset, skb_frag_size(f),
1636 offset, len, skb, spd, 0, sk, pipe)) 1640 offset, len, skb, spd, 0, sk, pipe))
1637 return 1; 1641 return 1;
1638 } 1642 }
@@ -1742,7 +1746,7 @@ int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len)
1742 1746
1743 WARN_ON(start > offset + len); 1747 WARN_ON(start > offset + len);
1744 1748
1745 end = start + frag->size; 1749 end = start + skb_frag_size(frag);
1746 if ((copy = end - offset) > 0) { 1750 if ((copy = end - offset) > 0) {
1747 u8 *vaddr; 1751 u8 *vaddr;
1748 1752
@@ -1815,7 +1819,7 @@ __wsum skb_checksum(const struct sk_buff *skb, int offset,
1815 1819
1816 WARN_ON(start > offset + len); 1820 WARN_ON(start > offset + len);
1817 1821
1818 end = start + skb_shinfo(skb)->frags[i].size; 1822 end = start + skb_frag_size(&skb_shinfo(skb)->frags[i]);
1819 if ((copy = end - offset) > 0) { 1823 if ((copy = end - offset) > 0) {
1820 __wsum csum2; 1824 __wsum csum2;
1821 u8 *vaddr; 1825 u8 *vaddr;
@@ -1890,7 +1894,7 @@ __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset,
1890 1894
1891 WARN_ON(start > offset + len); 1895 WARN_ON(start > offset + len);
1892 1896
1893 end = start + skb_shinfo(skb)->frags[i].size; 1897 end = start + skb_frag_size(&skb_shinfo(skb)->frags[i]);
1894 if ((copy = end - offset) > 0) { 1898 if ((copy = end - offset) > 0) {
1895 __wsum csum2; 1899 __wsum csum2;
1896 u8 *vaddr; 1900 u8 *vaddr;
@@ -2163,7 +2167,7 @@ static inline void skb_split_no_header(struct sk_buff *skb,
2163 skb->data_len = len - pos; 2167 skb->data_len = len - pos;
2164 2168
2165 for (i = 0; i < nfrags; i++) { 2169 for (i = 0; i < nfrags; i++) {
2166 int size = skb_shinfo(skb)->frags[i].size; 2170 int size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
2167 2171
2168 if (pos + size > len) { 2172 if (pos + size > len) {
2169 skb_shinfo(skb1)->frags[k] = skb_shinfo(skb)->frags[i]; 2173 skb_shinfo(skb1)->frags[k] = skb_shinfo(skb)->frags[i];
@@ -2179,8 +2183,8 @@ static inline void skb_split_no_header(struct sk_buff *skb,
2179 */ 2183 */
2180 skb_frag_ref(skb, i); 2184 skb_frag_ref(skb, i);
2181 skb_shinfo(skb1)->frags[0].page_offset += len - pos; 2185 skb_shinfo(skb1)->frags[0].page_offset += len - pos;
2182 skb_shinfo(skb1)->frags[0].size -= len - pos; 2186 skb_frag_size_sub(&skb_shinfo(skb1)->frags[0], len - pos);
2183 skb_shinfo(skb)->frags[i].size = len - pos; 2187 skb_frag_size_set(&skb_shinfo(skb)->frags[i], len - pos);
2184 skb_shinfo(skb)->nr_frags++; 2188 skb_shinfo(skb)->nr_frags++;
2185 } 2189 }
2186 k++; 2190 k++;
@@ -2258,7 +2262,7 @@ int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen)
2258 } else { 2262 } else {
2259 merge = to - 1; 2263 merge = to - 1;
2260 2264
2261 todo -= fragfrom->size; 2265 todo -= skb_frag_size(fragfrom);
2262 if (todo < 0) { 2266 if (todo < 0) {
2263 if (skb_prepare_for_shift(skb) || 2267 if (skb_prepare_for_shift(skb) ||
2264 skb_prepare_for_shift(tgt)) 2268 skb_prepare_for_shift(tgt))
@@ -2268,8 +2272,8 @@ int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen)
2268 fragfrom = &skb_shinfo(skb)->frags[from]; 2272 fragfrom = &skb_shinfo(skb)->frags[from];
2269 fragto = &skb_shinfo(tgt)->frags[merge]; 2273 fragto = &skb_shinfo(tgt)->frags[merge];
2270 2274
2271 fragto->size += shiftlen; 2275 skb_frag_size_add(fragto, shiftlen);
2272 fragfrom->size -= shiftlen; 2276 skb_frag_size_sub(fragfrom, shiftlen);
2273 fragfrom->page_offset += shiftlen; 2277 fragfrom->page_offset += shiftlen;
2274 2278
2275 goto onlymerged; 2279 goto onlymerged;
@@ -2293,9 +2297,9 @@ int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen)
2293 fragfrom = &skb_shinfo(skb)->frags[from]; 2297 fragfrom = &skb_shinfo(skb)->frags[from];
2294 fragto = &skb_shinfo(tgt)->frags[to]; 2298 fragto = &skb_shinfo(tgt)->frags[to];
2295 2299
2296 if (todo >= fragfrom->size) { 2300 if (todo >= skb_frag_size(fragfrom)) {
2297 *fragto = *fragfrom; 2301 *fragto = *fragfrom;
2298 todo -= fragfrom->size; 2302 todo -= skb_frag_size(fragfrom);
2299 from++; 2303 from++;
2300 to++; 2304 to++;
2301 2305
@@ -2303,10 +2307,10 @@ int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen)
2303 __skb_frag_ref(fragfrom); 2307 __skb_frag_ref(fragfrom);
2304 fragto->page = fragfrom->page; 2308 fragto->page = fragfrom->page;
2305 fragto->page_offset = fragfrom->page_offset; 2309 fragto->page_offset = fragfrom->page_offset;
2306 fragto->size = todo; 2310 skb_frag_size_set(fragto, todo);
2307 2311
2308 fragfrom->page_offset += todo; 2312 fragfrom->page_offset += todo;
2309 fragfrom->size -= todo; 2313 skb_frag_size_sub(fragfrom, todo);
2310 todo = 0; 2314 todo = 0;
2311 2315
2312 to++; 2316 to++;
@@ -2321,7 +2325,7 @@ int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen)
2321 fragfrom = &skb_shinfo(skb)->frags[0]; 2325 fragfrom = &skb_shinfo(skb)->frags[0];
2322 fragto = &skb_shinfo(tgt)->frags[merge]; 2326 fragto = &skb_shinfo(tgt)->frags[merge];
2323 2327
2324 fragto->size += fragfrom->size; 2328 skb_frag_size_add(fragto, skb_frag_size(fragfrom));
2325 __skb_frag_unref(fragfrom); 2329 __skb_frag_unref(fragfrom);
2326 } 2330 }
2327 2331
@@ -2419,7 +2423,7 @@ next_skb:
2419 2423
2420 while (st->frag_idx < skb_shinfo(st->cur_skb)->nr_frags) { 2424 while (st->frag_idx < skb_shinfo(st->cur_skb)->nr_frags) {
2421 frag = &skb_shinfo(st->cur_skb)->frags[st->frag_idx]; 2425 frag = &skb_shinfo(st->cur_skb)->frags[st->frag_idx];
2422 block_limit = frag->size + st->stepped_offset; 2426 block_limit = skb_frag_size(frag) + st->stepped_offset;
2423 2427
2424 if (abs_offset < block_limit) { 2428 if (abs_offset < block_limit) {
2425 if (!st->frag_data) 2429 if (!st->frag_data)
@@ -2437,7 +2441,7 @@ next_skb:
2437 } 2441 }
2438 2442
2439 st->frag_idx++; 2443 st->frag_idx++;
2440 st->stepped_offset += frag->size; 2444 st->stepped_offset += skb_frag_size(frag);
2441 } 2445 }
2442 2446
2443 if (st->frag_data) { 2447 if (st->frag_data) {
@@ -2567,13 +2571,13 @@ int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
2567 left = PAGE_SIZE - frag->page_offset; 2571 left = PAGE_SIZE - frag->page_offset;
2568 copy = (length > left)? left : length; 2572 copy = (length > left)? left : length;
2569 2573
2570 ret = getfrag(from, skb_frag_address(frag) + frag->size, 2574 ret = getfrag(from, skb_frag_address(frag) + skb_frag_size(frag),
2571 offset, copy, 0, skb); 2575 offset, copy, 0, skb);
2572 if (ret < 0) 2576 if (ret < 0)
2573 return -EFAULT; 2577 return -EFAULT;
2574 2578
2575 /* copy was successful so update the size parameters */ 2579 /* copy was successful so update the size parameters */
2576 frag->size += copy; 2580 skb_frag_size_add(frag, copy);
2577 skb->len += copy; 2581 skb->len += copy;
2578 skb->data_len += copy; 2582 skb->data_len += copy;
2579 offset += copy; 2583 offset += copy;
@@ -2720,11 +2724,11 @@ struct sk_buff *skb_segment(struct sk_buff *skb, u32 features)
2720 while (pos < offset + len && i < nfrags) { 2724 while (pos < offset + len && i < nfrags) {
2721 *frag = skb_shinfo(skb)->frags[i]; 2725 *frag = skb_shinfo(skb)->frags[i];
2722 __skb_frag_ref(frag); 2726 __skb_frag_ref(frag);
2723 size = frag->size; 2727 size = skb_frag_size(frag);
2724 2728
2725 if (pos < offset) { 2729 if (pos < offset) {
2726 frag->page_offset += offset - pos; 2730 frag->page_offset += offset - pos;
2727 frag->size -= offset - pos; 2731 skb_frag_size_sub(frag, offset - pos);
2728 } 2732 }
2729 2733
2730 skb_shinfo(nskb)->nr_frags++; 2734 skb_shinfo(nskb)->nr_frags++;
@@ -2733,7 +2737,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, u32 features)
2733 i++; 2737 i++;
2734 pos += size; 2738 pos += size;
2735 } else { 2739 } else {
2736 frag->size -= pos + size - (offset + len); 2740 skb_frag_size_sub(frag, pos + size - (offset + len));
2737 goto skip_fraglist; 2741 goto skip_fraglist;
2738 } 2742 }
2739 2743
@@ -2813,7 +2817,7 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)
2813 } while (--i); 2817 } while (--i);
2814 2818
2815 frag->page_offset += offset; 2819 frag->page_offset += offset;
2816 frag->size -= offset; 2820 skb_frag_size_sub(frag, offset);
2817 2821
2818 skb->truesize -= skb->data_len; 2822 skb->truesize -= skb->data_len;
2819 skb->len -= skb->data_len; 2823 skb->len -= skb->data_len;
@@ -2865,7 +2869,7 @@ merge:
2865 unsigned int eat = offset - headlen; 2869 unsigned int eat = offset - headlen;
2866 2870
2867 skbinfo->frags[0].page_offset += eat; 2871 skbinfo->frags[0].page_offset += eat;
2868 skbinfo->frags[0].size -= eat; 2872 skb_frag_size_sub(&skbinfo->frags[0], eat);
2869 skb->data_len -= eat; 2873 skb->data_len -= eat;
2870 skb->len -= eat; 2874 skb->len -= eat;
2871 offset = headlen; 2875 offset = headlen;
@@ -2936,7 +2940,7 @@ __skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len)
2936 2940
2937 WARN_ON(start > offset + len); 2941 WARN_ON(start > offset + len);
2938 2942
2939 end = start + skb_shinfo(skb)->frags[i].size; 2943 end = start + skb_frag_size(&skb_shinfo(skb)->frags[i]);
2940 if ((copy = end - offset) > 0) { 2944 if ((copy = end - offset) > 0) {
2941 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 2945 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
2942 2946
diff --git a/net/core/user_dma.c b/net/core/user_dma.c
index 34e9664cae3b..2d7cf3d52b4c 100644
--- a/net/core/user_dma.c
+++ b/net/core/user_dma.c
@@ -71,13 +71,13 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan,
71 /* Copy paged appendix. Hmm... why does this look so complicated? */ 71 /* Copy paged appendix. Hmm... why does this look so complicated? */
72 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 72 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
73 int end; 73 int end;
74 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
74 75
75 WARN_ON(start > offset + len); 76 WARN_ON(start > offset + len);
76 77
77 end = start + skb_shinfo(skb)->frags[i].size; 78 end = start + skb_frag_size(frag);
78 copy = end - offset; 79 copy = end - offset;
79 if (copy > 0) { 80 if (copy > 0) {
80 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
81 struct page *page = skb_frag_page(frag); 81 struct page *page = skb_frag_page(frag);
82 82
83 if (copy > len) 83 if (copy > len)
diff --git a/net/ipv4/inet_lro.c b/net/ipv4/inet_lro.c
index 8e6be5aad115..cc280a3f4f96 100644
--- a/net/ipv4/inet_lro.c
+++ b/net/ipv4/inet_lro.c
@@ -244,11 +244,11 @@ static void lro_add_frags(struct net_lro_desc *lro_desc,
244 skb->truesize += truesize; 244 skb->truesize += truesize;
245 245
246 skb_frags[0].page_offset += hlen; 246 skb_frags[0].page_offset += hlen;
247 skb_frags[0].size -= hlen; 247 skb_frag_size_sub(&skb_frags[0], hlen);
248 248
249 while (tcp_data_len > 0) { 249 while (tcp_data_len > 0) {
250 *(lro_desc->next_frag) = *skb_frags; 250 *(lro_desc->next_frag) = *skb_frags;
251 tcp_data_len -= skb_frags->size; 251 tcp_data_len -= skb_frag_size(skb_frags);
252 lro_desc->next_frag++; 252 lro_desc->next_frag++;
253 skb_frags++; 253 skb_frags++;
254 skb_shinfo(skb)->nr_frags++; 254 skb_shinfo(skb)->nr_frags++;
@@ -400,14 +400,14 @@ static struct sk_buff *lro_gen_skb(struct net_lro_mgr *lro_mgr,
400 skb_frags = skb_shinfo(skb)->frags; 400 skb_frags = skb_shinfo(skb)->frags;
401 while (data_len > 0) { 401 while (data_len > 0) {
402 *skb_frags = *frags; 402 *skb_frags = *frags;
403 data_len -= frags->size; 403 data_len -= skb_frag_size(frags);
404 skb_frags++; 404 skb_frags++;
405 frags++; 405 frags++;
406 skb_shinfo(skb)->nr_frags++; 406 skb_shinfo(skb)->nr_frags++;
407 } 407 }
408 408
409 skb_shinfo(skb)->frags[0].page_offset += hdr_len; 409 skb_shinfo(skb)->frags[0].page_offset += hdr_len;
410 skb_shinfo(skb)->frags[0].size -= hdr_len; 410 skb_frag_size_sub(&skb_shinfo(skb)->frags[0], hdr_len);
411 411
412 skb->ip_summed = ip_summed; 412 skb->ip_summed = ip_summed;
413 skb->csum = sum; 413 skb->csum = sum;
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index 763589ad673d..fdaabf2f2b68 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -599,8 +599,8 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,
599 head->next = clone; 599 head->next = clone;
600 skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list; 600 skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list;
601 skb_frag_list_init(head); 601 skb_frag_list_init(head);
602 for (i=0; i<skb_shinfo(head)->nr_frags; i++) 602 for (i = 0; i < skb_shinfo(head)->nr_frags; i++)
603 plen += skb_shinfo(head)->frags[i].size; 603 plen += skb_frag_size(&skb_shinfo(head)->frags[i]);
604 clone->len = clone->data_len = head->data_len - plen; 604 clone->len = clone->data_len = head->data_len - plen;
605 head->data_len -= clone->len; 605 head->data_len -= clone->len;
606 head->len -= clone->len; 606 head->len -= clone->len;
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index ae3bb147affd..e1374ab034bb 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1015,13 +1015,13 @@ alloc_new_skb:
1015 err = -EMSGSIZE; 1015 err = -EMSGSIZE;
1016 goto error; 1016 goto error;
1017 } 1017 }
1018 if (getfrag(from, skb_frag_address(frag)+frag->size, 1018 if (getfrag(from, skb_frag_address(frag)+skb_frag_size(frag),
1019 offset, copy, skb->len, skb) < 0) { 1019 offset, copy, skb->len, skb) < 0) {
1020 err = -EFAULT; 1020 err = -EFAULT;
1021 goto error; 1021 goto error;
1022 } 1022 }
1023 cork->off += copy; 1023 cork->off += copy;
1024 frag->size += copy; 1024 skb_frag_size_add(frag, copy);
1025 skb->len += copy; 1025 skb->len += copy;
1026 skb->data_len += copy; 1026 skb->data_len += copy;
1027 skb->truesize += copy; 1027 skb->truesize += copy;
@@ -1230,7 +1230,7 @@ ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page,
1230 if (len > size) 1230 if (len > size)
1231 len = size; 1231 len = size;
1232 if (skb_can_coalesce(skb, i, page, offset)) { 1232 if (skb_can_coalesce(skb, i, page, offset)) {
1233 skb_shinfo(skb)->frags[i-1].size += len; 1233 skb_frag_size_add(&skb_shinfo(skb)->frags[i-1], len);
1234 } else if (i < MAX_SKB_FRAGS) { 1234 } else if (i < MAX_SKB_FRAGS) {
1235 get_page(page); 1235 get_page(page);
1236 skb_fill_page_desc(skb, i, page, offset, len); 1236 skb_fill_page_desc(skb, i, page, offset, len);
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 4c0da24fb649..132be081cd00 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -813,7 +813,7 @@ new_segment:
813 goto wait_for_memory; 813 goto wait_for_memory;
814 814
815 if (can_coalesce) { 815 if (can_coalesce) {
816 skb_shinfo(skb)->frags[i - 1].size += copy; 816 skb_frag_size_add(&skb_shinfo(skb)->frags[i - 1], copy);
817 } else { 817 } else {
818 get_page(page); 818 get_page(page);
819 skb_fill_page_desc(skb, i, page, offset, copy); 819 skb_fill_page_desc(skb, i, page, offset, copy);
@@ -1058,8 +1058,7 @@ new_segment:
1058 1058
1059 /* Update the skb. */ 1059 /* Update the skb. */
1060 if (merge) { 1060 if (merge) {
1061 skb_shinfo(skb)->frags[i - 1].size += 1061 skb_frag_size_add(&skb_shinfo(skb)->frags[i - 1], copy);
1062 copy;
1063 } else { 1062 } else {
1064 skb_fill_page_desc(skb, i, page, off, copy); 1063 skb_fill_page_desc(skb, i, page, off, copy);
1065 if (TCP_PAGE(sk)) { 1064 if (TCP_PAGE(sk)) {
@@ -3031,8 +3030,8 @@ int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *hp,
3031 for (i = 0; i < shi->nr_frags; ++i) { 3030 for (i = 0; i < shi->nr_frags; ++i) {
3032 const struct skb_frag_struct *f = &shi->frags[i]; 3031 const struct skb_frag_struct *f = &shi->frags[i];
3033 struct page *page = skb_frag_page(f); 3032 struct page *page = skb_frag_page(f);
3034 sg_set_page(&sg, page, f->size, f->page_offset); 3033 sg_set_page(&sg, page, skb_frag_size(f), f->page_offset);
3035 if (crypto_hash_update(desc, &sg, f->size)) 3034 if (crypto_hash_update(desc, &sg, skb_frag_size(f)))
3036 return 1; 3035 return 1;
3037 } 3036 }
3038 3037
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index dde6b5768316..ed96c543f1cf 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1094,14 +1094,16 @@ static void __pskb_trim_head(struct sk_buff *skb, int len)
1094 eat = len; 1094 eat = len;
1095 k = 0; 1095 k = 0;
1096 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 1096 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
1097 if (skb_shinfo(skb)->frags[i].size <= eat) { 1097 int size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
1098
1099 if (size <= eat) {
1098 skb_frag_unref(skb, i); 1100 skb_frag_unref(skb, i);
1099 eat -= skb_shinfo(skb)->frags[i].size; 1101 eat -= size;
1100 } else { 1102 } else {
1101 skb_shinfo(skb)->frags[k] = skb_shinfo(skb)->frags[i]; 1103 skb_shinfo(skb)->frags[k] = skb_shinfo(skb)->frags[i];
1102 if (eat) { 1104 if (eat) {
1103 skb_shinfo(skb)->frags[k].page_offset += eat; 1105 skb_shinfo(skb)->frags[k].page_offset += eat;
1104 skb_shinfo(skb)->frags[k].size -= eat; 1106 skb_frag_size_sub(&skb_shinfo(skb)->frags[k], eat);
1105 eat = 0; 1107 eat = 0;
1106 } 1108 }
1107 k++; 1109 k++;
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 1e20b64e646c..1c9bf8b5c30a 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1512,13 +1512,14 @@ alloc_new_skb:
1512 err = -EMSGSIZE; 1512 err = -EMSGSIZE;
1513 goto error; 1513 goto error;
1514 } 1514 }
1515 if (getfrag(from, skb_frag_address(frag)+frag->size, 1515 if (getfrag(from,
1516 skb_frag_address(frag) + skb_frag_size(frag),
1516 offset, copy, skb->len, skb) < 0) { 1517 offset, copy, skb->len, skb) < 0) {
1517 err = -EFAULT; 1518 err = -EFAULT;
1518 goto error; 1519 goto error;
1519 } 1520 }
1520 sk->sk_sndmsg_off += copy; 1521 sk->sk_sndmsg_off += copy;
1521 frag->size += copy; 1522 skb_frag_size_add(frag, copy);
1522 skb->len += copy; 1523 skb->len += copy;
1523 skb->data_len += copy; 1524 skb->data_len += copy;
1524 skb->truesize += copy; 1525 skb->truesize += copy;
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 085727263812..e8762c73b170 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -378,8 +378,8 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev)
378 head->next = clone; 378 head->next = clone;
379 skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list; 379 skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list;
380 skb_frag_list_init(head); 380 skb_frag_list_init(head);
381 for (i=0; i<skb_shinfo(head)->nr_frags; i++) 381 for (i = 0; i < skb_shinfo(head)->nr_frags; i++)
382 plen += skb_shinfo(head)->frags[i].size; 382 plen += skb_frag_size(&skb_shinfo(head)->frags[i]);
383 clone->len = clone->data_len = head->data_len - plen; 383 clone->len = clone->data_len = head->data_len - plen;
384 head->data_len -= clone->len; 384 head->data_len -= clone->len;
385 head->len -= clone->len; 385 head->len -= clone->len;
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 7b954e2539d0..cc22099ac8b6 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -464,8 +464,8 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
464 head->next = clone; 464 head->next = clone;
465 skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list; 465 skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list;
466 skb_frag_list_init(head); 466 skb_frag_list_init(head);
467 for (i=0; i<skb_shinfo(head)->nr_frags; i++) 467 for (i = 0; i < skb_shinfo(head)->nr_frags; i++)
468 plen += skb_shinfo(head)->frags[i].size; 468 plen += skb_frag_size(&skb_shinfo(head)->frags[i]);
469 clone->len = clone->data_len = head->data_len - plen; 469 clone->len = clone->data_len = head->data_len - plen;
470 head->data_len -= clone->len; 470 head->data_len -= clone->len;
471 head->len -= clone->len; 471 head->len -= clone->len;
diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c
index f781b9ab8a54..e5246fbe36c4 100644
--- a/net/xfrm/xfrm_ipcomp.c
+++ b/net/xfrm/xfrm_ipcomp.c
@@ -90,7 +90,7 @@ static int ipcomp_decompress(struct xfrm_state *x, struct sk_buff *skb)
90 len = dlen; 90 len = dlen;
91 91
92 frag->page_offset = 0; 92 frag->page_offset = 0;
93 frag->size = len; 93 skb_frag_size_set(frag, len);
94 memcpy(skb_frag_address(frag), scratch, len); 94 memcpy(skb_frag_address(frag), scratch, len);
95 95
96 skb->truesize += len; 96 skb->truesize += len;