diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-08-18 11:17:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-18 23:26:53 -0400 |
commit | 724b694225e711f95e6265afdbc304c9e7eb3721 (patch) | |
tree | 9fbad7f1126dee297108e943082ae565b7a72bac /drivers | |
parent | 6b84dacadbdc3dab6a5b313d20d5a93b0d998641 (diff) |
sky2: no recycling
Recycling turns out to be a bad idea! For most use cases, the
packet can not be reused: TCP packets are cloned. Even for the ideal
case of forwarding, it hurts performance because of CPU ping/pong.
On a multi-core system forwarding of 64 byte packets is worse
much worse: recycling = 24% forwarded vs no recycling = 42% forwarded
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.c | 16 | ||||
-rw-r--r-- | drivers/net/sky2.h | 1 |
2 files changed, 3 insertions, 14 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index a3e40d70c071..1b79d3311e6c 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -1177,7 +1177,6 @@ static void sky2_rx_clean(struct sky2_port *sky2) | |||
1177 | re->skb = NULL; | 1177 | re->skb = NULL; |
1178 | } | 1178 | } |
1179 | } | 1179 | } |
1180 | skb_queue_purge(&sky2->rx_recycle); | ||
1181 | } | 1180 | } |
1182 | 1181 | ||
1183 | /* Basic MII support */ | 1182 | /* Basic MII support */ |
@@ -1269,10 +1268,8 @@ static struct sk_buff *sky2_rx_alloc(struct sky2_port *sky2) | |||
1269 | struct sk_buff *skb; | 1268 | struct sk_buff *skb; |
1270 | int i; | 1269 | int i; |
1271 | 1270 | ||
1272 | skb = __skb_dequeue(&sky2->rx_recycle); | 1271 | skb = netdev_alloc_skb(sky2->netdev, |
1273 | if (!skb) | 1272 | sky2->rx_data_size + sky2_rx_pad(sky2->hw)); |
1274 | skb = netdev_alloc_skb(sky2->netdev, sky2->rx_data_size | ||
1275 | + sky2_rx_pad(sky2->hw)); | ||
1276 | if (!skb) | 1273 | if (!skb) |
1277 | goto nomem; | 1274 | goto nomem; |
1278 | 1275 | ||
@@ -1364,8 +1361,6 @@ static int sky2_rx_start(struct sky2_port *sky2) | |||
1364 | 1361 | ||
1365 | sky2->rx_data_size = size; | 1362 | sky2->rx_data_size = size; |
1366 | 1363 | ||
1367 | skb_queue_head_init(&sky2->rx_recycle); | ||
1368 | |||
1369 | /* Fill Rx ring */ | 1364 | /* Fill Rx ring */ |
1370 | for (i = 0; i < sky2->rx_pending; i++) { | 1365 | for (i = 0; i < sky2->rx_pending; i++) { |
1371 | re = sky2->rx_ring + i; | 1366 | re = sky2->rx_ring + i; |
@@ -1776,12 +1771,7 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done) | |||
1776 | dev->stats.tx_packets++; | 1771 | dev->stats.tx_packets++; |
1777 | dev->stats.tx_bytes += skb->len; | 1772 | dev->stats.tx_bytes += skb->len; |
1778 | 1773 | ||
1779 | if (skb_queue_len(&sky2->rx_recycle) < sky2->rx_pending | 1774 | dev_kfree_skb_any(skb); |
1780 | && skb_recycle_check(skb, sky2->rx_data_size | ||
1781 | + sky2_rx_pad(sky2->hw))) | ||
1782 | __skb_queue_head(&sky2->rx_recycle, skb); | ||
1783 | else | ||
1784 | dev_kfree_skb_any(skb); | ||
1785 | 1775 | ||
1786 | sky2->tx_next = RING_NEXT(idx, sky2->tx_ring_size); | 1776 | sky2->tx_next = RING_NEXT(idx, sky2->tx_ring_size); |
1787 | } | 1777 | } |
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h index 9d07a466aec1..73c954712467 100644 --- a/drivers/net/sky2.h +++ b/drivers/net/sky2.h | |||
@@ -2032,7 +2032,6 @@ struct sky2_port { | |||
2032 | u16 rx_pending; | 2032 | u16 rx_pending; |
2033 | u16 rx_data_size; | 2033 | u16 rx_data_size; |
2034 | u16 rx_nfrags; | 2034 | u16 rx_nfrags; |
2035 | struct sk_buff_head rx_recycle; | ||
2036 | 2035 | ||
2037 | #ifdef SKY2_VLAN_TAG_USED | 2036 | #ifdef SKY2_VLAN_TAG_USED |
2038 | u16 rx_tag; | 2037 | u16 rx_tag; |