1. 08 Feb, 2013 2 commits
  2. 04 Feb, 2013 3 commits
    • Bjørn Mork's avatar
      net: usbnet: fix tx_dropped statistics · bf414b36
      Bjørn Mork authored
      It is normal for minidrivers accumulating frames to return NULL
      from their tx_fixup function. We do not want to count this as a
      drop, or log any debug messages.  A different exit path is
      therefore chosen for such drivers, skipping the debug message
      and the tx_dropped increment.
      
      The test for accumulating drivers was however completely bogus,
      making the exit path selection depend on whether the user had
      enabled tx_err logging or not. This would arbitrarily mess up
      accounting for both accumulating and non-accumulating minidrivers,
      and would result in unwanted debug messages for the accumulating
      drivers.
      
      Fix by testing for FLAG_MULTI_PACKET instead, which probably was
      the intention from the beginning.  This usage match the documented
      behaviour of this flag:
      
       Indicates to usbnet, that USB driver accumulates multiple IP packets.
       Affects statistic (counters) and short packet handling.
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bf414b36
    • Vijay Subramanian's avatar
      tcp: ipv6: Update MIB counters for drops · 5f1e942c
      Vijay Subramanian authored
      This patch updates LINUX_MIB_LISTENDROPS and LINUX_MIB_LISTENOVERFLOWS in
      tcp_v6_conn_request() and tcp_v6_err(). tcp_v6_conn_request() in particular can
      drop SYNs for various reasons which are not currently tracked.
      Signed-off-by: default avatarVijay Subramanian <subramanian.vijay@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5f1e942c
    • Vijay Subramanian's avatar
      tcp: Update MIB counters for drops · 848bf15f
      Vijay Subramanian authored
      This patch updates LINUX_MIB_LISTENDROPS in tcp_v4_conn_request() and
      tcp_v4_err(). tcp_v4_conn_request() in particular can drop SYNs for various
      reasons which are not currently tracked.
      Signed-off-by: default avatarVijay Subramanian <subramanian.vijay@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      848bf15f
  3. 03 Feb, 2013 6 commits
  4. 01 Feb, 2013 3 commits
  5. 31 Jan, 2013 6 commits
  6. 30 Jan, 2013 2 commits
  7. 29 Jan, 2013 14 commits
    • Neil Horman's avatar
      vmxnet3: set carrier state properly on probe · 6cdd20c3
      Neil Horman authored
      vmxnet3 fails to set netif_carrier_off on probe, meaning that when an interface
      is opened the __LINK_STATE_NOCARRIER bit is already cleared, and so
      /sys/class/net/<ifname>/operstate remains in the unknown state.  Correct this by
      setting netif_carrier_off on probe, like other drivers do.
      
      Also, while we're at it, lets remove the netif_carrier_ok checks from the
      link_state_update function, as that check is atomically contained within the
      netif_carrier_[on|off] functions anyway
      
      Tested successfully by myself
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      CC: "David S. Miller" <davem@davemloft.net>
      CC: "VMware, Inc." <pv-drivers@vmware.com>
      CC: Ben Hutchings <bhutchings@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6cdd20c3
    • Bruce Allan's avatar
      e1000e: enable ECC on I217/I218 to catch packet buffer memory errors · 28600304
      Bruce Allan authored
      In rare instances, memory errors have been detected in the internal packet
      buffer memory on I217/I218 when stressed under certain environmental
      conditions.  Enable Error Correcting Code (ECC) in hardware to catch both
      correctable and uncorrectable errors.  Correctable errors will be handled
      by the hardware.  Uncorrectable errors in the packet buffer will cause the
      packet to be received with an error indication in the buffer descriptor
      causing the packet to be discarded.  If the uncorrectable error is in the
      descriptor itself, the hardware will stop and interrupt the driver
      indicating the error.  The driver will then reset the hardware in order to
      clear the error and restart.
      
      Both types of errors will be accounted for in statistics counters.
      Signed-off-by: default avatarBruce Allan <bruce.w.allan@intel.com>
      Cc: <stable@vger.kernel.org> # 3.5.x & 3.6.x
      Tested-by: default avatarJeff Pieper <jeffrey.e.pieper@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      28600304
    • Milos Vyletel's avatar
      bonding: unset primary slave via sysfs · eb492f74
      Milos Vyletel authored
      When bonding module is loaded with primary parameter and one decides to unset
      primary slave using sysfs these settings are not preserved during bond device
      restart. Primary slave is only unset once and it's not remembered in
      bond->params structure. Below is example of recreation.
      
       grep OPTS /etc/sysconfig/network-scripts/ifcfg-bond0
      BONDING_OPTS="mode=active-backup miimon=100 primary=eth01"
       grep "Primary Slave" /proc/net/bonding/bond0
      Primary Slave: eth01 (primary_reselect always)
      
       echo "" > /sys/class/net/bond0/bonding/primary
       grep "Primary Slave" /proc/net/bonding/bond0
      Primary Slave: None
      
       sed -i -e 's/primary=eth01//' /etc/sysconfig/network-scripts/ifcfg-bond0
       grep OPTS /etc/sysconfig/network-scripts/ifcfg-bond
      BONDING_OPTS="mode=active-backup miimon=100 "
       ifdown bond0 && ifup bond0
      
      without patch:
       grep "Primary Slave" /proc/net/bonding/bond0
      Primary Slave: eth01 (primary_reselect always)
      
      with patch:
       grep "Primary Slave" /proc/net/bonding/bond0
      Primary Slave: None
      Reviewed-by: default avatarJiri Pirko <jiri@resnulli.us>
      Signed-off-by: default avatarMilos Vyletel <milos.vyletel@sde.cz>
      Signed-off-by: default avatarJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      eb492f74
    • Nivedita Singhvi's avatar
      tcp: Increment LISTENOVERFLOW and LISTENDROPS in tcp_v4_conn_request() · 2aeef18d
      Nivedita Singhvi authored
      We drop a connection request if the accept backlog is full and there are
      sufficient packets in the syn queue to warrant starting drops. Increment the
      appropriate counters so this isn't silent, for accurate stats and help in
      debugging.
      
      This patch assumes LINUX_MIB_LISTENDROPS is a superset of/includes the
      counter LINUX_MIB_LISTENOVERFLOWS.
      Signed-off-by: default avatarNivedita Singhvi <niv@us.ibm.com>
      Acked-by: default avatarVijay Subramanian <subramanian.vijay@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2aeef18d
    • YOSHIFUJI Hideaki / 吉藤英明's avatar
      ipv6 addrconf: Fix interface identifiers of 802.15.4 devices. · 5e98a36e
      YOSHIFUJI Hideaki / 吉藤英明 authored
      The "Universal/Local" (U/L) bit must be complmented according to RFC4944
      and RFC2464.
      Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5e98a36e
    • Sarveshwar Bandi's avatar
    • Jason Wang's avatar
      tuntap: allow polling/writing/reading when detached · 9e85722d
      Jason Wang authored
      We forbid polling, writing and reading when the file were detached, this may
      complex the user in several cases:
      
      - when guest pass some buffers to vhost/qemu and then disable some queues,
        host/qemu needs to do its own cleanup on those buffers which is complex
        sometimes. We can do this simply by allowing a user can still write to an
        disabled queue. Write to an disabled queue will cause the packet pass to the
        kernel and read will get nothing.
      - align the polling behavior with macvtap which never fails when the queue is
        created. This can simplify the polling errors handling of its user (e.g vhost)
      
      We can simply achieve this by don't assign NULL to tfile->tun when detached.
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9e85722d
    • Jason Wang's avatar
      vhost_net: handle polling errors when setting backend · 2b8b328b
      Jason Wang authored
      Currently, the polling errors were ignored, which can lead following issues:
      
      - vhost remove itself unconditionally from waitqueue when stopping the poll,
        this may crash the kernel since the previous attempt of starting may fail to
        add itself to the waitqueue
      - userspace may think the backend were successfully set even when the polling
        failed.
      
      Solve this by:
      
      - check poll->wqh before trying to remove from waitqueue
      - report polling errors in vhost_poll_start(), tx_poll_start(), the return value
        will be checked and returned when userspace want to set the backend
      
      After this fix, there still could be a polling failure after backend is set, it
      will addressed by the next patch.
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2b8b328b
    • Jason Wang's avatar
      vhost_net: correct error handling in vhost_net_set_backend() · 692a998b
      Jason Wang authored
      Currently, when vhost_init_used() fails the sock refcnt and ubufs were
      leaked. Correct this by calling vhost_init_used() before assign ubufs and
      restore the oldsock when it fails.
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      692a998b
    • Michael S. Tsirkin's avatar
      tun: fix carrier on/off status · af668b3c
      Michael S. Tsirkin authored
      Commit c8d68e6b removed carrier off call
      from tun_detach since it's now called on queue disable and not only on
      tun close.  This confuses userspace which used this flag to detect a
      free tun. To fix, put this back but under if (clean).
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Tested-by: default avatarJason Wang <jasowang@redhat.com>
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      Tested-by: default avatarToralf Förster <toralf.foerster@gmx.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      af668b3c
    • Cong Wang's avatar
      pktgen: correctly handle failures when adding a device · 604dfd6e
      Cong Wang authored
      The return value of pktgen_add_device() is not checked, so
      even if we fail to add some device, for example, non-exist one,
      we still see "OK:...". This patch fixes it.
      
      After this patch, I got:
      
      	# echo "add_device non-exist" > /proc/net/pktgen/kpktgend_0
      	-bash: echo: write error: No such device
      	# cat /proc/net/pktgen/kpktgend_0
      	Running:
      	Stopped:
      	Result: ERROR: can not add device non-exist
      	# echo "add_device eth0" > /proc/net/pktgen/kpktgend_0
      	# cat /proc/net/pktgen/kpktgend_0
      	Running:
      	Stopped: eth0
      	Result: OK: add_device=eth0
      
      (Candidate for -stable)
      
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarCong Wang <amwang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      604dfd6e
    • Johannes Naab's avatar
      netem: fix delay calculation in rate extension · a13d3104
      Johannes Naab authored
      The delay calculation with the rate extension introduces in v3.3 does
      not properly work, if other packets are still queued for transmission.
      For the delay calculation to work, both delay types (latency and delay
      introduces by rate limitation) have to be handled differently. The
      latency delay for a packet can overlap with the delay of other packets.
      The delay introduced by the rate however is separate, and can only
      start, once all other rate-introduced delays finished.
      
      Latency delay is from same distribution for each packet, rate delay
      depends on the packet size.
      
      .: latency delay
      -: rate delay
      x: additional delay we have to wait since another packet is currently
         transmitted
      
        .....----                    Packet 1
          .....xx------              Packet 2
                     .....------     Packet 3
          ^^^^^
          latency stacks
               ^^
               rate delay doesn't stack
                     ^^
                     latency stacks
      
        -----> time
      
      When a packet is enqueued, we first consider the latency delay. If other
      packets are already queued, we can reduce the latency delay until the
      last packet in the queue is send, however the latency delay cannot be
      <0, since this would mean that the rate is overcommitted.  The new
      reference point is the time at which the last packet will be send. To
      find the time, when the packet should be send, the rate introduces delay
      has to be added on top of that.
      Signed-off-by: default avatarJohannes Naab <jn@stusta.de>
      Acked-by: default avatarHagen Paul Pfeifer <hagen@jauu.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a13d3104
    • Tom Parkin's avatar
      l2tp: prevent l2tp_tunnel_delete racing with userspace close · 80d84ef3
      Tom Parkin authored
      If a tunnel socket is created by userspace, l2tp hooks the socket destructor
      in order to clean up resources if userspace closes the socket or crashes.  It
      also caches a pointer to the struct sock for use in the data path and in the
      netlink interface.
      
      While it is safe to use the cached sock pointer in the data path, where the
      skb references keep the socket alive, it is not safe to use it elsewhere as
      such access introduces a race with userspace closing the socket.  In
      particular, l2tp_tunnel_delete is prone to oopsing if a multithreaded
      userspace application closes a socket at the same time as sending a netlink
      delete command for the tunnel.
      
      This patch fixes this oops by forcing l2tp_tunnel_delete to explicitly look up
      a tunnel socket held by userspace using sockfd_lookup().
      Signed-off-by: default avatarTom Parkin <tparkin@katalix.com>
      Signed-off-by: default avatarJames Chapman <jchapman@katalix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      80d84ef3
    • Linus Torvalds's avatar
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · fc16e884
      Linus Torvalds authored
      Pull powerpc fixes from Benjamin Herrenschmidt:
       "Whenever you have a chance between two dives, you might want to
        consider pulling my merge branch to pickup a few fixes for 3.8 that
        have been accumulating for the last couple of weeks (I was myself
        travelling then on vacation).
      
        Nothing major, just a handful of powerpc bug fixes that I consider
        worth getting in before 3.8 goes final."
      
      And I'll have everybody know that I'm not diving for several days yet.
      Snif.
      
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
        powerpc: Max next_tb to prevent from replaying timer interrupt
        powerpc: kernel/kgdb.c: Fix memory leakage
        powerpc/book3e: Disable interrupt after preempt_schedule_irq
        powerpc/oprofile: Fix error in oprofile power7_marked_instr_event() function
        powerpc/pasemi: Fix crash on reboot
        powerpc: Fix MAX_STACK_TRACE_ENTRIES too low warning for ppc32
      fc16e884
  8. 28 Jan, 2013 4 commits