1. 13 Feb, 2013 2 commits
    • Paul Gortmaker's avatar
      gianfar: convert u64 status counters to atomic64_t · 212079df
      Paul Gortmaker authored
      While looking at some asm dump for an unrelated change, Eric
      noticed in the following stats count increment code:
      
          50b8:       81 3c 01 f8     lwz     r9,504(r28)
          50bc:       81 5c 01 fc     lwz     r10,508(r28)
          50c0:       31 4a 00 01     addic   r10,r10,1
          50c4:       7d 29 01 94     addze   r9,r9
          50c8:       91 3c 01 f8     stw     r9,504(r28)
          50cc:       91 5c 01 fc     stw     r10,508(r28)
      
      that a 64 bit counter was used on ppc-32 without sync
      and hence the "ethtool -S" output was racy.
      
      Here we convert all the values to use atomic64_t so that
      the output will always be consistent.
      Reported-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      212079df
    • Paul Gortmaker's avatar
      gianfar: remove largely unused gfar_stats struct · 68719786
      Paul Gortmaker authored
      The gfar_stats struct is only used in copying out data
      via ethtool.  It is declared as the extra stats, followed
      by the rmon stats.  However, the rmon stats are never
      actually ever used in the driver; instead the rmon data
      is a u32 register read that is cast directly into the
      ethtool buf.
      
      It seems the only reason rmon is in the struct at all is
      to give the offset(s) at which it should be exported into
      the ethtool buffer.  But note gfar_stats doesn't contain
      a gfar_extra_stats as a substruct -- instead it contains
      a u64 array of equal element count.  This implicitly means
      we have two independent declarations of what gfar_extra_stats
      really is.  Rather than have this duality, we already have
      defines which give us the offset directly, and hence do not
      need the struct at all.
      
      Further, since we know the extra_stats is unconditionally
      always present, we can write it out to the ethtool buf
      1st, and then optionally write out the rmon data.  There
      is no need for two independent loops, both of which are
      simply copying out the extra_stats to buf offset zero.
      
      This also helps pave the way towards allowing the extra
      stats fields to be converted to atomic64_t values, without
      having their types directly influencing the ethtool stats
      export code (gfar_fill_stats) that expects to deal with u64.
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      68719786
  2. 12 Feb, 2013 3 commits
    • Neil Horman's avatar
      netpoll: cleanup sparse warnings · 0790bbb6
      Neil Horman authored
      With my recent commit I introduced two sparse warnings.  Looking closer there
      were a few more in the same file, so I fixed them all up.  Basic rcu pointer
      dereferencing suff.
      
      I've validated these changes using CONFIG_PROVE_RCU while starting and stopping
      netconsole repeatedly in bonded and non-bonded configurations
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      CC: fengguang.wu@intel.com
      CC: David Miller <davem@davemloft.net>
      CC: eric.dumazet@gmail.com
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0790bbb6
    • Neil Horman's avatar
      netpoll: Fix __netpoll_rcu_free so that it can hold the rtnl lock · 2cde6acd
      Neil Horman authored
      __netpoll_rcu_free is used to free netpoll structures when the rtnl_lock is
      already held.  The mechanism is used to asynchronously call __netpoll_cleanup
      outside of the holding of the rtnl_lock, so as to avoid deadlock.
      Unfortunately, __netpoll_cleanup modifies pointers (dev->np), which means the
      rtnl_lock must be held while calling it.  Further, it cannot be held, because
      rcu callbacks may be issued in softirq contexts, which cannot sleep.
      
      Fix this by converting the rcu callback to a work queue that is guaranteed to
      get scheduled in process context, so that we can hold the rtnl properly while
      calling __netpoll_cleanup
      
      Tested successfully by myself.
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      CC: "David S. Miller" <davem@davemloft.net>
      CC: Cong Wang <amwang@redhat.com>
      CC: Eric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2cde6acd
    • Jean Sacren's avatar
      skbuff: create skb_panic() function and its wrappers · f05de73b
      Jean Sacren authored
      Create skb_panic() function in lieu of both skb_over_panic() and
      skb_under_panic() so that code duplication would be avoided. Update type
      and variable name where necessary.
      
      Jiri Pirko suggested using wrappers so that we would be able to keep the
      fruits of the original code.
      Signed-off-by: default avatarJean Sacren <sakiwit@gmail.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f05de73b
  3. 11 Feb, 2013 22 commits
  4. 08 Feb, 2013 13 commits
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · fd502311
      David S. Miller authored
      Synchronize with 'net' in order to sort out some l2tp, wireless, and
      ipv6 GRE fixes that will be built on top of in 'net-next'.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fd502311
    • Vipul Pandya's avatar
      cxgb4vf: Fix extraction of cpl_rx_pkt from the response queue descriptor · 8b9a4d56
      Vipul Pandya authored
      This was preventing GRO and RxCheckSum offload to happen.
      Signed-off-by: default avatarJay Hernandez <jay@chelsio.com>
      Signed-off-by: default avatarVipul Pandya <vipul@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8b9a4d56
    • Daniel Borkmann's avatar
      net: sctp: sctp_auth_make_key_vector: use sctp_auth_create_key · 03536e23
      Daniel Borkmann authored
      In sctp_auth_make_key_vector, we allocate a temporary sctp_auth_bytes
      structure with kmalloc instead of the sctp_auth_create_key allocator.
      Change this to sctp_auth_create_key as it is the case everywhere else,
      so that we also can properly free it via sctp_auth_key_put. This makes
      it easier for future code changes in the structure and allocator itself,
      since a single API is consistently used for this purpose. Also, by
      using sctp_auth_create_key we're doing sanity checks over the arguments.
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Acked-by: default avatarVlad Yasevich <vyasevich@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      03536e23
    • Eric Dumazet's avatar
      macvlan: add a salt to mc_hash() · 3807ff58
      Eric Dumazet authored
      Some multicast addresses are common to all macvlans,
      so if a multicast message has a hash value collision, we
      have to deliver a copy to all macvlans, adding significant
      latency and possible packet drops if netdev_max_backlog
      limit is hit.
      
      Having a per macvlan hash function permits to reduce the
      impact of hash collisions.
      Suggested-by: default avatarMaciej Żenczykowski <maze@google.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3807ff58
    • Eric Dumazet's avatar
      macvlan: broadcast addr should be part of mc_filter · d5270430
      Eric Dumazet authored
      commit cd431e73 (macvlan: add multicast filter) forgot
      the broadcast case.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarMaciej Żenczykowski <maze@google.com>
      SIgned-off-by: default avatarMaciej Żenczykowski <maze@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d5270430
    • Amerigo Wang's avatar
      ipv6: fix a RCU warning in net/ipv6/ip6_flowlabel.c · 6a98dcf0
      Amerigo Wang authored
      This patch fixes the following RCU warning:
      
      [   51.680236] ===============================
      [   51.681914] [ INFO: suspicious RCU usage. ]
      [   51.683610] 3.8.0-rc6-next-20130206-sasha-00028-g83214f7-dirty #276 Tainted: G        W
      [   51.686703] -------------------------------
      [   51.688281] net/ipv6/ip6_flowlabel.c:671 suspicious rcu_dereference_check() usage!
      
      we should use rcu_dereference_bh() when we hold rcu_read_lock_bh().
      Reported-by: default avatarSasha Levin <sasha.levin@oracle.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
      Signed-off-by: default avatarCong Wang <amwang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6a98dcf0
    • Joe Perches's avatar
      drivers: net: Remove remaining alloc/OOM messages · 14f8dc49
      Joe Perches authored
      alloc failures already get standardized OOM
      messages and a dump_stack.
      
      For the affected mallocs around these OOM messages:
      
      Converted kmallocs with multiplies to kmalloc_array.
      Converted a kmalloc/memcpy to kmemdup.
      Removed now unused stack variables.
      Removed unnecessary parentheses.
      Neatened alignment.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Acked-by: default avatarArend van Spriel <arend@broadcom.com>
      Acked-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      Acked-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      14f8dc49
    • Rafał Miłecki's avatar
      bgmac: fix "cmdcfg" calls for promisc and loopback modes · e9ba1039
      Rafał Miłecki authored
      The last (bool) parameter in bgmac_cmdcfg_maskset says if the write
      should be made, even if value didn't change. Currently driver doesn't
      match the specs about (not) forcing some changes. This makes it follow
      them.
      Reported-by: default avatarNathan Hintz <nlhintz@hotmail.com>
      Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9ba1039
    • Rafał Miłecki's avatar
      bgmac: validate (and random if needed) MAC addr · d166f218
      Rafał Miłecki authored
      This adds check for a valid Ethernet MAC address and in case it is not,
      it will generate a valid random one, such that the adapter is still
      usable.
      Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d166f218
    • Alexander Duyck's avatar
      skbuff: Move definition of NETDEV_FRAG_PAGE_MAX_SIZE · e5e67305
      Alexander Duyck authored
      In order to address the fact that some devices cannot support the full 32K
      frag size we need to have the value accessible somewhere so that we can use it
      to do comparisons against what the device can support.  As such I am moving
      the values out of skbuff.c and into skbuff.h.
      Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e5e67305
    • Linus Torvalds's avatar
      Linux 3.8-rc7 · 836dc9e3
      Linus Torvalds authored
      836dc9e3
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm · 39923134
      Linus Torvalds authored
      Pull ARM fixes from Russell King:
       "I was going to hold these off until v3.8 was out, and send them with a
        stable tag, but as everyone else is pushing much bigger fixes which
        Linus is accepting, let's save people from the hastle of having to
        patch v3.8 back into working or use a stable kernel.
      
        Looking at the diffstat, this really is high value for its size; this
        is miniscule compared to how the -rc6 to tip diffstat currently looks.
      
        So, four patches in this set:
         - Punit Agrawal reports that the kernel no longer boots on MPCore due
           to a new assumption made in the GIC code which isn't true of
           earlier GIC designs.  This is the biggest change in this set.
         - Punit's boot log also revealed a bunch of WARN_ON() dumps caused by
           the DT-ification of the GIC support without fixing up non-DT
           Realview - which now sees a greater number of interrupts than it
           did before.
         - A fix for the DMA coherent code from Marek which uses the wrong
           check for atomic allocations; this can result in spinlock lockups
           or other nasty effects.
         - A fix from Will, which will affect all Android based platforms if
           not applied (which use the 2G:2G VM split) - this causes
           particularly 'make' to misbehave unless this bug is fixed."
      
      * 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
        ARM: 7641/1: memory: fix broken mmap by ensuring TASK_UNMAPPED_BASE is aligned
        ARM: DMA mapping: fix bad atomic test
        ARM: realview: ensure that we have sufficient IRQs available
        ARM: GIC: fix GIC cpumask initialization
      39923134
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · e06b8405
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Revert iwlwifi reclaimed packet tracking, it causes problems for a
          bunch of folks.  From Emmanuel Grumbach.
      
       2) Work limiting code in brcmsmac wifi driver can clear tx status
          without processing the event.  From Arend van Spriel.
      
       3) rtlwifi USB driver processes wrong SKB, fix from Larry Finger.
      
       4) l2tp tunnel delete can race with close, fix from Tom Parkin.
      
       5) pktgen_add_device() failures are not checked at all, fix from Cong
          Wang.
      
       6) Fix unintentional removal of carrier off from tun_detach(),
          otherwise we confuse userspace, from Michael S.  Tsirkin.
      
       7) Don't leak socket reference counts and ubufs in vhost-net driver,
          from Jason Wang.
      
       8) vmxnet3 driver gets it's initial carrier state wrong, fix from Neil
          Horman.
      
       9) Protect against USB networking devices which spam the host with 0
          length frames, from Bjørn Mork.
      
      10) Prevent neighbour overflows in ipv6 for locally destined routes,
          from Marcelo Ricardo.  This is the best short-term fix for this, a
          longer term fix has been implemented in net-next.
      
      11) L2TP uses ipv4 datagram routines in it's ipv6 code, whoops.  This
          mistake is largely because the ipv6 functions don't even have some
          kind of prefix in their names to suggest they are ipv6 specific.
          From Tom Parkin.
      
      12) Check SYN packet drops properly in tcp_rcv_fastopen_synack(), from
          Yuchung Cheng.
      
      13) Fix races and TX skb freeing bugs in via-rhine's NAPI support, from
          Francois Romieu and your's truly.
      
      14) Fix infinite loops and divides by zero in TCP congestion window
          handling, from Eric Dumazet, Neal Cardwell, and Ilpo Järvinen.
      
      15) AF_PACKET tx ring handling can leak kernel memory to userspace, fix
          from Phil Sutter.
      
      16) Fix error handling in ipv6 GRE tunnel transmit, from Tommi Rantala.
      
      17) Protect XEN netback driver against hostile frontend putting garbage
          into the rings, don't leak pages in TX GOP checking, and add proper
          resource releasing in error path of xen_netbk_get_requests().  From
          Ian Campbell.
      
      18) SCTP authentication keys should be cleared out and released with
          kzfree(), from Daniel Borkmann.
      
      19) L2TP is a bit too clever trying to maintain skb->truesize, and ends
          up corrupting socket memory accounting to the point where packet
          sending is halted indefinitely.  Just remove the adjustments
          entirely, they aren't really needed.  From Eric Dumazet.
      
      20) ATM Iphase driver uses a data type with the same name as the S390
          headers, rename to fix the build.  From Heiko Carstens.
      
      21) Fix a typo in copying the inner network header offset from one SKB
          to another, from Pravin B Shelar.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (56 commits)
        net: sctp: sctp_endpoint_free: zero out secret key data
        net: sctp: sctp_setsockopt_auth_key: use kzfree instead of kfree
        atm/iphase: rename fregt_t -> ffreg_t
        net: usb: fix regression from FLAG_NOARP code
        l2tp: dont play with skb->truesize
        net: sctp: sctp_auth_key_put: use kzfree instead of kfree
        netback: correct netbk_tx_err to handle wrap around.
        xen/netback: free already allocated memory on failure in xen_netbk_get_requests
        xen/netback: don't leak pages on failure in xen_netbk_tx_check_gop.
        xen/netback: shutdown the ring if it contains garbage.
        net: qmi_wwan: add more Huawei devices, including E320
        net: cdc_ncm: add another Huawei vendor specific device
        ipv6/ip6_gre: fix error case handling in ip6gre_tunnel_xmit()
        tcp: fix for zero packets_in_flight was too broad
        brcmsmac: rework of mac80211 .flush() callback operation
        ssb: unregister gpios before unloading ssb
        bcma: unregister gpios before unloading bcma
        rtlwifi: Fix scheduling while atomic bug
        net: usbnet: fix tx_dropped statistics
        tcp: ipv6: Update MIB counters for drops
        ...
      e06b8405