aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip/uli526x.c
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/net/tulip/uli526x.c
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/net/tulip/uli526x.c')
-rw-r--r--drivers/net/tulip/uli526x.c14
1 files changed, 11 insertions, 3 deletions
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;