summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@nuts.davemloft.net>2004-10-20 07:00:23 -0700
committerDavid S. Miller <davem@nuts.davemloft.net>2004-10-20 07:00:23 -0700
commitbd9952f5e97e9d5af0931bfcbe9920e6cb4d35a3 (patch)
tree01107ba57987b98d0bcde1c6c7e2314d6a63e310
parente13a55b19d3384c8225cc9fa7f07c7053f6b78c3 (diff)
parent3ace873f40916682583562c1e1f324a4a50a2811 (diff)
Merge nuts.davemloft.net:/disk1/BK/network-2.6
into nuts.davemloft.net:/disk1/BK/net-2.6
-rw-r--r--include/linux/netdevice.h16
-rw-r--r--net/core/dev.c22
2 files changed, 23 insertions, 15 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 9472745b6510..c102cdce2ebe 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -677,6 +677,7 @@ static inline void dev_kfree_skb_any(struct sk_buff *skb)
#define HAVE_NETIF_RX 1
extern int netif_rx(struct sk_buff *skb);
+extern int netif_rx_ni(struct sk_buff *skb);
#define HAVE_NETIF_RECEIVE_SKB 1
extern int netif_receive_skb(struct sk_buff *skb);
extern int dev_ioctl(unsigned int cmd, void __user *);
@@ -691,21 +692,6 @@ extern void dev_init(void);
extern int netdev_nit;
-/* Post buffer to the network code from _non interrupt_ context.
- * see net/core/dev.c for netif_rx description.
- */
-static inline int netif_rx_ni(struct sk_buff *skb)
-{
- int err = netif_rx(skb);
-
- preempt_disable();
- if (softirq_pending(smp_processor_id()))
- do_softirq();
- preempt_enable();
-
- return err;
-}
-
/* Called by rtnetlink.c:rtnl_unlock() */
extern void netdev_run_todo(void);
diff --git a/net/core/dev.c b/net/core/dev.c
index 88fffb4be34b..9d465856d26b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1587,6 +1587,20 @@ drop:
return NET_RX_DROP;
}
+int netif_rx_ni(struct sk_buff *skb)
+{
+ int err = netif_rx(skb);
+
+ preempt_disable();
+ if (softirq_pending(smp_processor_id()))
+ do_softirq();
+ preempt_enable();
+
+ return err;
+}
+
+EXPORT_SYMBOL(netif_rx_ni);
+
static __inline__ void skb_bond(struct sk_buff *skb)
{
struct net_device *dev = skb->dev;
@@ -2871,6 +2885,14 @@ int register_netdevice(struct net_device *dev)
dev->features &= ~NETIF_F_SG;
}
+ /* TSO requires that SG is present as well. */
+ if ((dev->features & NETIF_F_TSO) &&
+ !(dev->features & NETIF_F_SG)) {
+ printk("%s: Dropping NETIF_F_TSO since no SG feature.\n",
+ dev->name);
+ dev->features &= ~NETIF_F_TSO;
+ }
+
/*
* nil rebuild_header routine,
* that should be never called and used as just bug trap.