Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6068
b: refs/heads/master
c: d2ae1d2
h: refs/heads/master
v: v3
  • Loading branch information
Chuck Ebbert authored and Jeff Garzik committed Jul 31, 2005
1 parent 4804674 commit d149c84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2f761478a2b436efa23659b4d5c826e53b11f91a
refs/heads/master: d2ae1d2ff9282ca061b6f5244eee4c28ee2b3ffa
8 changes: 7 additions & 1 deletion trunk/drivers/net/loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ static DEFINE_PER_CPU(struct net_device_stats, loopback_stats);
* 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;
Expand Down Expand Up @@ -119,6 +120,7 @@ static void emulate_large_send_offload(struct sk_buff *skb)

dev_kfree_skb(skb);
}
#endif /* LOOPBACK_TSO */

/*
* The higher levels take care of making this non-reentrant (it's
Expand All @@ -136,14 +138,15 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
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);

emulate_large_send_offload(skb);
return 0;
}

#endif
dev->last_rx = jiffies;

lb_stats = &per_cpu(loopback_stats, get_cpu());
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d149c84

Please sign in to comment.