Skip to content
  1. Feb 06, 2015
    • Jon Paul Maloy's avatar
      tipc: eliminate race condition at multicast reception · cb1b7280
      Jon Paul Maloy authored
      
      
      In a previous commit in this series we resolved a race problem during
      unicast message reception.
      
      Here, we resolve the same problem at multicast reception. We apply the
      same technique: an input queue serializing the delivery of arriving
      buffers. The main difference is that here we do it in two steps.
      First, the broadcast link feeds arriving buffers into the tail of an
      arrival queue, which head is consumed at the socket level, and where
      destination lookup is performed. Second, if the lookup is successful,
      the resulting buffer clones are fed into a second queue, the input
      queue. This queue is consumed at reception in the socket just like
      in the unicast case. Both queues are protected by the same lock, -the
      one of the input queue.
      
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cb1b7280
    • Jon Paul Maloy's avatar
      tipc: simplify socket multicast reception · 3c724acd
      Jon Paul Maloy authored
      
      
      The structure 'tipc_port_list' is used to collect port numbers
      representing multicast destination socket on a receiving node.
      The list is not based on a standard linked list, and is in reality
      optimized for the uncommon case that there are more than one
      multicast destinations per node. This makes the list handling
      unecessarily complex, and as a consequence, even the socket
      multicast reception becomes more complex.
      
      In this commit, we replace 'tipc_port_list' with a new 'struct
      tipc_plist', which is based on a standard list. We give the new
      list stack (push/pop) semantics, someting that simplifies
      the implementation of the function tipc_sk_mcast_rcv().
      
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3c724acd
    • Jon Paul Maloy's avatar
      tipc: simplify connection abort notifications when links break · 708ac32c
      Jon Paul Maloy authored
      
      
      The new input message queue in struct tipc_link can be used for
      delivering connection abort messages to subscribing sockets. This
      makes it possible to simplify the code for such cases.
      
      This commit removes the temporary list in tipc_node_unlock()
      used for transforming abort subscriptions to messages. Instead, the
      abort messages are now created at the moment of lost contact, and
      then added to the last failed link's generic input queue for delivery
      to the sockets concerned.
      
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      708ac32c
    • Jon Paul Maloy's avatar
      tipc: resolve race problem at unicast message reception · c637c103
      Jon Paul Maloy authored
      
      
      TIPC handles message cardinality and sequencing at the link layer,
      before passing messages upwards to the destination sockets. During the
      upcall from link to socket no locks are held. It is therefore possible,
      and we see it happen occasionally, that messages arriving in different
      threads and delivered in sequence still bypass each other before they
      reach the destination socket. This must not happen, since it violates
      the sequentiality guarantee.
      
      We solve this by adding a new input buffer queue to the link structure.
      Arriving messages are added safely to the tail of that queue by the
      link, while the head of the queue is consumed, also safely, by the
      receiving socket. Sequentiality is secured per socket by only allowing
      buffers to be dequeued inside the socket lock. Since there may be multiple
      simultaneous readers of the queue, we use a 'filter' parameter to reduce
      the risk that they peek the same buffer from the queue, hence also
      reducing the risk of contention on the receiving socket locks.
      
      This solves the sequentiality problem, and seems to cause no measurable
      performance degradation.
      
      A nice side effect of this change is that lock handling in the functions
      tipc_rcv() and tipc_bcast_rcv() now becomes uniform, something that
      will enable future simplifications of those functions.
      
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c637c103
    • Jon Paul Maloy's avatar
      tipc: use existing sk_write_queue for outgoing packet chain · 94153e36
      Jon Paul Maloy authored
      
      
      The list for outgoing traffic buffers from a socket is currently
      allocated on the stack. This forces us to initialize the queue for
      each sent message, something costing extra CPU cycles in the most
      critical data path. Later in this series we will introduce a new
      safe input buffer queue, something that would force us to initialize
      even the spinlock of the outgoing queue. A closer analysis reveals
      that the queue always is filled and emptied within the same lock_sock()
      session. It is therefore safe to use a queue aggregated in the socket
      itself for this purpose. Since there already exists a queue for this
      in struct sock, sk_write_queue, we introduce use of that queue in
      this commit.
      
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      94153e36
    • Jon Paul Maloy's avatar
      tipc: split up function tipc_msg_eval() · e3a77561
      Jon Paul Maloy authored
      
      
      The function tipc_msg_eval() is in reality doing two related, but
      different tasks. First it tries to find a new destination for named
      messages, in case there was no first lookup, or if the first lookup
      failed. Second, it does what its name suggests, evaluating the validity
      of the message and its destination, and returning an appropriate error
      code depending on the result.
      
      This is confusing, and in this commit we choose to break it up into two
      functions. A new function, tipc_msg_lookup_dest(), first attempts to find
      a new destination, if the message is of the right type. If this lookup
      fails, or if the message should not be subject to a second lookup, the
      already existing tipc_msg_reverse() is called. This function performs
      prepares the message for rejection, if applicable.
      
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e3a77561
    • Jon Paul Maloy's avatar
      tipc: enqueue arrived buffers in socket in separate function · d570d864
      Jon Paul Maloy authored
      
      
      The code for enqueuing arriving buffers in the function tipc_sk_rcv()
      contains long code lines and currently goes to two indentation levels.
      As a cosmetic preparaton for the next commits, we break it out into
      a separate function.
      
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d570d864
    • Jon Paul Maloy's avatar
      tipc: simplify message forwarding and rejection in socket layer · 1186adf7
      Jon Paul Maloy authored
      
      
      Despite recent improvements, the handling of error codes and return
      values at reception of messages in the socket layer is still confusing.
      
      In this commit, we try to make it more comprehensible. First, we
      separate between the return values coming from the functions called
      by tipc_sk_rcv(), -those are TIPC specific error codes, and the
      return values returned by tipc_sk_rcv() itself. Second, we don't
      use the returned TIPC error code as indication for whether a buffer
      should be forwarded/rejected or not; instead we use the buffer pointer
      passed along with filter_msg(). This separation is necessary because
      we sometimes want to forward messages even when there is no error
      (i.e., protocol messages and successfully secondary looked up data
      messages).
      
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1186adf7
    • Jon Paul Maloy's avatar
      tipc: reduce usage of context info in socket and link · c5898636
      Jon Paul Maloy authored
      
      
      The most common usage of namespace information is when we fetch the
      own node addess from the net structure. This leads to a lot of
      passing around of a parameter of type 'struct net *' between
      functions just to make them able to obtain this address.
      
      However, in many cases this is unnecessary. The own node address
      is readily available as a member of both struct tipc_sock and
      tipc_link, and can be fetched from there instead.
      The fact that the vast majority of functions in socket.c and link.c
      anyway are maintaining a pointer to their respective base structures
      makes this option even more compelling.
      
      In this commit, we introduce the inline functions tsk_own_node()
      and link_own_node() to make it easy for functions to fetch the node
      address from those structs instead of having to pass along and
      dereference the namespace struct.
      
      In particular, we make calls to the msg_xx() functions in msg.{h,c}
      context independent by directly passing them the own node address
      as parameter when needed. Those functions should be regarded as
      leaves in the code dependency tree, and it is hence desirable to
      keep them namspace unaware.
      
      Apart from a potential positive effect on cache behavior, these
      changes make it easier to introduce the changes that will follow
      later in this series.
      
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c5898636
    • Takashi Iwai's avatar
      hso: Use static attribute groups for sysfs entry · 4134069f
      Takashi Iwai authored
      
      
      Pass the static attribute groups and the driver data via
      tty_port_register_device_attr() instead of manual device_create_file()
      and device_remove_file() calls.
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4134069f
    • David S. Miller's avatar
      Merge branch 'isdnloop_checkpatch' · b0ebfaea
      David S. Miller authored
      
      
      Bas Peters says:
      
      ====================
      Fix checkpatch errors in drivers/isdn/isdnloop
      
      This patchset adresses various checkpatch errors in the abovementioned driver.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b0ebfaea
    • Bas Peters's avatar
      drivers: isdn: isdnloop: isdnloop.c: Remove parenthesis around return values,... · 3581ec58
      Bas Peters authored
      
      drivers: isdn: isdnloop: isdnloop.c: Remove parenthesis around return values, as specified in CodingStyle.
      
      Signed-off-by: default avatarBas Peters <baspeters93@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3581ec58
    • Bas Peters's avatar
    • Bas Peters's avatar
      drivers: isdn: isdnloop: isdnloop.c: remove assignment of variables in if... · 50a58b6b
      Bas Peters authored
      
      drivers: isdn: isdnloop: isdnloop.c: remove assignment of variables in if conditions, in accordance with the CodingStyle.
      
      Signed-off-by: default avatarBas Peters <baspeters93@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      50a58b6b
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 6e03f896
      David S. Miller authored
      
      
      Conflicts:
      	drivers/net/vxlan.c
      	drivers/vhost/net.c
      	include/linux/if_vlan.h
      	net/core/dev.c
      
      The net/core/dev.c conflict was the overlap of one commit marking an
      existing function static whilst another was adding a new function.
      
      In the include/linux/if_vlan.h case, the type used for a local
      variable was changed in 'net', whereas the function got rewritten
      to fix a stacked vlan bug in 'net-next'.
      
      In drivers/vhost/net.c, Al Viro's iov_iter conversions in 'net-next'
      overlapped with an endainness fix for VHOST 1.0 in 'net'.
      
      In drivers/net/vxlan.c, vxlan_find_vni() added a 'flags' parameter
      in 'net-next' whereas in 'net' there was a bug fix to pass in the
      correct network namespace pointer in calls to this function.
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6e03f896
    • Linus Torvalds's avatar
      MMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 9d82f5eb
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Stretch ACKs can kill performance with Reno and CUBIC congestion
          control, largely due to LRO and GRO.  Fix from Neal Cardwell.
      
       2) Fix userland breakage because we accidently emit zero length netlink
          messages from the bridging code.  From Roopa Prabhu.
      
       3) Carry handling in generic csum_tcpudp_nofold is broken, fix from
          Karl Beldan.
      
       4) Remove bogus dev_set_net() calls from CAIF driver, from Nicolas
          Dichtel.
      
       5) Make sure PPP deflation never returns a length greater then the
          output buffer, otherwise we overflow and trigger skb_over_panic().
          Fix from Florian Westphal.
      
       6) COSA driver needs VIRT_TO_BUS Kconfig dependencies, from Arnd
          Bergmann.
      
       7) Don't increase route cached MTU on datagram too big ICMPs.  From Li
          Wei.
      
       8) Fix error path leaks in nf_tables, from Pablo Neira Ayuso.
      
       9) Fix bitmask handling regression in netlink that broke things like
          acpi userland tools.  From Pablo Neira Ayuso.
      
      10) Wrong header pointer passed to param_type2af() in SCTP code, from
          Saran Maruti Ramanara.
      
      11) Stacked vlans not handled correctly by vlan_get_protocol(), from
          Toshiaki Makita.
      
      12) Add missing DMA memory barrier to xgene driver, from Iyappan
          Subramanian.
      
      13) Fix crash in rate estimators, from Eric Dumazet.
      
      14) We've been adding various workarounds, one after another, for the
          change which added the per-net tcp_sock.  It was meant to reduce
          socket contention but added lots of problems.
      
          Reduce this instead to a proper per-cpu socket and that rids us of
          all the daemons.
      
          From Eric Dumazet.
      
      15) Fix memory corruption and OOPS in mlx4 driver, from Jack
          Morgenstein.
      
      16) When we disabled UFO in the virtio_net device, it introduces some
          serious performance regressions.  The orignal problem was IPV6
          fragment ID generation, so fix that properly instead.  From Vlad
          Yasevich.
      
      17) sr9700 driver build breaks on xtensa because it defines macros with
          the same name as those used by the arch code.  Use more unique
          names.  From Chen Gang.
      
      18) Fix endianness in new virio 1.0 mode of the vhost net driver, from
          Michael S Tsirkin.
      
      19) Several sysctls were setting the maxlen attribute incorrectly, from
          Sasha Levin.
      
      20) Don't accept an FQ scheduler quantum of zero, that leads to crashes.
          From Kenneth Klette Jonassen.
      
      21) Fix dumping of non-existing actions in the packet scheduler
          classifier.  From Ignacy Gawędzki.
      
      22) Return the write work_done value when doing TX work in the qlcnic
          driver.
      
      23) ip6gre_err accesses the info field with the wrong endianness, from
          Sabrina Dubroca.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (54 commits)
        sit: fix some __be16/u16 mismatches
        ipv6: fix sparse errors in ip6_make_flowlabel()
        net: remove some sparse warnings
        flow_keys: n_proto type should be __be16
        ip6_gre: fix endianness errors in ip6gre_err
        qlcnic: Fix NAPI poll routine for Tx completion
        amd-xgbe: Set RSS enablement based on hardware features
        amd-xgbe: Adjust for zero-based traffic class count
        cls_api.c: Fix dumping of non-existing actions' stats.
        pkt_sched: fq: avoid hang when quantum 0
        net: rds: use correct size for max unacked packets and bytes
        vhost/net: fix up num_buffers endian-ness
        gianfar: correct the bad expression while writing bit-pattern
        net: usb: sr9700: Use 'SR_' prefix for the common register macros
        Revert "drivers/net: Disable UFO through virtio"
        Revert "drivers/net, ipv6: Select IPv6 fragment idents for virtio UFO packets"
        ipv6: Select fragment id during UFO segmentation if not set.
        xen-netback: stop the guest rx thread after a fatal error
        net/mlx4_core: Fix kernel Oops (mem corruption) when working with more than 80 VFs
        isdn: off by one in connect_res()
        ...
      9d82f5eb
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 14365ea2
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "This patch set is fixing two serious problems which have turned up
        late in the release cycle.
      
        The first fixes a problem with 4k sector disks where the transfer
        length (amount of data sent to the disk) was getting increased every
        time the disk was revalidated leading to potential for overflows.
      
        The other is a regression oops fix for some of our last merge window
        code"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        sd: Fix max transfer length for 4k disks
        scsi: fix device handler detach oops
      14365ea2
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · 42345d63
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Radeon and amdkfd fixes.
      
        Radeon ones mostly for oops in some test/benchmark functions since
        fencing changes, and one regression fix for old GPUs,
      
        There is one cirrus regression fix, the 32bpp broke userspace, so this
        hides it behind a module option for the few users who care.
      
        I'm off for a few days, so this is probably the final pull I have, if
        I see fixes from Intel I'll forward the pull as I should have email"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm/cirrus: Limit modes depending on bpp option
        drm/radeon: fix the crash in test functions
        drm/radeon: fix the crash in benchmark functions
        drm/radeon: properly set vm fragment size for TN/RL
        drm/radeon: don't init gpuvm if accel is disabled (v3)
        drm/radeon: fix PLLs on RS880 and older v2
        drm/amdkfd: Don't create BUG due to incorrect user parameter
        drm/amdkfd: max num of queues can't be 0
        drm/amdkfd: Fix bug in accounting of queues
      42345d63
    • Linus Torvalds's avatar
      Merge tag 'spi-v3.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi · d445d46d
      Linus Torvalds authored
      Pull spi fixes from Mark Brown:
       "A couple of driver specific fixes:
      
         - Disable DMA mode for i.MX6DL chips due to a hardware bug.
      
         - Don't use devm_kzalloc() outside of bind/unbind paths in the
           fsl-dspi driver, fixing memory leaks"
      
      * tag 'spi-v3.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
        spi: imx: use pio mode for i.mx6dl
        spi: spi-fsl-dspi: Remove usage of devm_kzalloc
      d445d46d
    • Linus Torvalds's avatar
      Merge tag 'pm+acpi-3.19-fin' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · e7394c77
      Linus Torvalds authored
      Pull ACPI power management fix from Rafael  Wysocki:
       "This is a revert of an ACPI Low-power Subsystem (LPSS) driver change
        that was supposed to improve power management of the LPSS DMA
        controller, but introduced more serious problems.
      
        Since fixing them turns out to be non-trivial, it is better to revert
        the commit in question at this point and try to fix the original issue
        differently in the next cycle"
      
      * tag 'pm+acpi-3.19-fin' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        Revert "ACPI / LPSS: introduce a 'proxy' device to power on LPSS for DMA"
      e7394c77
    • Linus Torvalds's avatar
      Merge tag 'pci-v3.19-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · f3c2352d
      Linus Torvalds authored
      Pull PCI fixes from Bjorn Helgaas:
       "Enumeration
          - Scan all device numbers on NEC as well as Stratus (Charlotte Richardson)
      
        Resource management
          - Handle read-only BARs on AMD CS553x devices (Myron Stowe)
      
        Synopsys DesignWare
          - Reject MSI-X IRQs (Lucas Stach)"
      
      * tag 'pci-v3.19-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        PCI: Handle read-only BARs on AMD CS553x devices
        PCI: Add NEC variants to Stratus ftServer PCIe DMI check
        PCI: designware: Reject MSI-X IRQs
      f3c2352d
  2. Feb 05, 2015