r8169: use hardware auto-padding.
authorfrançois romieu <romieu@fr.zoreil.com>
Sun, 15 Mar 2009 01:09:54 +0000 (01:09 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Mar 2009 03:03:10 +0000 (20:03 -0700)
It shortens the code and fixes the current pci_unmap leak with
padded skb reported by Dave Jones.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/r8169.c

index b3473401c83a3dd0257f006683a831a791c8b1c4..352da2a43c9f0c0b6bc3bb7beb17c9ea68fcf9c1 100644 (file)
@@ -3363,13 +3363,6 @@ static int rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev)
                opts1 |= FirstFrag;
        } else {
                len = skb->len;
-
-               if (unlikely(len < ETH_ZLEN)) {
-                       if (skb_padto(skb, ETH_ZLEN))
-                               goto err_update_stats;
-                       len = ETH_ZLEN;
-               }
-
                opts1 |= FirstFrag | LastFrag;
                tp->tx_skb[entry].skb = skb;
        }
@@ -3407,7 +3400,6 @@ out:
 err_stop:
        netif_stop_queue(dev);
        ret = NETDEV_TX_BUSY;
-err_update_stats:
        dev->stats.tx_dropped++;
        goto out;
 }