aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-19 23:29:13 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:26:28 -0400
commit27a884dc3cb63b93c2b3b643f5b31eed5f8a4d26 (patch)
tree5a267e40f9b94014be38dad5de0a52b6628834e0 /drivers
parentbe8bd86321fa7f06359d866ef61fb4d2f3e9dce9 (diff)
[SK_BUFF]: Convert skb->tail to sk_buff_data_t
So that it is also an offset from skb->head, reduces its size from 8 to 4 bytes on 64bit architectures, allowing us to combine the 4 bytes hole left by the layer headers conversion, reducing struct sk_buff size to 256 bytes, i.e. 4 64byte cachelines, and since the sk_buff slab cache is SLAB_HWCACHE_ALIGN... :-) Many calculations that previously required that skb->{transport,network, mac}_header be first converted to a pointer now can be done directly, being meaningful as offsets or pointers. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/atm/he.c4
-rw-r--r--drivers/atm/idt77252.c3
-rw-r--r--drivers/atm/nicstar.c10
-rw-r--r--drivers/infiniband/hw/amso1100/c2.c5
-rw-r--r--drivers/isdn/i4l/isdn_net.c2
-rw-r--r--drivers/media/dvb/dvb-core/dvb_net.c10
-rw-r--r--drivers/net/cris/eth_v10.c2
-rw-r--r--drivers/net/cxgb3/sge.c6
-rw-r--r--drivers/net/e1000/e1000_main.c4
-rw-r--r--drivers/net/ibm_emac/ibm_emac_core.c2
-rw-r--r--drivers/net/macb.c3
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c2
-rw-r--r--drivers/net/s2io.c4
-rw-r--r--drivers/net/tulip/uli526x.c14
-rw-r--r--drivers/net/wan/hdlc_fr.c2
-rw-r--r--drivers/net/wan/lmc/lmc_main.c4
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_rx.c2
-rw-r--r--drivers/s390/net/ctcmain.c11
-rw-r--r--drivers/s390/net/netiucv.c10
-rw-r--r--drivers/usb/atm/usbatm.c10
-rw-r--r--drivers/usb/net/asix.c6
-rw-r--r--drivers/usb/net/gl620a.c2
-rw-r--r--drivers/usb/net/net1080.c2
-rw-r--r--drivers/usb/net/rndis_host.c2
24 files changed, 71 insertions, 51 deletions
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index 8510026b690a..d33aba6864c2 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -1901,13 +1901,13 @@ he_service_rbrq(struct he_dev *he_dev, int group)
1901 case ATM_AAL0: 1901 case ATM_AAL0:
1902 /* 2.10.1.5 raw cell receive */ 1902 /* 2.10.1.5 raw cell receive */
1903 skb->len = ATM_AAL0_SDU; 1903 skb->len = ATM_AAL0_SDU;
1904 skb->tail = skb->data + skb->len; 1904 skb_set_tail_pointer(skb, skb->len);
1905 break; 1905 break;
1906 case ATM_AAL5: 1906 case ATM_AAL5:
1907 /* 2.10.1.2 aal5 receive */ 1907 /* 2.10.1.2 aal5 receive */
1908 1908
1909 skb->len = AAL5_LEN(skb->data, he_vcc->pdu_len); 1909 skb->len = AAL5_LEN(skb->data, he_vcc->pdu_len);
1910 skb->tail = skb->data + skb->len; 1910 skb_set_tail_pointer(skb, skb->len);
1911#ifdef USE_CHECKSUM_HW 1911#ifdef USE_CHECKSUM_HW
1912 if (vcc->vpi == 0 && vcc->vci >= ATM_NOT_RSV_VCI) { 1912 if (vcc->vpi == 0 && vcc->vci >= ATM_NOT_RSV_VCI) {
1913 skb->ip_summed = CHECKSUM_COMPLETE; 1913 skb->ip_summed = CHECKSUM_COMPLETE;
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
index b4b80140c398..1e49799cd6cf 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -1816,7 +1816,8 @@ push_rx_skb(struct idt77252_dev *card, struct sk_buff *skb, int queue)
1816 u32 handle; 1816 u32 handle;
1817 u32 addr; 1817 u32 addr;
1818 1818
1819 skb->data = skb->tail = skb->head; 1819 skb->data = skb->head;
1820 skb_reset_tail_pointer(skb);
1820 skb->len = 0; 1821 skb->len = 0;
1821 1822
1822 skb_reserve(skb, 16); 1823 skb_reserve(skb, 16);
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index aab9b3733d52..26f4b7033494 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -2208,7 +2208,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
2208 if (i == 1 && ns_rsqe_eopdu(rsqe)) 2208 if (i == 1 && ns_rsqe_eopdu(rsqe))
2209 *((u32 *) sb->data) |= 0x00000002; 2209 *((u32 *) sb->data) |= 0x00000002;
2210 skb_put(sb, NS_AAL0_HEADER); 2210 skb_put(sb, NS_AAL0_HEADER);
2211 memcpy(sb->tail, cell, ATM_CELL_PAYLOAD); 2211 memcpy(skb_tail_pointer(sb), cell, ATM_CELL_PAYLOAD);
2212 skb_put(sb, ATM_CELL_PAYLOAD); 2212 skb_put(sb, ATM_CELL_PAYLOAD);
2213 ATM_SKB(sb)->vcc = vcc; 2213 ATM_SKB(sb)->vcc = vcc;
2214 __net_timestamp(sb); 2214 __net_timestamp(sb);
@@ -2252,7 +2252,8 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
2252 vc->rx_iov = iovb; 2252 vc->rx_iov = iovb;
2253 NS_SKB(iovb)->iovcnt = 0; 2253 NS_SKB(iovb)->iovcnt = 0;
2254 iovb->len = 0; 2254 iovb->len = 0;
2255 iovb->tail = iovb->data = iovb->head; 2255 iovb->data = iovb->head;
2256 skb_reset_tail_pointer(iovb);
2256 NS_SKB(iovb)->vcc = vcc; 2257 NS_SKB(iovb)->vcc = vcc;
2257 /* IMPORTANT: a pointer to the sk_buff containing the small or large 2258 /* IMPORTANT: a pointer to the sk_buff containing the small or large
2258 buffer is stored as iovec base, NOT a pointer to the 2259 buffer is stored as iovec base, NOT a pointer to the
@@ -2265,7 +2266,8 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
2265 recycle_iovec_rx_bufs(card, (struct iovec *) iovb->data, NS_MAX_IOVECS); 2266 recycle_iovec_rx_bufs(card, (struct iovec *) iovb->data, NS_MAX_IOVECS);
2266 NS_SKB(iovb)->iovcnt = 0; 2267 NS_SKB(iovb)->iovcnt = 0;
2267 iovb->len = 0; 2268 iovb->len = 0;
2268 iovb->tail = iovb->data = iovb->head; 2269 iovb->data = iovb->head;
2270 skb_reset_tail_pointer(iovb);
2269 NS_SKB(iovb)->vcc = vcc; 2271 NS_SKB(iovb)->vcc = vcc;
2270 } 2272 }
2271 iov = &((struct iovec *) iovb->data)[NS_SKB(iovb)->iovcnt++]; 2273 iov = &((struct iovec *) iovb->data)[NS_SKB(iovb)->iovcnt++];
@@ -2489,7 +2491,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
2489 { 2491 {
2490 lb = (struct sk_buff *) iov->iov_base; 2492 lb = (struct sk_buff *) iov->iov_base;
2491 tocopy = min_t(int, remaining, iov->iov_len); 2493 tocopy = min_t(int, remaining, iov->iov_len);
2492 memcpy(hb->tail, lb->data, tocopy); 2494 memcpy(skb_tail_pointer(hb), lb->data, tocopy);
2493 skb_put(hb, tocopy); 2495 skb_put(hb, tocopy);
2494 iov++; 2496 iov++;
2495 remaining -= tocopy; 2497 remaining -= tocopy;
diff --git a/drivers/infiniband/hw/amso1100/c2.c b/drivers/infiniband/hw/amso1100/c2.c
index 7698feafa6a7..58bc272bd407 100644
--- a/drivers/infiniband/hw/amso1100/c2.c
+++ b/drivers/infiniband/hw/amso1100/c2.c
@@ -439,7 +439,8 @@ static void c2_rx_error(struct c2_port *c2_port, struct c2_element *elem)
439 } 439 }
440 440
441 /* Setup the skb for reuse since we're dropping this pkt */ 441 /* Setup the skb for reuse since we're dropping this pkt */
442 elem->skb->tail = elem->skb->data = elem->skb->head; 442 elem->skb->data = elem->skb->head;
443 skb_reset_tail_pointer(elem->skb);
443 444
444 /* Zero out the rxp hdr in the sk_buff */ 445 /* Zero out the rxp hdr in the sk_buff */
445 memset(elem->skb->data, 0, sizeof(*rxp_hdr)); 446 memset(elem->skb->data, 0, sizeof(*rxp_hdr));
@@ -521,7 +522,7 @@ static void c2_rx_interrupt(struct net_device *netdev)
521 * "sizeof(struct c2_rxp_hdr)". 522 * "sizeof(struct c2_rxp_hdr)".
522 */ 523 */
523 skb->data += sizeof(*rxp_hdr); 524 skb->data += sizeof(*rxp_hdr);
524 skb->tail = skb->data + buflen; 525 skb_set_tail_pointer(skb, buflen);
525 skb->len = buflen; 526 skb->len = buflen;
526 skb->protocol = eth_type_trans(skb, netdev); 527 skb->protocol = eth_type_trans(skb, netdev);
527 528
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index cd3b1fa4a414..aa83277aba74 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -881,7 +881,7 @@ isdn_net_log_skb(struct sk_buff * skb, isdn_net_local * lp)
881 881
882 addinfo[0] = '\0'; 882 addinfo[0] = '\0';
883 /* This check stolen from 2.1.72 dev_queue_xmit_nit() */ 883 /* This check stolen from 2.1.72 dev_queue_xmit_nit() */
884 if (p < skb->data || p >= skb->tail) { 884 if (p < skb->data || skb->network_header >= skb->tail) {
885 /* fall back to old isdn_net_log_packet method() */ 885 /* fall back to old isdn_net_log_packet method() */
886 char * buf = skb->data; 886 char * buf = skb->data;
887 887
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c
index c6b004182d91..9de177a5b9f1 100644
--- a/drivers/media/dvb/dvb-core/dvb_net.c
+++ b/drivers/media/dvb/dvb-core/dvb_net.c
@@ -600,6 +600,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
600 /* Check CRC32, we've got it in our skb already. */ 600 /* Check CRC32, we've got it in our skb already. */
601 unsigned short ulen = htons(priv->ule_sndu_len); 601 unsigned short ulen = htons(priv->ule_sndu_len);
602 unsigned short utype = htons(priv->ule_sndu_type); 602 unsigned short utype = htons(priv->ule_sndu_type);
603 const u8 *tail;
603 struct kvec iov[3] = { 604 struct kvec iov[3] = {
604 { &ulen, sizeof ulen }, 605 { &ulen, sizeof ulen },
605 { &utype, sizeof utype }, 606 { &utype, sizeof utype },
@@ -613,10 +614,11 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
613 } 614 }
614 615
615 ule_crc = iov_crc32(ule_crc, iov, 3); 616 ule_crc = iov_crc32(ule_crc, iov, 3);
616 expected_crc = *((u8 *)priv->ule_skb->tail - 4) << 24 | 617 tail = skb_tail_pointer(priv->ule_skb);
617 *((u8 *)priv->ule_skb->tail - 3) << 16 | 618 expected_crc = *(tail - 4) << 24 |
618 *((u8 *)priv->ule_skb->tail - 2) << 8 | 619 *(tail - 3) << 16 |
619 *((u8 *)priv->ule_skb->tail - 1); 620 *(tail - 2) << 8 |
621 *(tail - 1);
620 if (ule_crc != expected_crc) { 622 if (ule_crc != expected_crc) {
621 printk(KERN_WARNING "%lu: CRC32 check FAILED: %08x / %08x, SNDU len %d type %#x, ts_remain %d, next 2: %x.\n", 623 printk(KERN_WARNING "%lu: CRC32 check FAILED: %08x / %08x, SNDU len %d type %#x, ts_remain %d, next 2: %x.\n",
622 priv->ts_count, ule_crc, expected_crc, priv->ule_sndu_len, priv->ule_sndu_type, ts_remain, ts_remain > 2 ? *(unsigned short *)from_where : 0); 624 priv->ts_count, ule_crc, expected_crc, priv->ule_sndu_len, priv->ule_sndu_type, ts_remain, ts_remain > 2 ? *(unsigned short *)from_where : 0);
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
index 98643801a3b0..7feb9c561147 100644
--- a/drivers/net/cris/eth_v10.c
+++ b/drivers/net/cris/eth_v10.c
@@ -1348,7 +1348,7 @@ e100_rx(struct net_device *dev)
1348 1348
1349#ifdef ETHDEBUG 1349#ifdef ETHDEBUG
1350 printk("head = 0x%x, data = 0x%x, tail = 0x%x, end = 0x%x\n", 1350 printk("head = 0x%x, data = 0x%x, tail = 0x%x, end = 0x%x\n",
1351 skb->head, skb->data, skb->tail, skb->end); 1351 skb->head, skb->data, skb_tail_pointer(skb), skb->end);
1352 printk("copying packet to 0x%x.\n", skb_data_ptr); 1352 printk("copying packet to 0x%x.\n", skb_data_ptr);
1353#endif 1353#endif
1354 1354
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index 610e4769efa4..c5faf1380e15 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -1325,13 +1325,13 @@ static void write_ofld_wr(struct adapter *adap, struct sk_buff *skb,
1325 flits = skb_transport_offset(skb) / 8; 1325 flits = skb_transport_offset(skb) / 8;
1326 sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl; 1326 sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl;
1327 sgl_flits = make_sgl(skb, sgp, skb_transport_header(skb), 1327 sgl_flits = make_sgl(skb, sgp, skb_transport_header(skb),
1328 skb->tail - skb_transport_header(skb), 1328 skb->tail - skb->transport_header,
1329 adap->pdev); 1329 adap->pdev);
1330 if (need_skb_unmap()) { 1330 if (need_skb_unmap()) {
1331 setup_deferred_unmapping(skb, adap->pdev, sgp, sgl_flits); 1331 setup_deferred_unmapping(skb, adap->pdev, sgp, sgl_flits);
1332 skb->destructor = deferred_unmap_destructor; 1332 skb->destructor = deferred_unmap_destructor;
1333 ((struct unmap_info *)skb->cb)->len = (skb->tail - 1333 ((struct unmap_info *)skb->cb)->len = (skb->tail -
1334 skb_transport_header(skb)); 1334 skb->transport_header);
1335 } 1335 }
1336 1336
1337 write_wr_hdr_sgl(ndesc, skb, d, pidx, q, sgl, flits, sgl_flits, 1337 write_wr_hdr_sgl(ndesc, skb, d, pidx, q, sgl, flits, sgl_flits,
@@ -1353,7 +1353,7 @@ static inline unsigned int calc_tx_descs_ofld(const struct sk_buff *skb)
1353 return 1; /* packet fits as immediate data */ 1353 return 1; /* packet fits as immediate data */
1354 1354
1355 flits = skb_transport_offset(skb) / 8; /* headers */ 1355 flits = skb_transport_offset(skb) / 8; /* headers */
1356 if (skb->tail != skb_transport_header(skb)) 1356 if (skb->tail != skb->transport_header)
1357 cnt++; 1357 cnt++;
1358 return flits_to_desc(flits + sgl_len(cnt)); 1358 return flits_to_desc(flits + sgl_len(cnt));
1359} 1359}
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index e86deb2ef823..e7c93f44f810 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3304,7 +3304,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
3304 * NOTE: this is a TSO only workaround 3304 * NOTE: this is a TSO only workaround
3305 * if end byte alignment not correct move us 3305 * if end byte alignment not correct move us
3306 * into the next dword */ 3306 * into the next dword */
3307 if ((unsigned long)(skb->tail - 1) & 4) 3307 if ((unsigned long)(skb_tail_pointer(skb) - 1) & 4)
3308 break; 3308 break;
3309 /* fall through */ 3309 /* fall through */
3310 case e1000_82571: 3310 case e1000_82571:
@@ -4388,7 +4388,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
4388 PCI_DMA_FROMDEVICE); 4388 PCI_DMA_FROMDEVICE);
4389 vaddr = kmap_atomic(ps_page->ps_page[0], 4389 vaddr = kmap_atomic(ps_page->ps_page[0],
4390 KM_SKB_DATA_SOFTIRQ); 4390 KM_SKB_DATA_SOFTIRQ);
4391 memcpy(skb->tail, vaddr, l1); 4391 memcpy(skb_tail_pointer(skb), vaddr, l1);
4392 kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ); 4392 kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ);
4393 pci_dma_sync_single_for_device(pdev, 4393 pci_dma_sync_single_for_device(pdev,
4394 ps_page_dma->ps_page_dma[0], 4394 ps_page_dma->ps_page_dma[0],
diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c
index b1ad62d89eb9..3d82d46f4998 100644
--- a/drivers/net/ibm_emac/ibm_emac_core.c
+++ b/drivers/net/ibm_emac/ibm_emac_core.c
@@ -1338,7 +1338,7 @@ static inline int emac_rx_sg_append(struct ocp_enet_private *dev, int slot)
1338 dev_kfree_skb(dev->rx_sg_skb); 1338 dev_kfree_skb(dev->rx_sg_skb);
1339 dev->rx_sg_skb = NULL; 1339 dev->rx_sg_skb = NULL;
1340 } else { 1340 } else {
1341 cacheable_memcpy(dev->rx_sg_skb->tail, 1341 cacheable_memcpy(skb_tail_pointer(dev->rx_sg_skb),
1342 dev->rx_skb[slot]->data, len); 1342 dev->rx_skb[slot]->data, len);
1343 skb_put(dev->rx_sg_skb, len); 1343 skb_put(dev->rx_sg_skb, len);
1344 emac_recycle_rx_skb(dev, slot, len); 1344 emac_recycle_rx_skb(dev, slot, len);
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 0c3649be0d05..98bf51afcee7 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -575,7 +575,8 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
575 int i; 575 int i;
576 dev_dbg(&bp->pdev->dev, 576 dev_dbg(&bp->pdev->dev,
577 "start_xmit: len %u head %p data %p tail %p end %p\n", 577 "start_xmit: len %u head %p data %p tail %p end %p\n",
578 skb->len, skb->head, skb->data, skb->tail, skb->end); 578 skb->len, skb->head, skb->data,
579 skb_tail_pointer(skb), skb->end);
579 dev_dbg(&bp->pdev->dev, 580 dev_dbg(&bp->pdev->dev,
580 "data:"); 581 "data:");
581 for (i = 0; i < 16; i++) 582 for (i = 0; i < 16; i++)
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index ec0af65cd5d7..73da611fd536 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -1185,7 +1185,7 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt)
1185 skb_reserve(skb, 2); 1185 skb_reserve(skb, 2);
1186 insw(ioaddr + AM2150_RCV, skb_put(skb, pkt_len), pkt_len>>1); 1186 insw(ioaddr + AM2150_RCV, skb_put(skb, pkt_len), pkt_len>>1);
1187 if (pkt_len & 1) 1187 if (pkt_len & 1)
1188 *(skb->tail-1) = inb(ioaddr + AM2150_RCV); 1188 *(skb_tail_pointer(skb) - 1) = inb(ioaddr + AM2150_RCV);
1189 skb->protocol = eth_type_trans(skb, dev); 1189 skb->protocol = eth_type_trans(skb, dev);
1190 1190
1191 netif_rx(skb); /* Send the packet to the upper (protocol) layers. */ 1191 netif_rx(skb); /* Send the packet to the upper (protocol) layers. */
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 46ebf141ee5a..600d3ff347fc 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -2195,7 +2195,7 @@ static int fill_rxd_3buf(struct s2io_nic *nic, struct RxD_t *rxdp, struct \
2195 frag_list->next = NULL; 2195 frag_list->next = NULL;
2196 tmp = (void *)ALIGN((long)frag_list->data, ALIGN_SIZE + 1); 2196 tmp = (void *)ALIGN((long)frag_list->data, ALIGN_SIZE + 1);
2197 frag_list->data = tmp; 2197 frag_list->data = tmp;
2198 frag_list->tail = tmp; 2198 skb_reset_tail_pointer(frag_list);
2199 2199
2200 /* Buffer-2 receives L4 data payload */ 2200 /* Buffer-2 receives L4 data payload */
2201 ((struct RxD3*)rxdp)->Buffer2_ptr = pci_map_single(nic->pdev, 2201 ((struct RxD3*)rxdp)->Buffer2_ptr = pci_map_single(nic->pdev,
@@ -2349,7 +2349,7 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no)
2349 tmp += ALIGN_SIZE; 2349 tmp += ALIGN_SIZE;
2350 tmp &= ~ALIGN_SIZE; 2350 tmp &= ~ALIGN_SIZE;
2351 skb->data = (void *) (unsigned long)tmp; 2351 skb->data = (void *) (unsigned long)tmp;
2352 skb->tail = (void *) (unsigned long)tmp; 2352 skb_reset_tail_pointer(skb);
2353 2353
2354 if (!(((struct RxD3*)rxdp)->Buffer0_ptr)) 2354 if (!(((struct RxD3*)rxdp)->Buffer0_ptr))
2355 ((struct RxD3*)rxdp)->Buffer0_ptr = 2355 ((struct RxD3*)rxdp)->Buffer0_ptr =
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c
index 9a5850fa644a..e46f4cb02c15 100644
--- a/drivers/net/tulip/uli526x.c
+++ b/drivers/net/tulip/uli526x.c
@@ -829,7 +829,9 @@ static void uli526x_rx_packet(struct net_device *dev, struct uli526x_board_info
829 != NULL) ) { 829 != NULL) ) {
830 /* size less than COPY_SIZE, allocate a rxlen SKB */ 830 /* size less than COPY_SIZE, allocate a rxlen SKB */
831 skb_reserve(skb, 2); /* 16byte align */ 831 skb_reserve(skb, 2); /* 16byte align */
832 memcpy(skb_put(skb, rxlen), rxptr->rx_skb_ptr->tail, rxlen); 832 memcpy(skb_put(skb, rxlen),
833 skb_tail_pointer(rxptr->rx_skb_ptr),
834 rxlen);
833 uli526x_reuse_skb(db, rxptr->rx_skb_ptr); 835 uli526x_reuse_skb(db, rxptr->rx_skb_ptr);
834 } else 836 } else
835 skb_put(skb, rxlen); 837 skb_put(skb, rxlen);
@@ -1175,7 +1177,10 @@ static void uli526x_reuse_skb(struct uli526x_board_info *db, struct sk_buff * sk
1175 1177
1176 if (!(rxptr->rdes0 & cpu_to_le32(0x80000000))) { 1178 if (!(rxptr->rdes0 & cpu_to_le32(0x80000000))) {
1177 rxptr->rx_skb_ptr = skb; 1179 rxptr->rx_skb_ptr = skb;
1178 rxptr->rdes2 = cpu_to_le32( pci_map_single(db->pdev, skb->tail, RX_ALLOC_SIZE, PCI_DMA_FROMDEVICE) ); 1180 rxptr->rdes2 = cpu_to_le32(pci_map_single(db->pdev,
1181 skb_tail_pointer(skb),
1182 RX_ALLOC_SIZE,
1183 PCI_DMA_FROMDEVICE));
1179 wmb(); 1184 wmb();
1180 rxptr->rdes0 = cpu_to_le32(0x80000000); 1185 rxptr->rdes0 = cpu_to_le32(0x80000000);
1181 db->rx_avail_cnt++; 1186 db->rx_avail_cnt++;
@@ -1339,7 +1344,10 @@ static void allocate_rx_buffer(struct uli526x_board_info *db)
1339 if ( ( skb = dev_alloc_skb(RX_ALLOC_SIZE) ) == NULL ) 1344 if ( ( skb = dev_alloc_skb(RX_ALLOC_SIZE) ) == NULL )
1340 break; 1345 break;
1341 rxptr->rx_skb_ptr = skb; /* FIXME (?) */ 1346 rxptr->rx_skb_ptr = skb; /* FIXME (?) */
1342 rxptr->rdes2 = cpu_to_le32( pci_map_single(db->pdev, skb->tail, RX_ALLOC_SIZE, PCI_DMA_FROMDEVICE) ); 1347 rxptr->rdes2 = cpu_to_le32(pci_map_single(db->pdev,
1348 skb_tail_pointer(skb),
1349 RX_ALLOC_SIZE,
1350 PCI_DMA_FROMDEVICE));
1343 wmb(); 1351 wmb();
1344 rxptr->rdes0 = cpu_to_le32(0x80000000); 1352 rxptr->rdes0 = cpu_to_le32(0x80000000);
1345 rxptr = rxptr->next_rx_desc; 1353 rxptr = rxptr->next_rx_desc;
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c
index b747228c7198..aeb2789adf26 100644
--- a/drivers/net/wan/hdlc_fr.c
+++ b/drivers/net/wan/hdlc_fr.c
@@ -533,7 +533,7 @@ static void fr_lmi_send(struct net_device *dev, int fullrep)
533 skb->protocol = __constant_htons(NLPID_CCITT_ANSI_LMI); 533 skb->protocol = __constant_htons(NLPID_CCITT_ANSI_LMI);
534 fr_hard_header(&skb, LMI_CCITT_ANSI_DLCI); 534 fr_hard_header(&skb, LMI_CCITT_ANSI_DLCI);
535 } 535 }
536 data = skb->tail; 536 data = skb_tail_pointer(skb);
537 data[i++] = LMI_CALLREF; 537 data[i++] = LMI_CALLREF;
538 data[i++] = dce ? LMI_STATUS : LMI_STATUS_ENQUIRY; 538 data[i++] = dce ? LMI_STATUS : LMI_STATUS_ENQUIRY;
539 if (lmi == LMI_ANSI) 539 if (lmi == LMI_ANSI)
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index d4851465c83b..b731f3aae0df 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -1636,7 +1636,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/
1636 if (nsb) { 1636 if (nsb) {
1637 sc->lmc_rxq[i] = nsb; 1637 sc->lmc_rxq[i] = nsb;
1638 nsb->dev = dev; 1638 nsb->dev = dev;
1639 sc->lmc_rxring[i].buffer1 = virt_to_bus (nsb->tail); 1639 sc->lmc_rxring[i].buffer1 = virt_to_bus(skb_tail_pointer(nsb));
1640 } 1640 }
1641 sc->failed_recv_alloc = 1; 1641 sc->failed_recv_alloc = 1;
1642 goto skip_packet; 1642 goto skip_packet;
@@ -1679,7 +1679,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/
1679 if (nsb) { 1679 if (nsb) {
1680 sc->lmc_rxq[i] = nsb; 1680 sc->lmc_rxq[i] = nsb;
1681 nsb->dev = dev; 1681 nsb->dev = dev;
1682 sc->lmc_rxring[i].buffer1 = virt_to_bus (nsb->tail); 1682 sc->lmc_rxring[i].buffer1 = virt_to_bus(skb_tail_pointer(nsb));
1683 /* Transferred to 21140 below */ 1683 /* Transferred to 21140 below */
1684 } 1684 }
1685 else { 1685 else {
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c
index 35a3a50724fe..5e3e9e262706 100644
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c
@@ -922,7 +922,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
922 if (frag != 0) 922 if (frag != 0)
923 flen -= hdrlen; 923 flen -= hdrlen;
924 924
925 if (frag_skb->tail + flen > frag_skb->end) { 925 if (skb_tail_pointer(frag_skb) + flen > frag_skb->end) {
926 printk(KERN_WARNING "%s: host decrypted and " 926 printk(KERN_WARNING "%s: host decrypted and "
927 "reassembled frame did not fit skb\n", 927 "reassembled frame did not fit skb\n",
928 dev->name); 928 dev->name);
diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c
index 787c01317042..54e3f806cd52 100644
--- a/drivers/s390/net/ctcmain.c
+++ b/drivers/s390/net/ctcmain.c
@@ -706,7 +706,8 @@ ch_action_txdone(fsm_instance * fi, int event, void *arg)
706 spin_unlock(&ch->collect_lock); 706 spin_unlock(&ch->collect_lock);
707 return; 707 return;
708 } 708 }
709 ch->trans_skb->tail = ch->trans_skb->data = ch->trans_skb_data; 709 ch->trans_skb->data = ch->trans_skb_data;
710 skb_reset_tail_pointer(ch->trans_skb);
710 ch->trans_skb->len = 0; 711 ch->trans_skb->len = 0;
711 if (ch->prof.maxmulti < (ch->collect_len + 2)) 712 if (ch->prof.maxmulti < (ch->collect_len + 2))
712 ch->prof.maxmulti = ch->collect_len + 2; 713 ch->prof.maxmulti = ch->collect_len + 2;
@@ -831,7 +832,8 @@ ch_action_rx(fsm_instance * fi, int event, void *arg)
831 ctc_unpack_skb(ch, skb); 832 ctc_unpack_skb(ch, skb);
832 } 833 }
833 again: 834 again:
834 skb->data = skb->tail = ch->trans_skb_data; 835 skb->data = ch->trans_skb_data;
836 skb_reset_tail_pointer(skb);
835 skb->len = 0; 837 skb->len = 0;
836 if (ctc_checkalloc_buffer(ch, 1)) 838 if (ctc_checkalloc_buffer(ch, 1))
837 return; 839 return;
@@ -2226,7 +2228,8 @@ transmit_skb(struct channel *ch, struct sk_buff *skb)
2226 * IDAL support in CTC is broken, so we have to 2228 * IDAL support in CTC is broken, so we have to
2227 * care about skb's above 2G ourselves. 2229 * care about skb's above 2G ourselves.
2228 */ 2230 */
2229 hi = ((unsigned long) skb->tail + LL_HEADER_LENGTH) >> 31; 2231 hi = ((unsigned long)skb_tail_pointer(skb) +
2232 LL_HEADER_LENGTH) >> 31;
2230 if (hi) { 2233 if (hi) {
2231 nskb = alloc_skb(skb->len, GFP_ATOMIC | GFP_DMA); 2234 nskb = alloc_skb(skb->len, GFP_ATOMIC | GFP_DMA);
2232 if (!nskb) { 2235 if (!nskb) {
@@ -2262,7 +2265,7 @@ transmit_skb(struct channel *ch, struct sk_buff *skb)
2262 return -EBUSY; 2265 return -EBUSY;
2263 } 2266 }
2264 2267
2265 ch->trans_skb->tail = ch->trans_skb->data; 2268 skb_reset_tail_pointer(ch->trans_skb);
2266 ch->trans_skb->len = 0; 2269 ch->trans_skb->len = 0;
2267 ch->ccw[1].count = skb->len; 2270 ch->ccw[1].count = skb->len;
2268 memcpy(skb_put(ch->trans_skb, skb->len), skb->data, 2271 memcpy(skb_put(ch->trans_skb, skb->len), skb->data,
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index 82edf2014402..cd42bd54988c 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -689,7 +689,8 @@ static void conn_action_rx(fsm_instance *fi, int event, void *arg)
689 msg->length, conn->max_buffsize); 689 msg->length, conn->max_buffsize);
690 return; 690 return;
691 } 691 }
692 conn->rx_buff->data = conn->rx_buff->tail = conn->rx_buff->head; 692 conn->rx_buff->data = conn->rx_buff->head;
693 skb_reset_tail_pointer(conn->rx_buff);
693 conn->rx_buff->len = 0; 694 conn->rx_buff->len = 0;
694 rc = iucv_message_receive(conn->path, msg, 0, conn->rx_buff->data, 695 rc = iucv_message_receive(conn->path, msg, 0, conn->rx_buff->data,
695 msg->length, NULL); 696 msg->length, NULL);
@@ -735,7 +736,8 @@ static void conn_action_txdone(fsm_instance *fi, int event, void *arg)
735 } 736 }
736 } 737 }
737 } 738 }
738 conn->tx_buff->data = conn->tx_buff->tail = conn->tx_buff->head; 739 conn->tx_buff->data = conn->tx_buff->head;
740 skb_reset_tail_pointer(conn->tx_buff);
739 conn->tx_buff->len = 0; 741 conn->tx_buff->len = 0;
740 spin_lock_irqsave(&conn->collect_lock, saveflags); 742 spin_lock_irqsave(&conn->collect_lock, saveflags);
741 while ((skb = skb_dequeue(&conn->collect_queue))) { 743 while ((skb = skb_dequeue(&conn->collect_queue))) {
@@ -1164,8 +1166,8 @@ static int netiucv_transmit_skb(struct iucv_connection *conn,
1164 * Copy the skb to a new allocated skb in lowmem only if the 1166 * Copy the skb to a new allocated skb in lowmem only if the
1165 * data is located above 2G in memory or tailroom is < 2. 1167 * data is located above 2G in memory or tailroom is < 2.
1166 */ 1168 */
1167 unsigned long hi = 1169 unsigned long hi = ((unsigned long)(skb_tail_pointer(skb) +
1168 ((unsigned long)(skb->tail + NETIUCV_HDRLEN)) >> 31; 1170 NETIUCV_HDRLEN)) >> 31;
1169 int copied = 0; 1171 int copied = 0;
1170 if (hi || (skb_tailroom(skb) < 2)) { 1172 if (hi || (skb_tailroom(skb) < 2)) {
1171 nskb = alloc_skb(skb->len + NETIUCV_HDRLEN + 1173 nskb = alloc_skb(skb->len + NETIUCV_HDRLEN +
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
index ec63b0ee0743..4d8f282b23d1 100644
--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
@@ -335,15 +335,15 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
335 335
336 sarb = instance->cached_vcc->sarb; 336 sarb = instance->cached_vcc->sarb;
337 337
338 if (sarb->tail + ATM_CELL_PAYLOAD > sarb->end) { 338 if (skb_tail_pointer(sarb) + ATM_CELL_PAYLOAD > sarb->end) {
339 atm_rldbg(instance, "%s: buffer overrun (sarb->len %u, vcc: 0x%p)!\n", 339 atm_rldbg(instance, "%s: buffer overrun (sarb->len %u, vcc: 0x%p)!\n",
340 __func__, sarb->len, vcc); 340 __func__, sarb->len, vcc);
341 /* discard cells already received */ 341 /* discard cells already received */
342 skb_trim(sarb, 0); 342 skb_trim(sarb, 0);
343 UDSL_ASSERT(sarb->tail + ATM_CELL_PAYLOAD <= sarb->end); 343 UDSL_ASSERT(skb_tail_pointer(sarb) + ATM_CELL_PAYLOAD <= sarb->end);
344 } 344 }
345 345
346 memcpy(sarb->tail, source + ATM_CELL_HEADER, ATM_CELL_PAYLOAD); 346 memcpy(skb_tail_pointer(sarb), source + ATM_CELL_HEADER, ATM_CELL_PAYLOAD);
347 __skb_put(sarb, ATM_CELL_PAYLOAD); 347 __skb_put(sarb, ATM_CELL_PAYLOAD);
348 348
349 if (pti & 1) { 349 if (pti & 1) {
@@ -370,7 +370,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
370 goto out; 370 goto out;
371 } 371 }
372 372
373 if (crc32_be(~0, sarb->tail - pdu_length, pdu_length) != 0xc704dd7b) { 373 if (crc32_be(~0, skb_tail_pointer(sarb) - pdu_length, pdu_length) != 0xc704dd7b) {
374 atm_rldbg(instance, "%s: packet failed crc check (vcc: 0x%p)!\n", 374 atm_rldbg(instance, "%s: packet failed crc check (vcc: 0x%p)!\n",
375 __func__, vcc); 375 __func__, vcc);
376 atomic_inc(&vcc->stats->rx_err); 376 atomic_inc(&vcc->stats->rx_err);
@@ -396,7 +396,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
396 goto out; /* atm_charge increments rx_drop */ 396 goto out; /* atm_charge increments rx_drop */
397 } 397 }
398 398
399 memcpy(skb->data, sarb->tail - pdu_length, length); 399 memcpy(skb->data, skb_tail_pointer(sarb) - pdu_length, length);
400 __skb_put(skb, length); 400 __skb_put(skb, length);
401 401
402 vdbg("%s: sending skb 0x%p, skb->len %u, skb->truesize %u", 402 vdbg("%s: sending skb 0x%p, skb->len %u, skb->truesize %u",
diff --git a/drivers/usb/net/asix.c b/drivers/usb/net/asix.c
index 5808ea082459..f56e2dab3712 100644
--- a/drivers/usb/net/asix.c
+++ b/drivers/usb/net/asix.c
@@ -298,7 +298,7 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
298 if (ax_skb) { 298 if (ax_skb) {
299 ax_skb->len = size; 299 ax_skb->len = size;
300 ax_skb->data = packet; 300 ax_skb->data = packet;
301 ax_skb->tail = packet + size; 301 skb_set_tail_pointer(ax_skb, size);
302 usbnet_skb_return(dev, ax_skb); 302 usbnet_skb_return(dev, ax_skb);
303 } else { 303 } else {
304 return 0; 304 return 0;
@@ -338,7 +338,7 @@ static struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
338 && ((headroom + tailroom) >= (4 + padlen))) { 338 && ((headroom + tailroom) >= (4 + padlen))) {
339 if ((headroom < 4) || (tailroom < padlen)) { 339 if ((headroom < 4) || (tailroom < padlen)) {
340 skb->data = memmove(skb->head + 4, skb->data, skb->len); 340 skb->data = memmove(skb->head + 4, skb->data, skb->len);
341 skb->tail = skb->data + skb->len; 341 skb_set_tail_pointer(skb, skb->len);
342 } 342 }
343 } else { 343 } else {
344 struct sk_buff *skb2; 344 struct sk_buff *skb2;
@@ -356,7 +356,7 @@ static struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
356 356
357 if ((skb->len % 512) == 0) { 357 if ((skb->len % 512) == 0) {
358 cpu_to_le32s(&padbytes); 358 cpu_to_le32s(&padbytes);
359 memcpy( skb->tail, &padbytes, sizeof(padbytes)); 359 memcpy(skb_tail_pointer(skb), &padbytes, sizeof(padbytes));
360 skb_put(skb, sizeof(padbytes)); 360 skb_put(skb, sizeof(padbytes));
361 } 361 }
362 return skb; 362 return skb;
diff --git a/drivers/usb/net/gl620a.c b/drivers/usb/net/gl620a.c
index d257a8e026d6..031cf5ca4dbb 100644
--- a/drivers/usb/net/gl620a.c
+++ b/drivers/usb/net/gl620a.c
@@ -157,7 +157,7 @@ genelink_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
157 if ((headroom < (4 + 4*1)) || (tailroom < padlen)) { 157 if ((headroom < (4 + 4*1)) || (tailroom < padlen)) {
158 skb->data = memmove(skb->head + (4 + 4*1), 158 skb->data = memmove(skb->head + (4 + 4*1),
159 skb->data, skb->len); 159 skb->data, skb->len);
160 skb->tail = skb->data + skb->len; 160 skb_set_tail_pointer(skb, skb->len);
161 } 161 }
162 } else { 162 } else {
163 struct sk_buff *skb2; 163 struct sk_buff *skb2;
diff --git a/drivers/usb/net/net1080.c b/drivers/usb/net/net1080.c
index ccebfdef4751..19bf8dae70c9 100644
--- a/drivers/usb/net/net1080.c
+++ b/drivers/usb/net/net1080.c
@@ -520,7 +520,7 @@ net1080_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
520 skb->data = memmove(skb->head 520 skb->data = memmove(skb->head
521 + sizeof (struct nc_header), 521 + sizeof (struct nc_header),
522 skb->data, skb->len); 522 skb->data, skb->len);
523 skb->tail = skb->data + len; 523 skb_set_tail_pointer(skb, len);
524 goto encapsulate; 524 goto encapsulate;
525 } 525 }
526 } 526 }
diff --git a/drivers/usb/net/rndis_host.c b/drivers/usb/net/rndis_host.c
index 39a21c74fdf4..1d36772ba6e1 100644
--- a/drivers/usb/net/rndis_host.c
+++ b/drivers/usb/net/rndis_host.c
@@ -588,7 +588,7 @@ rndis_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
588 if (likely((sizeof *hdr) <= room)) { 588 if (likely((sizeof *hdr) <= room)) {
589 skb->data = memmove(skb->head + sizeof *hdr, 589 skb->data = memmove(skb->head + sizeof *hdr,
590 skb->data, len); 590 skb->data, len);
591 skb->tail = skb->data + len; 591 skb_set_tail_pointer(skb, len);
592 goto fill; 592 goto fill;
593 } 593 }
594 } 594 }