diff options
Diffstat (limited to 'drivers/net/ethernet/freescale/gianfar.c')
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index a1b52ec3b930..1d03dcdd5e56 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c | |||
@@ -1765,7 +1765,6 @@ static void free_skb_resources(struct gfar_private *priv) | |||
1765 | sizeof(struct rxbd8) * priv->total_rx_ring_size, | 1765 | sizeof(struct rxbd8) * priv->total_rx_ring_size, |
1766 | priv->tx_queue[0]->tx_bd_base, | 1766 | priv->tx_queue[0]->tx_bd_base, |
1767 | priv->tx_queue[0]->tx_bd_dma_base); | 1767 | priv->tx_queue[0]->tx_bd_dma_base); |
1768 | skb_queue_purge(&priv->rx_recycle); | ||
1769 | } | 1768 | } |
1770 | 1769 | ||
1771 | void gfar_start(struct net_device *dev) | 1770 | void gfar_start(struct net_device *dev) |
@@ -1943,8 +1942,6 @@ static int gfar_enet_open(struct net_device *dev) | |||
1943 | 1942 | ||
1944 | enable_napi(priv); | 1943 | enable_napi(priv); |
1945 | 1944 | ||
1946 | skb_queue_head_init(&priv->rx_recycle); | ||
1947 | |||
1948 | /* Initialize a bunch of registers */ | 1945 | /* Initialize a bunch of registers */ |
1949 | init_registers(dev); | 1946 | init_registers(dev); |
1950 | 1947 | ||
@@ -2533,16 +2530,7 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue) | |||
2533 | 2530 | ||
2534 | bytes_sent += skb->len; | 2531 | bytes_sent += skb->len; |
2535 | 2532 | ||
2536 | /* If there's room in the queue (limit it to rx_buffer_size) | 2533 | dev_kfree_skb_any(skb); |
2537 | * we add this skb back into the pool, if it's the right size | ||
2538 | */ | ||
2539 | if (skb_queue_len(&priv->rx_recycle) < rx_queue->rx_ring_size && | ||
2540 | skb_recycle_check(skb, priv->rx_buffer_size + | ||
2541 | RXBUF_ALIGNMENT)) { | ||
2542 | gfar_align_skb(skb); | ||
2543 | skb_queue_head(&priv->rx_recycle, skb); | ||
2544 | } else | ||
2545 | dev_kfree_skb_any(skb); | ||
2546 | 2534 | ||
2547 | tx_queue->tx_skbuff[skb_dirtytx] = NULL; | 2535 | tx_queue->tx_skbuff[skb_dirtytx] = NULL; |
2548 | 2536 | ||
@@ -2608,7 +2596,7 @@ static void gfar_new_rxbdp(struct gfar_priv_rx_q *rx_queue, struct rxbd8 *bdp, | |||
2608 | static struct sk_buff *gfar_alloc_skb(struct net_device *dev) | 2596 | static struct sk_buff *gfar_alloc_skb(struct net_device *dev) |
2609 | { | 2597 | { |
2610 | struct gfar_private *priv = netdev_priv(dev); | 2598 | struct gfar_private *priv = netdev_priv(dev); |
2611 | struct sk_buff *skb = NULL; | 2599 | struct sk_buff *skb; |
2612 | 2600 | ||
2613 | skb = netdev_alloc_skb(dev, priv->rx_buffer_size + RXBUF_ALIGNMENT); | 2601 | skb = netdev_alloc_skb(dev, priv->rx_buffer_size + RXBUF_ALIGNMENT); |
2614 | if (!skb) | 2602 | if (!skb) |
@@ -2621,14 +2609,7 @@ static struct sk_buff *gfar_alloc_skb(struct net_device *dev) | |||
2621 | 2609 | ||
2622 | struct sk_buff *gfar_new_skb(struct net_device *dev) | 2610 | struct sk_buff *gfar_new_skb(struct net_device *dev) |
2623 | { | 2611 | { |
2624 | struct gfar_private *priv = netdev_priv(dev); | 2612 | return gfar_alloc_skb(dev); |
2625 | struct sk_buff *skb = NULL; | ||
2626 | |||
2627 | skb = skb_dequeue(&priv->rx_recycle); | ||
2628 | if (!skb) | ||
2629 | skb = gfar_alloc_skb(dev); | ||
2630 | |||
2631 | return skb; | ||
2632 | } | 2613 | } |
2633 | 2614 | ||
2634 | static inline void count_errors(unsigned short status, struct net_device *dev) | 2615 | static inline void count_errors(unsigned short status, struct net_device *dev) |
@@ -2787,7 +2768,7 @@ int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit) | |||
2787 | if (unlikely(!newskb)) | 2768 | if (unlikely(!newskb)) |
2788 | newskb = skb; | 2769 | newskb = skb; |
2789 | else if (skb) | 2770 | else if (skb) |
2790 | skb_queue_head(&priv->rx_recycle, skb); | 2771 | dev_kfree_skb(skb); |
2791 | } else { | 2772 | } else { |
2792 | /* Increment the number of packets */ | 2773 | /* Increment the number of packets */ |
2793 | rx_queue->stats.rx_packets++; | 2774 | rx_queue->stats.rx_packets++; |