tree 12bc14f038ed644faa6299912453f2784f755315
parent 2f761478a2b436efa23659b4d5c826e53b11f91a
author Chuck Ebbert <[EMAIL PROTECTED]> Sun, 03 Jul 2005 05:28:21 -0400
committer Jeff Garzik <[EMAIL PROTECTED]> Sun, 31 Jul 2005 09:06:10 -0400

[PATCH] loopback: #ifdef the TSO code

This patch #ifdefs the TSO code in the loopback driver.

Saves ~800 bytes of text on i386 and avoids a conditional in the fast path.

Signed-off-by: Chuck Ebbert <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>

 drivers/net/loopback.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -68,6 +68,7 @@ static DEFINE_PER_CPU(struct net_device_
  * of largesending device modulo TCP checksum, which is ignored for loopback.
  */
 
+#ifdef LOOPBACK_TSO
 static void emulate_large_send_offload(struct sk_buff *skb)
 {
        struct iphdr *iph = skb->nh.iph;
@@ -119,6 +120,7 @@ static void emulate_large_send_offload(s
 
        dev_kfree_skb(skb);
 }
+#endif /* LOOPBACK_TSO */
 
 /*
  * The higher levels take care of making this non-reentrant (it's
@@ -136,6 +138,7 @@ static int loopback_xmit(struct sk_buff 
        skb->ip_summed = CHECKSUM_UNNECESSARY;
 #endif
 
+#ifdef LOOPBACK_TSO
        if (skb_shinfo(skb)->tso_size) {
                BUG_ON(skb->protocol != htons(ETH_P_IP));
                BUG_ON(skb->nh.iph->protocol != IPPROTO_TCP);
@@ -143,7 +146,7 @@ static int loopback_xmit(struct sk_buff 
                emulate_large_send_offload(skb);
                return 0;
        }
-
+#endif
        dev->last_rx = jiffies;
 
        lb_stats = &per_cpu(loopback_stats, get_cpu());
@@ -209,6 +212,9 @@ struct net_device loopback_dev = {
        .rebuild_header         = eth_rebuild_header,
        .flags                  = IFF_LOOPBACK,
        .features               = NETIF_F_SG|NETIF_F_FRAGLIST
+#ifdef LOOPBACK_TSO
+                                 |NETIF_F_TSO
+#endif
                                  |NETIF_F_NO_CSUM|NETIF_F_HIGHDMA
                                  |NETIF_F_LLTX,
        .ethtool_ops            = &loopback_ethtool_ops,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to