aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-14 16:25:30 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-14 16:25:30 -0500
commitd018b6f4f1539f3679fbdc2d02d58d09e76be84a (patch)
tree317b9e04d8e7a73a4d07c69a5cb5455ec34f47e5 /net
parent18bce371ae09af6c20ee62c1092a4d1d0e84dd49 (diff)
parent0f73f2c5a3ebb957ee66718c903c17ed71a4fc2e (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (47 commits) GRETH: resolve SMP issues and other problems GRETH: handle frame error interrupts GRETH: avoid writing bad speed/duplex when setting transfer mode GRETH: fixed skb buffer memory leak on frame errors GRETH: GBit transmit descriptor handling optimization GRETH: fix opening/closing GRETH: added raw AMBA vendor/device number to match against. cassini: Fix build bustage on x86. e1000e: consistent use of Rx/Tx vs. RX/TX/rx/tx in comments/logs e1000e: update Copyright for 2011 e1000: Avoid unhandled IRQ r8169: keep firmware in memory. netdev: tilepro: Use is_unicast_ether_addr helper etherdevice.h: Add is_unicast_ether_addr function ks8695net: Use default implementation of ethtool_ops::get_link ks8695net: Disable non-working ethtool operations USB CDC NCM: Don't deref NULL in cdc_ncm_rx_fixup() and don't use uninitialized variable. vxge: Remember to release firmware after upgrading firmware netdev: bfin_mac: Remove is_multicast_ether_addr use in netdev_for_each_mc_addr ipsec: update MAX_AH_AUTH_LEN to support sha512 ...
Diffstat (limited to 'net')
-rw-r--r--net/ax25/af_ax25.c2
-rw-r--r--net/core/dev.c29
-rw-r--r--net/core/skbuff.c2
-rw-r--r--net/ethernet/eth.c2
-rw-r--r--net/ipv6/ip6_output.c3
-rw-r--r--net/ipv6/netfilter/nf_defrag_ipv6_hooks.c8
-rw-r--r--net/netfilter/nf_conntrack_netlink.c3
-rw-r--r--net/sched/sch_teql.c26
8 files changed, 37 insertions, 38 deletions
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index bb86d2932394..6da5daeebab7 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -1392,7 +1392,7 @@ static int ax25_getname(struct socket *sock, struct sockaddr *uaddr,
1392 ax25_cb *ax25; 1392 ax25_cb *ax25;
1393 int err = 0; 1393 int err = 0;
1394 1394
1395 memset(fsa, 0, sizeof(fsa)); 1395 memset(fsa, 0, sizeof(*fsa));
1396 lock_sock(sk); 1396 lock_sock(sk);
1397 ax25 = ax25_sk(sk); 1397 ax25 = ax25_sk(sk);
1398 1398
diff --git a/net/core/dev.c b/net/core/dev.c
index 06d0e7b25385..54277df0f735 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5523,34 +5523,6 @@ void netdev_run_todo(void)
5523 } 5523 }
5524} 5524}
5525 5525
5526/**
5527 * dev_txq_stats_fold - fold tx_queues stats
5528 * @dev: device to get statistics from
5529 * @stats: struct rtnl_link_stats64 to hold results
5530 */
5531void dev_txq_stats_fold(const struct net_device *dev,
5532 struct rtnl_link_stats64 *stats)
5533{
5534 u64 tx_bytes = 0, tx_packets = 0, tx_dropped = 0;
5535 unsigned int i;
5536 struct netdev_queue *txq;
5537
5538 for (i = 0; i < dev->num_tx_queues; i++) {
5539 txq = netdev_get_tx_queue(dev, i);
5540 spin_lock_bh(&txq->_xmit_lock);
5541 tx_bytes += txq->tx_bytes;
5542 tx_packets += txq->tx_packets;
5543 tx_dropped += txq->tx_dropped;
5544 spin_unlock_bh(&txq->_xmit_lock);
5545 }
5546 if (tx_bytes || tx_packets || tx_dropped) {
5547 stats->tx_bytes = tx_bytes;
5548 stats->tx_packets = tx_packets;
5549 stats->tx_dropped = tx_dropped;
5550 }
5551}
5552EXPORT_SYMBOL(dev_txq_stats_fold);
5553
5554/* Convert net_device_stats to rtnl_link_stats64. They have the same 5526/* Convert net_device_stats to rtnl_link_stats64. They have the same
5555 * fields in the same order, with only the type differing. 5527 * fields in the same order, with only the type differing.
5556 */ 5528 */
@@ -5594,7 +5566,6 @@ struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
5594 netdev_stats_to_stats64(storage, ops->ndo_get_stats(dev)); 5566 netdev_stats_to_stats64(storage, ops->ndo_get_stats(dev));
5595 } else { 5567 } else {
5596 netdev_stats_to_stats64(storage, &dev->stats); 5568 netdev_stats_to_stats64(storage, &dev->stats);
5597 dev_txq_stats_fold(dev, storage);
5598 } 5569 }
5599 storage->rx_dropped += atomic_long_read(&dev->rx_dropped); 5570 storage->rx_dropped += atomic_long_read(&dev->rx_dropped);
5600 return storage; 5571 return storage;
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 19d6c21220fd..d31bb36ae0dc 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -380,6 +380,8 @@ static void skb_release_head_state(struct sk_buff *skb)
380 } 380 }
381#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 381#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
382 nf_conntrack_put(skb->nfct); 382 nf_conntrack_put(skb->nfct);
383#endif
384#ifdef NET_SKBUFF_NF_DEFRAG_NEEDED
383 nf_conntrack_put_reasm(skb->nfct_reasm); 385 nf_conntrack_put_reasm(skb->nfct_reasm);
384#endif 386#endif
385#ifdef CONFIG_BRIDGE_NETFILTER 387#ifdef CONFIG_BRIDGE_NETFILTER
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index f9d7ac924f15..44d2b42fda56 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -351,7 +351,7 @@ EXPORT_SYMBOL(ether_setup);
351 * @sizeof_priv: Size of additional driver-private structure to be allocated 351 * @sizeof_priv: Size of additional driver-private structure to be allocated
352 * for this Ethernet device 352 * for this Ethernet device
353 * @txqs: The number of TX queues this device has. 353 * @txqs: The number of TX queues this device has.
354 * @txqs: The number of RX queues this device has. 354 * @rxqs: The number of RX queues this device has.
355 * 355 *
356 * Fill in the fields of the device structure with Ethernet-generic 356 * Fill in the fields of the device structure with Ethernet-generic
357 * values. Basically does everything except registering the device. 357 * values. Basically does everything except registering the device.
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 94b5bf132b2e..5f8d242be3f3 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -401,6 +401,9 @@ int ip6_forward(struct sk_buff *skb)
401 goto drop; 401 goto drop;
402 } 402 }
403 403
404 if (skb->pkt_type != PACKET_HOST)
405 goto drop;
406
404 skb_forward_csum(skb); 407 skb_forward_csum(skb);
405 408
406 /* 409 /*
diff --git a/net/ipv6/netfilter/nf_defrag_ipv6_hooks.c b/net/ipv6/netfilter/nf_defrag_ipv6_hooks.c
index 99abfb53bab9..97c5b21b9674 100644
--- a/net/ipv6/netfilter/nf_defrag_ipv6_hooks.c
+++ b/net/ipv6/netfilter/nf_defrag_ipv6_hooks.c
@@ -19,13 +19,15 @@
19 19
20#include <linux/netfilter_ipv6.h> 20#include <linux/netfilter_ipv6.h>
21#include <linux/netfilter_bridge.h> 21#include <linux/netfilter_bridge.h>
22#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
22#include <net/netfilter/nf_conntrack.h> 23#include <net/netfilter/nf_conntrack.h>
23#include <net/netfilter/nf_conntrack_helper.h> 24#include <net/netfilter/nf_conntrack_helper.h>
24#include <net/netfilter/nf_conntrack_l4proto.h> 25#include <net/netfilter/nf_conntrack_l4proto.h>
25#include <net/netfilter/nf_conntrack_l3proto.h> 26#include <net/netfilter/nf_conntrack_l3proto.h>
26#include <net/netfilter/nf_conntrack_core.h> 27#include <net/netfilter/nf_conntrack_core.h>
27#include <net/netfilter/nf_conntrack_zones.h>
28#include <net/netfilter/ipv6/nf_conntrack_ipv6.h> 28#include <net/netfilter/ipv6/nf_conntrack_ipv6.h>
29#endif
30#include <net/netfilter/nf_conntrack_zones.h>
29#include <net/netfilter/ipv6/nf_defrag_ipv6.h> 31#include <net/netfilter/ipv6/nf_defrag_ipv6.h>
30 32
31static enum ip6_defrag_users nf_ct6_defrag_user(unsigned int hooknum, 33static enum ip6_defrag_users nf_ct6_defrag_user(unsigned int hooknum,
@@ -33,8 +35,10 @@ static enum ip6_defrag_users nf_ct6_defrag_user(unsigned int hooknum,
33{ 35{
34 u16 zone = NF_CT_DEFAULT_ZONE; 36 u16 zone = NF_CT_DEFAULT_ZONE;
35 37
38#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
36 if (skb->nfct) 39 if (skb->nfct)
37 zone = nf_ct_zone((struct nf_conn *)skb->nfct); 40 zone = nf_ct_zone((struct nf_conn *)skb->nfct);
41#endif
38 42
39#ifdef CONFIG_BRIDGE_NETFILTER 43#ifdef CONFIG_BRIDGE_NETFILTER
40 if (skb->nf_bridge && 44 if (skb->nf_bridge &&
@@ -56,9 +60,11 @@ static unsigned int ipv6_defrag(unsigned int hooknum,
56{ 60{
57 struct sk_buff *reasm; 61 struct sk_buff *reasm;
58 62
63#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
59 /* Previously seen (loopback)? */ 64 /* Previously seen (loopback)? */
60 if (skb->nfct && !nf_ct_is_template((struct nf_conn *)skb->nfct)) 65 if (skb->nfct && !nf_ct_is_template((struct nf_conn *)skb->nfct))
61 return NF_ACCEPT; 66 return NF_ACCEPT;
67#endif
62 68
63 reasm = nf_ct_frag6_gather(skb, nf_ct6_defrag_user(hooknum, skb)); 69 reasm = nf_ct_frag6_gather(skb, nf_ct6_defrag_user(hooknum, skb));
64 /* queued */ 70 /* queued */
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index 5cb8d3027b18..2b7eef37875c 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -972,7 +972,8 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb,
972free: 972free:
973 kfree_skb(skb2); 973 kfree_skb(skb2);
974out: 974out:
975 return err; 975 /* this avoids a loop in nfnetlink. */
976 return err == -EAGAIN ? -ENOBUFS : err;
976} 977}
977 978
978#ifdef CONFIG_NF_NAT_NEEDED 979#ifdef CONFIG_NF_NAT_NEEDED
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c
index af9360d1f6eb..84ce48eadff4 100644
--- a/net/sched/sch_teql.c
+++ b/net/sched/sch_teql.c
@@ -59,6 +59,10 @@ struct teql_master
59 struct net_device *dev; 59 struct net_device *dev;
60 struct Qdisc *slaves; 60 struct Qdisc *slaves;
61 struct list_head master_list; 61 struct list_head master_list;
62 unsigned long tx_bytes;
63 unsigned long tx_packets;
64 unsigned long tx_errors;
65 unsigned long tx_dropped;
62}; 66};
63 67
64struct teql_sched_data 68struct teql_sched_data
@@ -274,7 +278,6 @@ static inline int teql_resolve(struct sk_buff *skb,
274static netdev_tx_t teql_master_xmit(struct sk_buff *skb, struct net_device *dev) 278static netdev_tx_t teql_master_xmit(struct sk_buff *skb, struct net_device *dev)
275{ 279{
276 struct teql_master *master = netdev_priv(dev); 280 struct teql_master *master = netdev_priv(dev);
277 struct netdev_queue *txq = netdev_get_tx_queue(dev, 0);
278 struct Qdisc *start, *q; 281 struct Qdisc *start, *q;
279 int busy; 282 int busy;
280 int nores; 283 int nores;
@@ -314,8 +317,8 @@ restart:
314 __netif_tx_unlock(slave_txq); 317 __netif_tx_unlock(slave_txq);
315 master->slaves = NEXT_SLAVE(q); 318 master->slaves = NEXT_SLAVE(q);
316 netif_wake_queue(dev); 319 netif_wake_queue(dev);
317 txq->tx_packets++; 320 master->tx_packets++;
318 txq->tx_bytes += length; 321 master->tx_bytes += length;
319 return NETDEV_TX_OK; 322 return NETDEV_TX_OK;
320 } 323 }
321 __netif_tx_unlock(slave_txq); 324 __netif_tx_unlock(slave_txq);
@@ -342,10 +345,10 @@ restart:
342 netif_stop_queue(dev); 345 netif_stop_queue(dev);
343 return NETDEV_TX_BUSY; 346 return NETDEV_TX_BUSY;
344 } 347 }
345 dev->stats.tx_errors++; 348 master->tx_errors++;
346 349
347drop: 350drop:
348 txq->tx_dropped++; 351 master->tx_dropped++;
349 dev_kfree_skb(skb); 352 dev_kfree_skb(skb);
350 return NETDEV_TX_OK; 353 return NETDEV_TX_OK;
351} 354}
@@ -398,6 +401,18 @@ static int teql_master_close(struct net_device *dev)
398 return 0; 401 return 0;
399} 402}
400 403
404static struct rtnl_link_stats64 *teql_master_stats64(struct net_device *dev,
405 struct rtnl_link_stats64 *stats)
406{
407 struct teql_master *m = netdev_priv(dev);
408
409 stats->tx_packets = m->tx_packets;
410 stats->tx_bytes = m->tx_bytes;
411 stats->tx_errors = m->tx_errors;
412 stats->tx_dropped = m->tx_dropped;
413 return stats;
414}
415
401static int teql_master_mtu(struct net_device *dev, int new_mtu) 416static int teql_master_mtu(struct net_device *dev, int new_mtu)
402{ 417{
403 struct teql_master *m = netdev_priv(dev); 418 struct teql_master *m = netdev_priv(dev);
@@ -422,6 +437,7 @@ static const struct net_device_ops teql_netdev_ops = {
422 .ndo_open = teql_master_open, 437 .ndo_open = teql_master_open,
423 .ndo_stop = teql_master_close, 438 .ndo_stop = teql_master_close,
424 .ndo_start_xmit = teql_master_xmit, 439 .ndo_start_xmit = teql_master_xmit,
440 .ndo_get_stats64 = teql_master_stats64,
425 .ndo_change_mtu = teql_master_mtu, 441 .ndo_change_mtu = teql_master_mtu,
426}; 442};
427 443