aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-08-18 11:17:06 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-18 23:26:43 -0400
commit5dce95e5687a5a335202b03d133c1b4411ef7ce3 (patch)
tree3bb90badb02e92ccd2607e4312116819d424ee7b /drivers
parentd6e74b6b7eda3584a403eebae27f9591a1d9c9ff (diff)
sky2: transmit ring 64 bit conservation
This patch saves elements on transmit ring by only updating the upper 64 bit address when it changes. With many workloads skb's are located in same region, so it saves space. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/sky2.c17
-rw-r--r--drivers/net/sky2.h1
2 files changed, 12 insertions, 6 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index fb841c815b5d..88041e578870 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1016,6 +1016,7 @@ static void tx_init(struct sky2_port *sky2)
1016 le = get_tx_le(sky2, &sky2->tx_prod); 1016 le = get_tx_le(sky2, &sky2->tx_prod);
1017 le->addr = 0; 1017 le->addr = 0;
1018 le->opcode = OP_ADDR64 | HW_OWNER; 1018 le->opcode = OP_ADDR64 | HW_OWNER;
1019 sky2->tx_last_upper = 0;
1019} 1020}
1020 1021
1021static inline struct tx_ring_info *tx_le_re(struct sky2_port *sky2, 1022static inline struct tx_ring_info *tx_le_re(struct sky2_port *sky2,
@@ -1573,8 +1574,9 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
1573 struct sky2_tx_le *le = NULL; 1574 struct sky2_tx_le *le = NULL;
1574 struct tx_ring_info *re; 1575 struct tx_ring_info *re;
1575 unsigned i, len; 1576 unsigned i, len;
1576 u16 slot;
1577 dma_addr_t mapping; 1577 dma_addr_t mapping;
1578 u32 upper;
1579 u16 slot;
1578 u16 mss; 1580 u16 mss;
1579 u8 ctrl; 1581 u8 ctrl;
1580 1582
@@ -1593,9 +1595,11 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
1593 dev->name, slot, skb->len); 1595 dev->name, slot, skb->len);
1594 1596
1595 /* Send high bits if needed */ 1597 /* Send high bits if needed */
1596 if (sizeof(dma_addr_t) > sizeof(u32)) { 1598 upper = upper_32_bits(mapping);
1599 if (upper != sky2->tx_last_upper) {
1597 le = get_tx_le(sky2, &slot); 1600 le = get_tx_le(sky2, &slot);
1598 le->addr = cpu_to_le32(upper_32_bits(mapping)); 1601 le->addr = cpu_to_le32(upper);
1602 sky2->tx_last_upper = upper;
1599 le->opcode = OP_ADDR64 | HW_OWNER; 1603 le->opcode = OP_ADDR64 | HW_OWNER;
1600 } 1604 }
1601 1605
@@ -1681,10 +1685,11 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
1681 if (pci_dma_mapping_error(hw->pdev, mapping)) 1685 if (pci_dma_mapping_error(hw->pdev, mapping))
1682 goto mapping_unwind; 1686 goto mapping_unwind;
1683 1687
1684 if (sizeof(dma_addr_t) > sizeof(u32)) { 1688 upper = upper_32_bits(mapping);
1689 if (upper != sky2->tx_last_upper) {
1685 le = get_tx_le(sky2, &slot); 1690 le = get_tx_le(sky2, &slot);
1686 le->addr = cpu_to_le32(upper_32_bits(mapping)); 1691 le->addr = cpu_to_le32(upper);
1687 le->ctrl = 0; 1692 sky2->tx_last_upper = upper;
1688 le->opcode = OP_ADDR64 | HW_OWNER; 1693 le->opcode = OP_ADDR64 | HW_OWNER;
1689 } 1694 }
1690 1695
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index 65b94c366fbc..feb3204134ed 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -2017,6 +2017,7 @@ struct sky2_port {
2017 2017
2018 u16 tx_pending; 2018 u16 tx_pending;
2019 u16 tx_last_mss; 2019 u16 tx_last_mss;
2020 u32 tx_last_upper;
2020 u32 tx_tcpsum; 2021 u32 tx_tcpsum;
2021 2022
2022 struct rx_ring_info *rx_ring ____cacheline_aligned_in_smp; 2023 struct rx_ring_info *rx_ring ____cacheline_aligned_in_smp;