Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 9 Jan 2012 22:46:52 +0000 (14:46 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 9 Jan 2012 22:46:52 +0000 (14:46 -0800)
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  igmp: Avoid zero delay when receiving odd mixture of IGMP queries
  netdev: make net_device_ops const
  bcm63xx: make ethtool_ops const
  usbnet: make ethtool_ops const
  net: Fix build with INET disabled.
  net: introduce netif_addr_lock_nested() and call if when appropriate
  net: correct lock name in dev_[uc/mc]_sync documentations.
  net: sk_update_clone is only used in net/core/sock.c
  8139cp: fix missing napi_gro_flush.
  pktgen: set correct max and min in pktgen_setup_inject()
  smsc911x: Unconditionally include linux/smscphy.h in smsc911x.h
  asix: fix infinite loop in rx_fixup()
  net: Default UDP and UNIX diag to 'n'.
  r6040: fix typo in use of MCR0 register bits
  net: fix sock_clone reference mismatch with tcp memcontrol

1  2 
drivers/net/usb/asix.c
drivers/net/usb/cdc_ncm.c
drivers/net/usb/ipheth.c
drivers/net/usb/sierra_net.c
include/linux/netdevice.h
mm/memcontrol.c
net/ipv4/Kconfig

diff --combined drivers/net/usb/asix.c
@@@ -376,7 -376,7 +376,7 @@@ static int asix_rx_fixup(struct usbnet 
  
                skb_pull(skb, (size + 1) & 0xfffe);
  
-               if (skb->len == 0)
+               if (skb->len < sizeof(header))
                        break;
  
                head = (u8 *) skb->data;
@@@ -1152,7 -1152,7 +1152,7 @@@ static int ax88772_bind(struct usbnet *
        return 0;
  }
  
- static struct ethtool_ops ax88178_ethtool_ops = {
+ static const struct ethtool_ops ax88178_ethtool_ops = {
        .get_drvinfo            = asix_get_drvinfo,
        .get_link               = asix_get_link,
        .get_msglevel           = usbnet_get_msglevel,
@@@ -1678,7 -1678,17 +1678,7 @@@ static struct usb_driver asix_driver = 
        .supports_autosuspend = 1,
  };
  
 -static int __init asix_init(void)
 -{
 -      return usb_register(&asix_driver);
 -}
 -module_init(asix_init);
 -
 -static void __exit asix_exit(void)
 -{
 -      usb_deregister(&asix_driver);
 -}
 -module_exit(asix_exit);
 +module_usb_driver(asix_driver);
  
  MODULE_AUTHOR("David Hollis");
  MODULE_VERSION(DRIVER_VERSION);
@@@ -138,7 -138,7 +138,7 @@@ struct cdc_ncm_ctx 
  static void cdc_ncm_tx_timeout(unsigned long arg);
  static const struct driver_info cdc_ncm_info;
  static struct usb_driver cdc_ncm_driver;
- static struct ethtool_ops cdc_ncm_ethtool_ops;
+ static const struct ethtool_ops cdc_ncm_ethtool_ops;
  
  static const struct usb_device_id cdc_devs[] = {
        { USB_INTERFACE_INFO(USB_CLASS_COMM,
@@@ -1220,7 -1220,7 +1220,7 @@@ static struct usb_driver cdc_ncm_drive
        .supports_autosuspend = 1,
  };
  
- static struct ethtool_ops cdc_ncm_ethtool_ops = {
+ static const struct ethtool_ops cdc_ncm_ethtool_ops = {
        .get_drvinfo = cdc_ncm_get_drvinfo,
        .get_link = usbnet_get_link,
        .get_msglevel = usbnet_get_msglevel,
        .nway_reset = usbnet_nway_reset,
  };
  
 -static int __init cdc_ncm_init(void)
 -{
 -      printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION "\n");
 -      return usb_register(&cdc_ncm_driver);
 -}
 -
 -module_init(cdc_ncm_init);
 -
 -static void __exit cdc_ncm_exit(void)
 -{
 -      usb_deregister(&cdc_ncm_driver);
 -}
 -
 -module_exit(cdc_ncm_exit);
 +module_usb_driver(cdc_ncm_driver);
  
  MODULE_AUTHOR("Hans Petter Selasky");
  MODULE_DESCRIPTION("USB CDC NCM host driver");
diff --combined drivers/net/usb/ipheth.c
@@@ -420,7 -420,7 +420,7 @@@ static u32 ipheth_ethtool_op_get_link(s
        return netif_carrier_ok(dev->net);
  }
  
- static struct ethtool_ops ops = {
+ static const struct ethtool_ops ops = {
        .get_link = ipheth_ethtool_op_get_link
  };
  
@@@ -543,7 -543,25 +543,7 @@@ static struct usb_driver ipheth_driver 
        .id_table =     ipheth_table,
  };
  
 -static int __init ipheth_init(void)
 -{
 -      int retval;
 -
 -      retval = usb_register(&ipheth_driver);
 -      if (retval) {
 -              err("usb_register failed: %d", retval);
 -              return retval;
 -      }
 -      return 0;
 -}
 -
 -static void __exit ipheth_exit(void)
 -{
 -      usb_deregister(&ipheth_driver);
 -}
 -
 -module_init(ipheth_init);
 -module_exit(ipheth_exit);
 +module_usb_driver(ipheth_driver);
  
  MODULE_AUTHOR("Diego Giagio <diego@giagio.com>");
  MODULE_DESCRIPTION("Apple iPhone USB Ethernet driver");
@@@ -618,7 -618,7 +618,7 @@@ static u32 sierra_net_get_link(struct n
        return sierra_net_get_private(dev)->link_up && netif_running(net);
  }
  
- static struct ethtool_ops sierra_net_ethtool_ops = {
+ static const struct ethtool_ops sierra_net_ethtool_ops = {
        .get_drvinfo = sierra_net_get_drvinfo,
        .get_link = sierra_net_get_link,
        .get_msglevel = usbnet_get_msglevel,
@@@ -900,9 -900,6 +900,9 @@@ struct sk_buff *sierra_net_tx_fixup(str
        u16 len;
        bool need_tail;
  
 +      BUILD_BUG_ON(FIELD_SIZEOF(struct usbnet, data)
 +                              < sizeof(struct cdc_state));
 +
        dev_dbg(&dev->udev->dev, "%s", __func__);
        if (priv->link_up && check_ethip_packet(skb, dev) && is_ip(skb)) {
                /* enough head room as is? */
@@@ -984,7 -981,21 +984,7 @@@ static struct usb_driver sierra_net_dri
        .no_dynamic_id = 1,
  };
  
 -static int __init sierra_net_init(void)
 -{
 -      BUILD_BUG_ON(FIELD_SIZEOF(struct usbnet, data)
 -                              < sizeof(struct cdc_state));
 -
 -      return usb_register(&sierra_net_driver);
 -}
 -
 -static void __exit sierra_net_exit(void)
 -{
 -      usb_deregister(&sierra_net_driver);
 -}
 -
 -module_exit(sierra_net_exit);
 -module_init(sierra_net_init);
 +module_usb_driver(sierra_net_driver);
  
  MODULE_AUTHOR(DRIVER_AUTHOR);
  MODULE_DESCRIPTION(DRIVER_DESC);
@@@ -2155,7 -2155,7 +2155,7 @@@ extern void netdev_run_todo(void)
   */
  static inline void dev_put(struct net_device *dev)
  {
 -      irqsafe_cpu_dec(*dev->pcpu_refcnt);
 +      this_cpu_dec(*dev->pcpu_refcnt);
  }
  
  /**
   */
  static inline void dev_hold(struct net_device *dev)
  {
 -      irqsafe_cpu_inc(*dev->pcpu_refcnt);
 +      this_cpu_inc(*dev->pcpu_refcnt);
  }
  
  /* Carrier loss detection, dial on demand. The functions netif_carrier_on
@@@ -2450,6 -2450,11 +2450,11 @@@ static inline void netif_addr_lock(stru
        spin_lock(&dev->addr_list_lock);
  }
  
+ static inline void netif_addr_lock_nested(struct net_device *dev)
+ {
+       spin_lock_nested(&dev->addr_list_lock, SINGLE_DEPTH_NESTING);
+ }
  static inline void netif_addr_lock_bh(struct net_device *dev)
  {
        spin_lock_bh(&dev->addr_list_lock);
diff --combined mm/memcontrol.c
@@@ -381,16 -381,25 +381,25 @@@ static void mem_cgroup_put(struct mem_c
  static bool mem_cgroup_is_root(struct mem_cgroup *memcg);
  void sock_update_memcg(struct sock *sk)
  {
-       /* A socket spends its whole life in the same cgroup */
-       if (sk->sk_cgrp) {
-               WARN_ON(1);
-               return;
-       }
        if (static_branch(&memcg_socket_limit_enabled)) {
                struct mem_cgroup *memcg;
  
                BUG_ON(!sk->sk_prot->proto_cgroup);
  
+               /* Socket cloning can throw us here with sk_cgrp already
+                * filled. It won't however, necessarily happen from
+                * process context. So the test for root memcg given
+                * the current task's memcg won't help us in this case.
+                *
+                * Respecting the original socket's memcg is a better
+                * decision in this case.
+                */
+               if (sk->sk_cgrp) {
+                       BUG_ON(mem_cgroup_is_root(sk->sk_cgrp->memcg));
+                       mem_cgroup_get(sk->sk_cgrp->memcg);
+                       return;
+               }
                rcu_read_lock();
                memcg = mem_cgroup_from_task(current);
                if (!mem_cgroup_is_root(memcg)) {
@@@ -5391,9 -5400,8 +5400,9 @@@ static void mem_cgroup_clear_mc(void
  
  static int mem_cgroup_can_attach(struct cgroup_subsys *ss,
                                struct cgroup *cgroup,
 -                              struct task_struct *p)
 +                              struct cgroup_taskset *tset)
  {
 +      struct task_struct *p = cgroup_taskset_first(tset);
        int ret = 0;
        struct mem_cgroup *memcg = mem_cgroup_from_cont(cgroup);
  
  
  static void mem_cgroup_cancel_attach(struct cgroup_subsys *ss,
                                struct cgroup *cgroup,
 -                              struct task_struct *p)
 +                              struct cgroup_taskset *tset)
  {
        mem_cgroup_clear_mc();
  }
@@@ -5548,9 -5556,9 +5557,9 @@@ retry
  
  static void mem_cgroup_move_task(struct cgroup_subsys *ss,
                                struct cgroup *cont,
 -                              struct cgroup *old_cont,
 -                              struct task_struct *p)
 +                              struct cgroup_taskset *tset)
  {
 +      struct task_struct *p = cgroup_taskset_first(tset);
        struct mm_struct *mm = get_task_mm(p);
  
        if (mm) {
  #else /* !CONFIG_MMU */
  static int mem_cgroup_can_attach(struct cgroup_subsys *ss,
                                struct cgroup *cgroup,
 -                              struct task_struct *p)
 +                              struct cgroup_taskset *tset)
  {
        return 0;
  }
  static void mem_cgroup_cancel_attach(struct cgroup_subsys *ss,
                                struct cgroup *cgroup,
 -                              struct task_struct *p)
 +                              struct cgroup_taskset *tset)
  {
  }
  static void mem_cgroup_move_task(struct cgroup_subsys *ss,
                                struct cgroup *cont,
 -                              struct cgroup *old_cont,
 -                              struct task_struct *p)
 +                              struct cgroup_taskset *tset)
  {
  }
  #endif
diff --combined net/ipv4/Kconfig
@@@ -163,6 -163,8 +163,6 @@@ config IP_PNP_RAR
          operating on your network. Read
          <file:Documentation/filesystems/nfs/nfsroot.txt> for details.
  
 -# not yet ready..
 -#   bool '    IP: ARP support' CONFIG_IP_PNP_ARP
  config NET_IPIP
        tristate "IP: tunneling"
        select INET_TUNNEL
@@@ -408,8 -410,12 +408,12 @@@ config INET_TCP_DIA
        def_tristate INET_DIAG
  
  config INET_UDP_DIAG
+       tristate "UDP: socket monitoring interface"
        depends on INET_DIAG
-       def_tristate INET_DIAG && IPV6
+       default n
+       ---help---
+         Support for UDP socket monitoring interface used by the ss tool.
+         If unsure, say Y.
  
  menuconfig TCP_CONG_ADVANCED
        bool "TCP: advanced congestion control"